How Blockchains Work
The Inner Machinations of the Blockchain
Last updated
The Inner Machinations of the Blockchain
Last updated
Let’s break down how blockchain actually works. As with technical concepts, it’s best to explain by example: we’ll walk you through the process which happens when a transaction is submitted to the blockchain.
In the example, some technical jargon will be introduced, but worry not, they will be explained after.
Recall that blockchains ultimately are a tool for securely recording transactions. When transactions are submitted to the blockchain, the following processes occur:
A block is prepared, and ready to accept transactions for a specific time period.
During that time period, transactions are added to the block.
At the end of the time window, a hash is produced of all the transactions.
The block is digitally signed by the creator as a form of verification.
Consensus occurs, through which the validity and integrity of the block is verified across all blockchain network participants. If successful, the block is added to the blockchain, and the transactions are considered processed. The creator of the block is rewarded in the form of cryptocurrency for their service.
There were a few key terms introduced there. Let’s break them down:
A block is an object which contains a batch of transactions which have occurred during a specific window of time. Each block is identified by the following:
Body: contains the batch of transactions
Block Header: contains unique identifiers, such as the information of the block and the block before it, who produced it, and when they were made
A hash is a tamper-proof mechanism which maps an input value to a number of fixed-length. This serves as a unique identifier for a piece of content; changing the input changes the output. Here, it is used to produce a unique identifier of all the transactions in a block, and hence a unique identifier for the block itself.
In other words, it allows us to determine if a malicious actor tampers with the block’s transactions. Changing any transaction in a block will change the block body hash, thus changing the block’s header hash, the header hash of the next block, and so on, invalidating the entire chain that follows. This feature which prevents a blockchain to be tampered with is called immutability.
Consensus is the mechanism by which all network participants determine which transactions are valid, and the structure of the ledger. As a reward for expending computational resources to verify these transactions and producing blocks, the participants receive cryptocurrency. Depending on the specific blockchain this may be achieved through different mechanisms, but the two most popular ones are Proof-of-Work (PoW) and Proof-of-Stake (PoS).