Ever since I began building my presence in the decentralization industry I’ve found myself giving many an impromptu Bitcoin 101 lecture – usually about two or three questions into the Pandora’s Box that is “So, what do you do?”
While I do enjoy bouncing my explanations off of various friends and colleagues; honing my pitch and presentation with each delivery, I can’t help but think it might be a little easier for everyone involved if I wrote it all out like I were answering a question on r/explainlikeimfive that I could reference and refer to.
That is what I intend to do here. We’ll see how that goes. You be the judge!
WTF is a Bitcoin?
Whoa, hold on there pal. Bitcoin, with a capital ‘B’, is the peer-to-peer network that allows the transacting of bitcoin(s) (little ‘b’). Thus a bitcoin is simply a unit representing the transfer of value within the Bitcoin ecosystem.
To better understand just what a bitcoin is and how it is able to traverse the Bitcoin Network we will ultimately follow one all the way from its creation to whomever ‘mined’ it to an exchange or perhaps even your own wallet. First we need to get a few basics out of the way so bear with me…
Blocks? Like Legos?
Yeah… kindof. In order for transactions to be confirmed as valid by the network they need to be included in a block that is built upon the chain of previous blocks that came before it.
“But how are transactions put into blocks” you ask? Great question!
Some of the nodes on the network participate in a process called mining through which they collect the stray transactions relayed to them by other nodes and build them into blocks which are then broadcast back out to the network.
Each block is subject to a number of rules governed by the network and the software that underlies it all. Most controversial for Bitcoin as of recent is the 1 megabyte size limit miners must work within, cramming as many transactions as possible into each block to maximize the collection of transaction fees. Alternatively some miners choose to produce empty blocks to decrease latency in producing/transmitting blocks.
The other major factor built into the system is the network difficulty which governs how often blocks are ‘found’ and added to the chain. Difficulty is adjusted every 2016 blocks to target a spacing of 10 minutes between each block based upon the average inter-block-time of the previous 2016 blocks.
This functions to keep the network running at a steady pace despite computing power being added to or removed from the network and underpins what is known as the Proof of Work method for securing our blockchain.
Let’s pretend we are a piece of mining software. At any given moment our job is to put together a collection of unconfirmed transactions, the header from the previous block on the blockchain and a random value called a nonce. Together with a few other bits and pieces this is our block-candidate.
Below is an approximation of our block in pseudo-code. This may not accurately represent how the data is actually structured but should serve to help illustrate what’s going on.
Previous Block Header
We then take this block of data and put it through a cryptographic hashing algorithm – in Bitcoin’s case we use a variation on SHA256d – which reduces it all down to a string of hexadecimal characters that we will include in our block’s header.
This example is an IRL Bitcoin block’s hash, the top block when I copy/pasted it here actually.
Notice the string of 0’s at the beginning. Those in the computer science field will instinctively understand that each of those 0’s corresponds to a longer sequence of four ‘off bits’ (0’s) when the number is denoted in binary rather than hexadecimal.
Network difficulty governs how many of these leading zeros must exist in the beginning of our block’s binary hash before it will even be considered for acceptance by the network.
Because the hash function maps to this space of numbers in a statistically unbiased way we can know the probability of generating a hash that meets the difficulty criterion and thus how many hashes we will need to generate on average in order to find one that does.
This is where the nonce comes in. If we just rehash the same data then the resulting output will not change, so rather than rearrange the contents of our block we’ll simply change (increment, typically) the nonce we’re using after each failure and check to see if that results in a valid hash.
If it does we send that puppy out to the network to be confirmed so we can collect our reward!
Money From Nothing
I can already hear you saying “that’s all fine and dandy, AvY but all we really care about is the money. Show us the money already, dammit!”
Fair enough. For all of this work we’ve put in I agree that we deserve some kind of compensation for securing everyone’s transactions.
Luckily so does the network!
As a reward for doing all of this as a miner we are allowed to include one extra transaction known as the coinbase transaction in each block we mine which effectively creates coins out of thin air and transfers them into our wallet.
When Bitcoin was brand new circa January 2009 this reward started at 50 bitcoins per block and roughly every four years the block-reward is cut in half in an event that has come to be known as The Halving or Halvening. This dispersion schedule ensures that the total supply of bitcoins will never exceed 21 million.
And so our journey begins….
As a freshly minted – or mined – bitcoin we find ourselves assigned to whichever Bitcoin address was specified as the destination or ‘output‘ in the aforementioned coinbase transaction. We don’t actually exist anywhere, we are just referred to by this transaction verifying the validity of our ownership on the blockchain.
Before we can go any further we’ll need cover some more theory to explain addresses, public/private keys and just how transactions are constructed/signed using cryptography.
Stay tuned for part two where we’ll continue our blockchain adventure!
To be notified whenever a new post goes live and increase bloodflow to your genitalia* please be sure to like and follow AvY Enterprises on Facebook.
*This statement has not been evaluated by the United States FDA.
Please don’t sue me!