What Are Consensus Mechanisms?

What are consensus mechanisms?

Unlike a centralised database system, where the central authority is responsible for maintaining genuine records, public blockchains that operate as decentralised, self-regulating systems work on a global scale without any single authority. They involve contributions from hundreds of thousands of participants who work on verification and authentication of transactions occurring on the blockchain as well as block mining activities.

These publicly shared ledgers (blockchain) require an effective, fair, real-time, functional, reliable, and secure mechanism to ensure that all transactions taking place on the network are genuine and that all participants agree on a consensus on the ledger's dynamically changing status. This critical task is made possibly by the consensus mechanism, which is a set of rules that determines the validity of contributions made by the various participants (i.e., nodes or transactors) of the blockchain.

In broad term, a consensus mechanism is a fault-tolerant mechanism that is used in computer and blockchain systems to achieve the necessary agreement on a single data value or a single state of the network among distributed processes or multi-agent systems, such as with cryptocurrencies. It is useful in record-keeping, among other things. There are various types of consensus mechanisms that exist currently and many more are being innovated today.

Proof of Work

On the Bitcoin blockchain, for instance, the consensus mechanism is known as Proof of Work (PoW), which requires the exertion of computational power in order to solve a difficult but arbitrary puzzle in order to keep all nodes in the network honest. The puzzle requires users to hash transactions and other information included in the block. But for the hash to be considered valid, it must fall below a certain number. Since there’s no way of predicting what a given output will be, miners have to keep hashing slightly modified data until they find a valid solution. This act of solving the puzzle is also known as ‘mining’.

Evidently, repeatedly hashing data is computationally expensive. In Proof of Work blockchains, the “stake” that users put forward is the money invested in mining computers and the electricity used to power them. They do this in hopes of getting a block reward. When the first successful miner sends a new block to the rest of the network, all the other nodes use it as the input in a hash function. They simply need to run it once to verify that the block is valid under the rules of the blockchain. If it isn’t, the miner doesn’t receive the reward, and they’ll have wasted electricity for nothing. Since its creation, many other blockchains have adopted the PoW mechanism.

Proof of Stake

In Proof of Stake (PoS), instead of using computational power to validate transactions, validators are chosen randomly to validate transactions based on the amount of stake they hold in the network. This makes PoS a more energy-efficient alternative to PoW.  Here are some of the commonly used types of PoS:

  • Delegated Proof of Stake (DPoS): In DPoS, the network participants elect a set of delegates who validate transactions and add them to the blockchain. The delegates are incentivised to act in the best interest of the network as their reputation is at stake.
  • Bonded Proof of Stake (BPoS): In BPoS, validators are required to lock up a certain amount of cryptocurrency as collateral, which is at risk of being confiscated if they validate transactions maliciously.
  • Slashing Proof of Stake (SPoS): In SPoS, validators can be penalised for acting maliciously by having a portion of their stake slashed. This acts as a deterrent for malicious behavior and helps maintain the security of the network.
  • Leased Proof of Stake (LPoS): In LPoS, validators can lease their stake to other users in the network, who can then use it to validate transactions and earn rewards.

The main difference between these types of PoS is the mechanism used to incentivise validators to act honestly and maintain the security of the network. In DPoS, validators are incentivized through their reputation, while in BPoS, validators are incentivized through the risk of losing their collateral. In SPoS, validators are incentivized through the threat of having their stake slashed, and in LPoS, validators are incentivized through the ability to lease their stake and earn rewards.

Proof of History

Because nodes in a distributed network cannot trust the timestamp on messages received from other nodes, the biggest problem in distributed networks is agreeing on the time and order in which events happen. To overcome this problem Solana’s Proof of Stake (PoS) based consensus method, termed Tower BFT, uses the network’s Proof of History (PoH) approach as a reminder before consensus by establishing a cryptographically safe source of time throughout the network.

Proof of History is a high-frequency Verifiable Delay Function (VDF) that takes a certain number of steps to evaluate but provides a unique result that can be publicly confirmed. Because they can trust the date and sequencing of the messages they’ve received, nodes may generate the next block without having to align itself with the entire network beforehand. As a result, the consensus overhead is reduced and is one of the factors why Solana can accommodate up to 65,000 TPS.

Other Well-Known Mechanisms

Apart from the above mentioned consensus mechanisms, there are hundreds of other variations and mechanisms today. The more well known ones are:

  • Practical Byzantine Fault Tolerance (PBFT) —  allows nodes to agree on the state of a network even when some nodes are faulty.
  • Proof of Elapsed Time (PoET) — uses randomly generated waiting times to determine the next node to validate transactions in a blockchain.
  • Proof of Authority (PoA) — uses a set of pre-approved authoritative nodes to validate transactions in a blockchain.
  • Proof of Burn (PoB) — nodes can prove their commitment to a network by burning (permanently destroying) some value, usually a cryptocurrency.

Conclusion

In a nutshell, different consensus mechanisms have different trade-offs in terms of security, efficiency, and decentralisation, and are therefore more suitable for certain use cases depending on its specific requirements. For example, Proof of Work is more secure but resource-intensive, while Proof of Stake is more energy-efficient but less secure. Proof of Authority and Proof of Burn can be useful for private or consortium blockchain where decentralization is not a key requirement. If you would like to learn more about the different consensus mechanisms, sign up for our blockchain course today where we dive deep into each mechanisms!

Latest Post

Editor's Picks