Simply put, blockchain is a digital ledger. It can record anything, from financial data to commercial transactions to medical records to votes. It can be used by different companies, institutions, and organizations.
But since we are talking about cryptocurrency, let’s focus on blockchain’s functionality in cryptocurrency.
It is a special kind of database. It records every transaction using cryptocurrency.
It is visible to everyone who is in the blockchain.
There are many companies creating blockchains but the idea is for all of it to be connected and the information to be shared.
This visibility establishes trust, accountability, and transparency.
A transaction that happened 10 years ago that is recorded in the blockchain will be visible to everyone to be verified. Each transaction also affects succeeding transactions which makes tampering with a transaction virtually impossible.
For us to understand that better, let us look into the two important elements of a blockchain.
Block + Chain
Blockchain stores information in batches called blocks. These blocks are linked together in a sequential way to form a continuous line.
A chain of blocks. A blockchain.
Think of a block as a page of a ledger or a record book.
Each block has 3 main elements – Data, Hash, and Hash of a previous block.
- Data is of a cryptocurrency transaction will contain sender, receiver, number of coins, date, among others.
- Hash is something like a fingerprint or signature or unique identifier. It identifies a block and all its content.
- Hash of previous block: This piece is precisely what makes a blockchain secure. Each block carries the information of the previous block.
So what happens if someone tries to change something in one block?
Interfering with a block on the blockchain is almost impossible to do.
Tampering with a block within a blockchain causes the hash of the block to change.
Changing a single block makes all the following blocks invalid.
PoW and P2P
Changing all the blocks isn’t as easy as it looks.
A proof-of-work (PoW) is a mechanism that slows down the creation of the blocks.
In Bitcoin’s case, for example, it takes about ten minutes to calculate the required PoW and add a new block to the chain.
A blockchain like Bitcoin contains hundreds of thousands of blocks, so to implement the change all throughout the blockchain will take literally a decade.
Blockchains also use a peer-to-peer network or P2P. There is no central entity to manage the chain. Everyone is allowed to join.
When someone joins, they become a validator or a node. When someone joins the network, she gets the full copy of the blockchain. This way, the node can verify that everything is still in order.
Let’s say you join the network and you create a new block, here’s what happens when someone creates a new block in the network [graphical illustration will appear on screen]:
- The new block is sent to everyone in the network.
- Each node then verifies the block and makes sure it hasn’t been tampered with.
- If everything checks out, each node adds this new block to his or her own blockchain.
- All the nodes in this process create a consensus. They agree about which blocks are valid and which ones aren’t.
- The other nodes in the network reject blocks that are tampered with.
So to successfully mess with a block on a blockchain, you’d need to tamper with all the blocks on the chain, redo the proof-of-work for each block, and take control of the peer-to-peer network.
Now that we know how the very concept and workflow of blockchain make it almost unhackable, let’s understand why it is a revolutionary technology.