We might all be familiar with the term blockchain technology.
Especially if you are employed at a corporate firm, we have heard our leadership teams throwing around this word quite a lot.
I haven’t heard anyone around me explaining the foundation of this technology in a basic way. So here it is:
A blockchain is a decentralized ledger of all transactions across a peer-to-peer network. As the name indicates, it is literally a chain of blocks. Each block contains data. Based on the type of blockchain, the data can represent value or computer code.
In essence, a blockchain is simply a ledger that keeps track of all the transactions happening across people in a network.
Let’s move a little forward and see how it works. Each block contains 3 components – some data, a hash of the block, and the hash of the previous block. The most popular bitcoin blockchain consists of details of the sender, receiver, and amount.
We have another component on the block, hash. This is a unique key for the identification of the block. If any change is made on the block, the hash changes.
The third element we have is the hash of the previous block. This effectively makes a chain of the blocks and this technique makes the blockchain secure.
Let’s say we tamper with a block, this causes the hash of the block to change as well. In turn, the next block and all the following blocks become invalid as they no longer store the hash of the previous block. Thus, changing a block will causes all the following blocks invalid.
Using hashes is not enough to prevent tampering. We have a lot of computing power today and hence can calculate hundreds of thousands of hashes per second. As a result, you can tamper with a block, and recalculate all the hashes of the following blocks to make the blockchain valid again.
To mitigate this, blockchain have a mechanism called proof-of-work. In bitcoin’s case, it takes approximately 10 minutes to calculate the required proof-of-work and add a new block to the chain.
Also, as the computing power increases over time, the cryptographic puzzle, the miners’ need to solve and validate the block, gets tougher. This makes sure that the proof-of-work takes almost the same time.
There are several reasons behind having a proof-of-work mechanism. The primary one is to prevent double-spending. In simple terms, it prevents anyone from using the coins/value to use for multiple transactions, before the transaction is confirmed by the network.
The other major reason having the proof-of-work mechanism is to prevent 51% attack. We’ll see this in detail in a later post.
This makes it very hard to tamper with a block, because if you tamper with one block, then you will have to recalculate the proof-of-work of all the following blocks in the chain.
So the security of a blockchain comes from the creative use of hashing and proof-of-work mechanism.
We might be familiar with the next way blockchain keeps itself secure, that is by being distributed. Instead of using a central entity to manage the chain, blockchains use a peer-to-peer network.
Anyone is allowed to join the chain. When someone joins this network, he gets a full copy of the blockchain. The node can use this verify that everything is still in order.
Now, let’s see what happens when a new block is created. The new block is then send to everyone on the network. Each node then verifies the block to make sure that it hasn’t been tampered with.
If everything checks out, each node add this block to their own blockchain.
All the blocks in the network create consensus. They agree on what blocks are valid and which aren’t. Blocks that are tampered with will be rejected by other nodes in the network.
So to successfully tamper with a blockchain, you’ll need to tamper with all the blocks on the chain, redo the proof-of-work for each block and take control of more than 50% of the peer-to-peer network. Only then, your tampered block becomes accepted by everyone else. This is almost impossible to do.
Blockchain technology in its essence removes the middleman in transactions. The transactions happen peer-to-peer, and the validity and trust of the transactions are kept by the consensus of the network, not by any specific entity.
Now, you might be wondering how this technology is shaping the industries like healthcare and the supply chain. It is because of its secure property. It is almost impossible to tamper with data that is using blockchain technology. Also, it is clearly traceable where the goods got a problem in the entire supply chain.
One major development in this space is the creation of smart contracts. Smart contracts are simply programs stored on a blockchain that run when predetermined conditions are met.
We see the popularity of NFTs around us, and they are all using blockchain technology. The NFTs we see today use ERC-721, a standard, and are built on ethereum blockchain. We will discuss more on that later in detail.
Blockchain technology has applications in a wide variety of industries that need to be highly secure like storing medical records, creating a digital notary, or even collecting taxes.
I believe in blockchain technology and its potential. And I would be sharing my thoughts on its evolution here.
I would love to know your thoughts on this technology and its future.
originally published at sajithmathew.com