What is a Blockchain?

When we advocate for Bitcoin, one of the benefits we point to is the security of the blockchain. But what does that mean?

Ultimately, the blockchain is the public ledger of all transactions on a digital asset network like Bitcoin. From here on out, we will talk about Bitcoin's blockchain, but the same principles apply to all cryptocurrencies.

Why is it important to have a public ledger? The main benefit is that anyone who uses the network can verify on their own what transactions occurred. This means we don't have to trust a third party to make sure that our transaction has gone through. We can just look at the blockchain and see our transaction confirmed. As Bitcoiners say, "Don't trust; verify." The public ledger eliminates the need for trust by replacing it with Cryptography.

If we know who owns each address in a transaction, we can even verify among whom the transactions took place.

This is usually done by following Anti Money Laundering practices such as "Know Your Customer", commonly referred to as simply AML or KYC. This prevents all sorts of problems that fiat currency systems have such as embezzlement and drug trafficking.

So how does the blockchain work? We discussed this in our Bitcoin mining article, but let's dive a little deeper here. Building from the bottom up, we refer to Transactions as payments from one or more accounts to one or more recipients.

A Block is a collection of all Transactions over the last 10 minutes. And the Blockchain is the public ledger of all blocks confirmed by the network.

Bitcoin transactions have several key pieces of information: the address of the sender(s), the address of the recipient(s), the amounts to and from each account, and a small transaction fee. In addition to the senders addresses, a cryptographic signature needs to be supplied for each sender, to make sure that they are the rightful owners of those addresses and are signing off on the payment, just like a written check.

The transaction fee goes to the miner, and is used to prioritize transactions when there are too many pending transactions to be included in a single block.

All of the information in each transaction is combined and passed through a Hash Function, and the resulting hash output becomes the Transaction ID. Hash functions take a large amount of data and convert it into a smaller amount of data, sometimes called a “digest.” You can think of this as a URL shortener: a long URL is shortened into a small code.

So a hash function will take an arbitrary amount of data, either a word, a complete sentence, or an entire novel, and return a digest of that data that has a finite size. More importantly, if you pass the exact same input into the hash function, you will get the same output every time. Bitcoin uses the SHA-256 hash function, which has been used in cryptography and online banking since 2001.

Every 10 minutes, all of the transactions that were attempted on the network are bundled together and confirmed by the miners securing the network. These blocks have four main components:

  • The hash function output of the previous block, thus creating a chain.
  • A transaction creating a small, predetermined number of new Bitcoin and depositing them in the miner’s wallet. This is the reward for confirming transactions and securing the network, currently set to 6.25 BTC.
  • The list of all transaction IDs that the miner is able to confirm.
  • A nonce value that adjusts the hash value of the block so that it includes a specific number of leading zeroes, which is dictated by the current network difficulty.

Wait a second, what is a nonce?? I tried to sneak that in there, but it's the one critical piece of the puzzle that makes bitcoin mining work. A “Nonce” is a number that is only used once, for a specific cryptographic purpose, and is otherwise meaningless. Since each minor change to the input of the hash function changes the output, the nonce is just a random number that miners will keep adjusting until they get a hash output that has enough zeroes at the front.

There are thousands of bitcoin miners that are trying to confirm the transactions and secure the network. However, only one of them can be rewarded. So Bitcoin requires the hash value of each block to have a certain number of zeroes.

Performing this search for a valid hash output is computationally intensive work. This is what we mean when we say "Proof of Work". The miners prove that they have done the work by providing a hash output that was very hard to come by. Further, validating blocks is purposefully made difficult so that on average, one block will be added to the blockchain every 10 minutes. Since total miner hashing power generally increases over time, this difficulty is adjusted every two weeks. This keeps the average time it takes for new blocks to be added to be block chain relatively steady at 10 minutes.

So that's basically how the block chain works! It's obviously a very technical process, but hopefully I was able to simplify it enough for non-technical folks to understand. If you have any questions, please reach out to us! We want to make this clear enough for anyone to be confident that they understand the underlying technology.

For those curious, you can view a live copy of the blockchain by googling for a "bitcoin explorer" such as this one: https://blockstream.info/