Open In App

Cryptographic Consensus Mechanisms in Blockchain

Last Updated : 08 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

A consensus mechanism is an algorithm that is used to achieve agreement, trust, and security across a decentralized computer network. These protocols help to make sure that all the nodes are synchronized with each other and agree on transactions, which are legitimate and are added to the blockchain.

What is Consensus? 

Blockchain is a distributed ledger. Suppose there are 5 mining nodes and all these nodes will be having a copy of a blockchain all the copies will be of the same state, which means they are exact copies. If there is a new block and this block is supposed to be added to a blockchain, then which mining node will do it? How you will make sure that all the nodes come to a consensus and they will have the same copy of it that’s where we have to follow some consensus algorithm.

In a blockchain world, there are so many consensus algorithms, using which one can agree on one particular state of a blockchain. So, if a new block is added to a blockchain, who will add it that can be defined using consensus?

What is a Consensus Mechanism?

The consensus mechanism word is made up of two words: The consensus part means to have a bunch of people agree and the mechanism means the routine procedure to get there. So, consensus mechanism means a procedure that will be used to make sure everyone agrees on something. 

  • A consensus mechanism is a system that is used to verify transactions and maintain the security of a blockchain network on decentralized networks. 
  • It provides a way to come to an agreement on a single state of the network or single data value. In the case of cryptocurrencies, technically they are agreeing on the blockchain. More specifically the state of the blockchain includes individual transactions and even more advanced parts like data and small contracts. 

There are several types of consensus mechanisms, and each works in a different way to ensure that all participants in the network agree on the validity of transactions and blocks that are added to the blockchain.

History of Consensus Mechanism

The history of consensus mechanisms is a long and complex one that spans several decades. In the 1970s, researchers began exploring the problem of reaching consensus in distributed systems, which are composed of multiple nodes that communicate and coordinate with each other to achieve a common goal.

  • One of the earliest proposed consensus mechanisms was the Paxos algorithm, which was introduced in 1989 by Leslie Lamport. Paxos is a family of protocols that can be used to solve the problem of distributed consensus in a fault-tolerant way. The algorithm ensures that all nodes in a network agree on a single value, even if some of the nodes fail or are malicious.
  • Another influential consensus mechanism is the Byzantine Fault Tolerance (BFT) algorithm, which was introduced in 1982 by Leslie Lamport, Robert Shostak, and Marshall Pease. BFT is designed to solve the Byzantine Generals’ Problem, which is a fundamental problem in distributed computing that deals with the challenge of reaching consensus in the presence of faulty or malicious nodes. In a BFT system, nodes are classified as either honest or Byzantine. Honest nodes follow the protocol and behave correctly, while Byzantine nodes may behave arbitrarily and try to disrupt the system. BFT algorithms ensure that the nodes can reach consensus even if up to one-third of the nodes are Byzantine.
  • Fast-forward to the early days of blockchain, the first consensus mechanism used in the Bitcoin blockchain was Proof of Work (PoW), which was proposed by Satoshi Nakamoto in the Bitcoin whitepaper in 2008. PoW is a consensus mechanism that relies on a computational puzzle to secure the network. Miners compete to solve the puzzle and validate new transactions, and the first miner to solve the puzzle is rewarded with newly minted bitcoins.
  • In 2012, the Proof of Stake (PoS) consensus mechanism was proposed as an alternative to PoW. PoS is designed to be more energy-efficient than PoW and relies on a node’s stake in the network as a measure of its authority. In a PoS system, validators are selected to validate transactions based on the amount of cryptocurrency they hold and are willing to lock up as a stake. Validators are incentivized to behave honestly because they risk losing their stake if they validate fraudulent transactions.
  • Since the introduction of PoS, several other consensus mechanisms have been proposed, including Delegated Proof of Stake (DPoS) and Practical Byzantine Fault Tolerance (PBFT). DPoS is a more efficient variant of PoS that allows token holders to vote for a limited number of validators who are responsible for validating transactions. PBFT is a consensus mechanism that is used to achieve consensus in permissioned blockchain networks.

Today, there are several consensus mechanisms in use, each with its own strengths and weaknesses, and it’s likely that new consensus mechanisms will continue to be developed as blockchain technology evolves.

Types of Consensus Mechanisms

Below are the different types of consensus mechanisms:

1.  Proof Of Work

Proof Of Work is used by the world’s most popular cryptocurrency bitcoin.

  • It requires network participants to spend time-solving an unpredictable mathematical puzzle in order to prevent the system from being hacked.
  • In cryptocurrency mining proof of work is commonly employed to validate transactions and mine new tokens. 

Challenges in PoW:

  • The mathematical problems are so complex that they require special high-powered computers in order to solve them and those computers require a lot of energy to operate. 
  • Some have raised issues with the amount of energy needed claiming that such energy consumption is bad for the environment. 
  • Another problem although unlikely is known as a 51% attack. 
  • If a single mining entity obtains 51% of the bitcoins hash rate or the measure of computational power used to verify transactions it can temporarily break the rules by double spending money in blocking transactions.

2.  Proof Of Stake

Proof Of Stake seeks to reduce the amount of computational power needed in order to verify transactions. 

  • With Proof Of stake Coin owners offer their coins as collateral for a chance to verify transactions and validate blocks. 
  • These coin stakes are known as validators. 
  • The block is then mined or validated by validators who are chosen at random rather than employing a competition-based process like proof of work. 
  • A coin owner must take a certain amount of coins to become a validator. 
  • Before a user can become a validator on Ethereum, blocks are validated by multiple validators and they are finalized and closed when a specific number of validators confirm that the block is correct. 
  • Proof of stake is a protocol that aims to address the environmental and scalability difficulties that plague the proof of work protocol. 
  • A competitive approach to transaction verification is applied when it comes to proof of work. 
  • As a result, people are naturally motivated to find ways to gain an advantage usually in the form of more computers which leads to more energy consumption and negative environmental impact.
  • The proof of stake systems attempts to address these issues by effectively swapping staking for computational processing power.

3. Delegated Proof of Stake

Delegated proof of stake (DPOS) is a consensus mechanism that allows for the validation of blocks on a blockchain by using a more democratic process. Instead of a single node validating every block, DPOS uses a much more decentralized approach.

  • In a DPOS system, there are many nodes on the network that can validate transactions and create new blocks. This means that there is no need for miners like in bitcoin or Ethereum where only one miner can create blocks at any given time. With DPOS, anyone can create new blocks so long as they have enough votes from other users in the network.
  • DPOS is becoming increasingly popular because it makes it easier to scale up networks while also increasing the security and decentralization of those networks by making them harder to attack or compromise than other types of consensus mechanisms like POW (Proof-of-Work) or POS (Proof-of-Stake). For example, because there are so many possible validators in DPOS systems, it makes it much more.

4. Proof of Capacity

Proof-of-capacity (POC) concept, is also known as proof of space.

  • Proof of Capacity(POC) is a consensus mechanism algorithm used in blockchains that allows the mining devices in the network to use their available hard drive space to decide the mining rights.
  • Instead of using the mining devices’ computing power or the miners’ stake in the crypto coins.
  • Proof of Capacity emerged as one of the many alternative solutions to the problem of high energy consumption in proof of work, the problem that inherently promotes crypto coin hoarding instead of spending in proof of stake.

5. Proof of Elapsed Time 

  • Proof of Elapsed Time is used by a private or permissioned Blockchain network.
  • Each node is assigned a waiting period by the network in order to mine- The one with the shortest waiting period wins first.
  • Proof of Elapsed Time comes from intel, and it relies on a special CPU instruction set called intel software guard extensions.

6. Proof of Authority

To help validate transactions and generate new blocks proof of authority employs a reputation-based architecture. 
Validators in proof of authority consensus blockchain are typically users who have been chosen and approved by other network participants to act as system moderators. As a result, validators are usually institutional investors or other significant partners in the blockchain ecosystem that have a stake in the network’s long-term success and are prepared to reveal their names for the purpose of transparency and accountability.

  • Proof of Authority blockchains requires validators to put their social capital on the line whereas proof of stake blockchains demand validators to put their financial capital on the line to ensure acceptable acts.
  • However, in addition to staking their reputation with several proofs of authority, blockchains demand prospective network validators invest considerably in the network financially. 
  • This allows the network to weed out would-be validators with ambiguous or shady motivations while monetarily rewarding honest nodes that are prepared to commit for the long haul.

7. Proof of Activity

Proof of Activity is a protocol that combines proof of stake.

  • In most proofs of activity arrangements miners compete to mine new blocks in exchange for tokens incentives. 
  • The blocks on the other hand do not contain transactions instead they are empty templates with the transaction title and block reward address contained in them. 
  • Only token holders are qualified to act as validators and the information in the transaction title is used to select a validator node at random to sign the block and confirm it to the blockchain ledger.

In conclusion, consensus mechanisms are critical to the functioning of blockchain networks. They enable decentralized networks to agree on the validity of transactions without relying on a central authority. While different consensus mechanisms have their strengths and weaknesses, they all play an essential role in enabling the decentralized, trustless nature of blockchain technology.

Pros of Consensus Mechanism                                                                                                                           

  • Decentralization: PoW allows anyone with the necessary hardware and electricity to participating in the validation process, making the network more decentralized. It can reduce the centralization of validation power that can occur with PoW and PoS.
  • Security: PoW is considered one of the most secure consensus mechanisms due to the computational power required to participate in the validation process. PBFT is considered highly secure because of the pre-selected validators who must agree on the validity of transactions.
  • Energy-efficient: PoS is known for its energy efficiency, which can reduce the environmental and economic impact of validation.
  • Fast transaction processing: DPoS can enable faster transaction processing times compared to other consensus mechanisms. PBFT can enable faster transaction processing times compared to other consensus mechanisms.      

Cons of Consensus Mechanism

  • High energy consumption: PoW is known for its high energy consumption, which can have environmental and economic impacts.
  • Centralization of mining: In some cases, mining can become centralized among a few large mining pools, which can reduce the decentralization of the network.
  • Possible centralization of validators: In some cases, PoS can lead to the centralization of validation power among a few large validators, which can reduce the decentralization of the network.
  • Potential for stake-grinding attacks: There is a risk of a stake-grinding attack, where a malicious validator can manipulate the validation process by repeatedly selecting different chains.
  • Possible centralization of validation power: In some cases, DPoS can lead to the centralization of validation power among a few large validators, which can reduce the decentralization of the network.
  • Vulnerability to attacks: DPoS can be vulnerable to a 51% attack, where a single entity controls the majority of the validation power. PBFT can be vulnerable to a 33% attack, where a single entity controls one-third of the validation power.
  • Centralization: PBFT is a permissioned consensus mechanism, which means that only pre-selected validators can participate in the validation process, which can reduce the decentralization of the network.

In summary, choosing the appropriate consensus mechanism is crucial when designing a blockchain network. While each consensus mechanism has its strengths and weaknesses, the decision should be made based on the specific requirements of the network.             



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads