How Do Bitcoin Transactions Actually Work?

How Do Bitcoin Transactions Actually Work?

05/31/17 3:56 PM 2017-06-01 08:26:14
Whether you’re interested in becoming a developer for blockchain applications, or you’re just looking to understand what happens under the hood when you send bitcoin to a friend, it’s good to have a w

Whether you’re interested in becoming a developer for blockchain applications, or you’re just looking to understand what happens under the hood when you send bitcoin to a friend, it’s good to have a working knowledge of what happens when you create and broadcast Bitcoin transactions to the Bitcoin network. Why?

Because transactions are a basic entity on top of which the bitcoin blockchain is constructed. Transactions are the result of a brilliant collision of cryptography, data structures, and simple non-turing-complete scripting. They’re simple enough that common transaction types aren’t overly-complex, but flexible enough to allow developers to encode fairly customized transactions types as well. Today we’ll take a tour of the former.

As a developer, how does your bitcoin client post a new transaction to the network (and what happens when it’s received)?

What exactly is happening when you send some bitcoin to a friend?

This post will assume that the reader has a basic understanding of hashing, asymmetric cryptography, and P2P networking. It’s also a good idea to have a good sense for what exactly a blockchain is, even if you’re unfamiliar with any specific mechanics.

 

Bitcoin Transactions and their role in the bigger picture

 

Bitcoin is comprised of a few major pieces: nodes and a blockchain. The role of a typical node is to maintain its own blockchain version and update it once it hears of a “better” (longer) version. Simply put, the blockchain has blocks, and blocks have transactions.

With this simplified but accurate picture in mind, you might be wondering what exactly a transaction is made out of.

  • How will understanding transactions help me to become a
  • How do transactions allow me to transfer some bitcoin to a friend?

 

BGMEM v2

It turns out that the answers to these questions vary based on many things. Even assuming that we’re talking only bitcoin, we can use transactions in a number of creative ways to accomplish a variety of personalized goals. Let’s start at the beginning, that is, let’s take a look a good old-fashioned pay-to-PK-hash transaction type. After all, this type of transaction accounts for over 99% of all transactions on the

Hungry for knowledge?
New guides and courses each week
Looking to invest?
Market data, analysis, and reports
Just curious?
A community of blockchain experts to help

Get started today and earn 4 bonus blocks

Already have an account? Sign In

',a='
';return t.replace("ID",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement("iframe"),t="https://www.youtube.com/embed/ID?autoplay=1";t+=0===this.dataset.query.length?'':'&'+this.dataset.query;e.setAttribute("src",t.replace("ID",this.dataset.id)),e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","1"),this.parentNode.replaceChild(e,this)}document.addEventListener("DOMContentLoaded",function(){var e,t,a=document.getElementsByClassName("rll-youtube-player");for(t=0;t