How Blockchains Work

A blockchain is a database but with some unique properties:

[wpdatatable id=5]

The two most important differences between a blockchain and a traditional database is that blockchains are immutable and not owned by anyone. Anybody can use a blockchain and anything recorded to the blockchain is extremely difficult to change.

Benefits of Blockchains

Blockchains have major benefits over traditional databases.

You don't need a trusted third party to verify a transaction. For example, without a blockchain, you need to rely on Visa or a bank to confirm that money is sent or received.

With a blockchain, this verification can be done through a distributed network on the cloud.

Cryptocurrencies make money digitally native which grants new capabilities and makes people more independent from existing institutions. Blockchains and cryptocurrencies have many use cases beyond our financial system.

With cryptocurrencies, everyone gets a copy of the blockchain and can track every transaction from the beginning of time.

The benefits of blockchain extend well beyond the financial domain. Blockchains solve the problem of getting people who don't know each other and don't trust each other to still be able to unite, cooperate and organize together.

What is a Blockchain

The data on a blockchain is made up of a series of blocks that contain information. The data can be read by anyone and is distributed on computers all over the world. Once a block of information has been added to the blockchain, it becomes increasingly difficult to change it.

Each block contains three things: some data, a hash that acts as a unique fingerprint for the data, and the hash of the previous block.

Hashes are very useful for preventing and detecting tampering with the data. A hash is unique to whatever data it was derived from. If you change the data you change the hash and it is no longer the same block.

Each block contains the hash of the previous block. This effectively creates a chain of blocks and it is this structure that makes blockchains so secure.

In the example above block 3 points to block 2 and block 2 points to block 1. However, block 1 is special. As the originating block, it does not point to any previous block. The first block in a blockchain is called the genesis block.

We mentioned above that the hash acts as a unique identifier to the data contained on a block. So if someone were to change the data on block 2, it's hash would change and it would no longer match up with block 3, breaking the chain.

A hacker would have to change block 3's pointer hash to point to block 2's new hash which would cause block 3's hash to change. Then they would have to change block 4, and so on all the way up to the most recent block in the chain.

Computers are really fast and it's not hard to recalculate millions of new block's hash. The problem hackers run into is that the network will not accept their altered blockchain.

Mining

In order to create a new block on a blockchain, computers must engage in a process called mining. For our purposes, we'll be talking about Proof-of-Work which is what Bitcoin uses although there are other blockchains that are using other methods such as Proof-of-Stake.

Miners secure the network by validating transactions on it. Let's say that Ashley wants to buy something from Mike using bitcoin.

Ashley uses her private key to prove she owns the 3 bitcoins in her wallet address and requests to send them to Mike's wallet address.

Ashley's requested transaction gets bundled into a block with other transactions. Her transaction is validated by miners, meaning they check to make sure she actually has the private key to authorize the requested transaction.

The new block can only be added after a miner comes up with a correct sequence of numbers called a hash. Each hash has to be calculated and there are only a few combinations of numbers that will be accepted by the network.

The odds of calculating a correct hash on your own are vanishingly small. The entire network of bitcoin miners competes for a single block every 10 minutes. Together, the miners on Bitcoin's network can calculate quintillions of hashes every second. That's a quintillion is a million, million, millions.

All the time and energy that it takes to mine a block helps to give Bitcoin its security against tampering.

Distributed Concensus

The other piece that gives blockchains robust security is the fact that every new block provided by the miners must be accepted by the network.

Bitcoin has better governance than almost any other system we've had. There are 3 parties that check and balance each other:

  • Nodes (users)
  • Miners (execute transactions and secure the network)
  • Developers

This is similar to the United States government that consists of:

  • Judicial system
  • Executive system
  • Legislative system

Miners have to have a high hash rate in order to have a chance of mining the next block and receiving the rewards. It is very expensive to achieve a high hash rate. You have to spend a lot in terms of hardware and energy.

If a miner were to win the hash lottery and provide a new block that has been tampered with, it would be rejected by the nodes on the network for not following the rules.

The only way to successfully get a tampered block onto the blockchain would be to control 51% of the hashrate on a Proof-of-Work blockchain.

The higher the hash-rate is for a blockchain, the more difficult it becomes to take over.

Blockchains like Bitcoin use the Proof of Work algorithm to reach consensus by competing to solve time and energy-intensive puzzles.

The only way to mine a new block is to

Blockchains that employ a method called Proof-of-Work make it costly in terms of time and energy to create new blocks.

New blocks require a substantial amount of energy to create which translates to real-world costs. On top of that, it takes time to create new blocks. For example, a new block on the Bitcoin blockchain can only be created every 10 minutes.

With proof-of-work blockchains like Bitcoin, the creation of each block also requires a large amount of computational work which takes about 10 minutes to complete that work.

The computational work required to create each block

------------------------------------------

The blockchain contains every record that has ever been recorded since the blockchain's inception and is permanent and examinable to the public.

A blockchain gets its unique properties due to its distributed nature.

Did you enjoy this?

If so you might want to check out my newsletter. Get my best, most actionable insights on growth, productivity, automation, psychology and life delivered to your inbox 1x every other week. Guaranteed to be totally gangster.

Join Newsletter
Top