In traditional finance, there is always a central authority that oversees transactions. For instance, if you write a cheque to a friend, your bank will look into your account, verify that you have the required funds and then confirm the transaction. It will then add a record of this transaction to a ledger.
However, in the case of a blockchain, there is no central authority. Instead, all the verification is done by the nodes of the blockchain. A node is a device that acts as a remote server, helping the blockchain process transactions. Anyone can become a node by running the blockchain software on their computer, laptop or phone.
Then, every time a transaction comes through, nodes mutually agree on the authenticity of the transaction before it is confirmed and added to the blockchain. Now, different blockchains have different rules and methods for users to arrive at this mutual agreement. These rules and procedures are called consensus protocols and are at the core of every blockchain’s functionality.
How does a consensus mechanism work?
As mentioned earlier, there are various kinds of consensus protocols. For instance, the Bitcoin blockchain uses the ‘Proof-of-Work’ consensus mechanism, whereas the Ethereum network is currently upgrading to the ‘Proof-of-Stake’ consensus mechanism.
While each of the protocols works differently, they all serve one purpose: to provide a method of review and confirmation for transaction data. By following this method, nodes can reach a ‘consensus’ regarding the validity of a transaction.
Also Read: Funding the future: A round-up of the top VC firms shaping the crypto landscape
Once transactions are validated, they can be bundled into blocks and added to the blockchains. Once this is done, the consensus mechanism is also responsible for distributing the information in the new blocks to the other nodes.
Why are consensus protocols needed?
Ensures decentralisation: Decentralisation is the central premise of blockchain technology. This is because a system where nodes verify the authenticity of a transaction alleviates the need of a central authority. Moreover, as the popularity of the blockchain grows, the number of nodes also increases. This adds to the decentralisation of the blockchain.
Builds a trustless system: With a consensus mechanism, users do not need to place their trust in a central authority to carry out transactions. This is what makes blockchains ‘trust-less’.
The consensus mechanism is responsible for distributing updated transaction information to all the nodes on the network. It is then stored on these devices in the form of blocks chained together in chronological order. Every time a new block is added, it is broadcasted to the network, creating a single source of truth. This replaces human authorities present in traditional finance who facilitate trust with computer science and mathematical proof that something occurred.
Maintains blockchain security: Without a consensus mechanism, there’s no stopping rogue nodes from incorrectly approving/rejecting transactions. Any node would pick up a random transaction and pass it off as legitimate without any other set of eyes scrutinising it. However, when thousands of eyes vet it and agree on the validity, all nodes are compelled to work honestly.
An example of such a security threat is a ‘double spending’ attack. Without a consensus mechanism, one rogue node can easily spend some amount of cryptocurrency and then alter the transaction so it doesn’t show the spend. By doing this, they could then use the same coins again and again. However, with a consensus mechanism, such inconsistencies would be easily rejected by the other nodes.
Also Read: Explained: Ethereum Name Service and the reason behind the 216% spike in ENS domain registrations