Consensus Mechanisms Use in Blockchain

Gavindualwis
5 min readJul 21, 2023

--

Consensus mechanism is a fundamental concept in distributed systems like blockchain technology. The consensus mechanism decides which group of nodes or participants reach an agreement on the validity and order of transactions or data that collectively maintain in the network. The consensus mechanisms aim to ensure the network’s consistency, security, and trustworthiness.

In traditional centralized systems, a single authority (central server) is responsible for validating and approving transactions. As a blockchain network is a decentralized and distributed network it can’t operate like a centralized network. So, consensus mechanisms enable decentralized networks to function smoothly by allowing participants to agree on a single version of the truth without the need for a central intermediary.

There are various consensus mechanisms used in blockchain networks. Here described some of such consensus mechanisms.

Proof of Work (PoW)

Proof of Work (PoW) is a consensus algorithm used in blockchain networks to validate transactions and create new blocks. Here the participants of the network (miners) perform a computationally intensive task (computationally challenging puzzle) to find a solution. The first miner to find the correct solution gets the chance to add the next block to the blockchain network. Apart from that, that miner is rewarded with newly minted cryptocurrency. When a miner successfully solves the Proof of Work puzzle by finding the right solution, they immediately broadcast this solution to all the other nodes in the network. This broadcasting ensures that everyone else can quickly verify the validity of the solution.

When a new block is wanted to add to the blockchain, the miners need to find a nonce(a random number). The nonce combined with the block’s data( transaction data, a timestamp, and a reference to the previous block), results in a hash that meets specific difficulty criteria. Miners start by selecting a random nonce and calculating the hash of the entire block (data + nonce). If the resulting hash doesn’t meet the required difficulty criteria, they try again with a different nonce. The miners keep trying different nonces until they find the valid hash. The first miner who successfully finds a valid hash (meeting the required difficulty criteria) announces it to the network as proof of work.

Proof of Work (PoW)

The proof of Work mechanism is resource-intensive and requires significant computational power, leading to high energy consumption.

Proof of Stake (PoS)

Proof of Stake (PoS) is a way for blockchain networks to agree on transactions and ensure security without the need for energy-intensive mining like in Proof of Work (PoW). Instead of miners solving puzzles, validators are selected based on the number of coins they hold. The participants in the network who want to become validators need to own a certain amount of coins. This amount of coins they own is known as the stake. The PoS algorithm selects validators to create new blocks and validate transactions based on the stake. Validators who successfully create and validate blocks are rewarded with transaction fees and newly minted coins. Those rewards encourage validators to act honestly and securely in the network. If a validator behaves dishonestly or maliciously, they may lose their staked coins as a penalty, which is known as “slashing.”

In Proof of Stake (PoS) blockchain networks, there is often a minimum limit or requirement for the number of coins that validators must stake to participate in block validation. The reason why staking more coins increases the likelihood of being chosen as a validator is because the selection process in most PoS algorithms is designed to be “weight-based.” In real-world Proof of Stake (PoS) blockchain networks, staking pools are commonly used to pool together the staked coins of multiple individual participants. These staking pools increase the collective stake, giving the pool a higher chance of being selected to validate blocks or perform tasks compared to individual validators with smaller stakes. When a staking pool successfully completes a task or validates a block, the rewards earned are divided among the members of the pool. Each member receives a portion of the reward based on their individual contribution to the total staked coins in the pool.

Delegated Proof of Stake (DPoS)

Delegated Proof of Stake (DPoS) is a consensus mechanism used in blockchain networks to achieve consensus and validate transactions. It is a variation of Proof of Stake (PoS). Here the stakeholders can participate as delegates to produce new blocks in the blockchain network. The selection of delegates is typically determined through a voting process. Stakeholders can cast votes for their preferred delegates, and the individuals or entities with the most votes become the active delegates responsible for block production.

The delegates produce new blocks according to a predefined schedule. Once a delegate produces a new block, they broadcast it to the entire network. All the other nodes in the network receive the proposed block almost simultaneously. In a Delegated Proof of Stake (DPoS) system, block verification is performed by all network nodes, not just the elected delegates responsible for block production. Each node independently verifies the validity of the proposed block and its included transactions. This verification process involves checking the digital signatures, ensuring that the transactions adhere to the consensus rules, and confirming that the sender has enough balance to perform the transactions. If the majority of nodes agree that the proposed block is valid, the block is added to the blockchain. If a delegate fails to validate the block properly, other nodes will reject the block, and it will not be added to the blockchain. The delegates who consistently fail to validate blocks correctly or engage in malicious behavior might face penalties. Penalties could include losing their delegate status and losing some or all of their staked coins.

Proof of Authority (PoA)

Proof of Authority (PoA) is a consensus mechanism used in some blockchain networks to validate transactions. PoA relies on a group of known and trusted validators who take turns adding blocks to the blockchain. Here there are predefined validators who are known as trusted entities. The validators are selected manually or through a predetermined governance mechanism. These validators could be individuals, organizations, or even specific nodes that have been approved to participate in the consensus process.

Validators in a PoA network take turns to create new blocks. The frequency of rotation and the process for selecting the next validator can vary depending on the specific PoA implementation. When a validator creates a new block, they sign it with their digital signature to indicate their approval of the block. his signature serves as proof that the block has been created and validated by a legitimate and authorized participant. Consensus is achieved when a majority of the authorized validators agree on the validity of a new block. Since all validators are known and trusted, it is assumed that they will act honestly and follow the network’s rules.

However, it’s essential to note that PoA does introduce centralization to some extent since the validation process relies on a limited number of trusted validators. As a result, it might not be suitable for public, fully decentralized blockchain networks that aim to be open to anyone as validators. Instead, PoA is commonly used in private or consortium blockchains.

--

--

Gavindualwis
Gavindualwis

Written by Gavindualwis

Undergraduate — University of Moratuwa

No responses yet