How the Bitcoin Blockchain Really Works

A Semi-Technical Point of View

FastForwardist
2 min readFeb 28, 2022

Let’s start with a transaction — I need to send 0.1 BTC to my brother. What really goes on under the hood?

  1. I make a transaction by providing a digital signature, which is a function of my private key hashed with the message (-0.1 BTC for me, +0.1 BTC to my brother. This is linked to my public wallet address and now marked with a unique transaction ID.
  2. This transaction then gets broadcast to the Bitcoin miner network, which constantly listens to transactions. They record these on their own ledgers stored in their own machines. The protocol only accepts signed transactions to maintain security, while also guarding against overspending by verifying previous transactions or reference inputs from the initiator.
  3. Dozens of other similar transactions get broadcast to the miner network at the same time.
  4. Miners, which act as the block creators, start competing for who can add these transactions to the current block through proof of work. They do this by looking for a random number (through brute force trial and error) that they hash with the batch of transactions such that the output of the hash function gets to the right number of 0s, e.g. 30 zeroes. This is a system that is easy to verify but hard to do, and all the work is intrinsically tied to this unique batch of transactions which is the Block.
  5. The winner broadcasts it back out to the other block creators. When they broadcast it, they add the previous hash and the block reward (adding to total money supply) they are getting together with the block. The blocks string together to form a chain — hence, blockchain.
  6. Because the winner does the most computational work to complete this, they are the trusted source and the other miners now have to update their ledgers. This is where the longest chain wins and consensus gets established. Settlement is now final and the transaction can no longer be reversed.
  7. The cycle repeats for the next block with the next batch of transactions.

Cryptography is present in various steps here, from the hashing of the private key, to the hashing of the random number with the batch of transactions, to the hashing of the current block with the previous block. Consensus is ultimately established by way of ingenious math. This is why Bitcoin is the first form of money that is backed by math instead of goons with guns. Retracing these steps makes me realize how much of a work of genius Bitcoin truly is.

--

--