The Role of Consensus Mechanisms in Blockchain

Adeosun Elijah Oluwaseun
EthereumNigeria
Published in
8 min readJan 11, 2024

Introduction:

In the dynamic world of web 3, understanding the roles and importance of consensus mechanism is crucial. Consensus mechanism plays a key role among crypto coin traders worldwide because it helps in building trust and transparency in order to minimize fraud among them. In short, consensus mechanism simply means that majority of a group has agreed in favor of a decision to validate a transaction and mark it as authentic. In this post, we will delve into 3 consensus algorithms and their significances in maintaining blockchain security.

What Is Consensus Algorithm?

This is a set of instruction that is written in lines of codes that lists all valid transactions of a coin in a blockchain to build a trust in the coin among traders.

It works on the agreement of most users on a network and maintains the security of the blockchain by keeping every record of transactions carried out on the network. Also, it ensures that transactions are reflected in the blockchain as soon as it is validated. So, we can describe consensus mechanism as a program used in the blockchain systems to achieve distributed agreement about the condition of a ledger. A lot of blockchain users prefer consensus mechanism because it is faster than human verification and auditing method.

There are various consensus methodologies on the blockchain network but in this post, we will consider just three of them. Approximately 64% of the total market capitalization of the universe of cryptocurrencies use proof of work for validation. Some of the most popular cryptocurrencies include:

 Bitcoin, Dogecoin, Bitcoin Cash, Litecoin and Monero.

Types Of Consensus Mechanisms

1. Proof of Work (POW): Proof of Work is a consensus mechanism that is used by

Bitcoin network. Just as the word goes “proof”, it simply refers to the evidence that solution to a highly complex mathematical problem has been solved to prevent anybody from gaming the system and this requires computational power to solve because it has a feature of an encrypted puzzle which is called hash. After the hash is solved by one miner or a group of miners, then every nodes on the network verifies that the data has been changed by checking:

 The block header hash

 The Block timestamp

 The data structure

 The block size and

 The first transaction.

Since there is no centralized gatekeeper to verify the accuracy of new transactions and data that are added to the blockchain, the blockchain network decided to rely on a distributed network of participants to validate every incoming transaction and add them as new blocks on the chain. This activity is carried out by miners. They use POW as a consensus mechanism to handle the lucrative task to verify new data in order to avoid cheating the system.

So, you may ask, why is proof of work so important? Since, cryptocurrency is just data, there is need to develop a mechanism that will prevent users from performing multiple transaction by spending the same units in different places before the system can record the transactions. So, how does it work? This is how it works:

Step 1

Transaction Gathering: This is the stage where the transactions (Users that buy or sell cryptocurrency) are gathered or pooled together into a block.

Step 2

Miners Competition: This is the second phase; miners compete to process the new block and solve the math problem. They would have to show a proof that they have undertaken the computational work (called hash).

Step 3

Choosing Miner: Using a degree of randomness to decide which miner wins the right to process the block. Thereafter, the winner is awarded new cryptocurrency coins and adds a new block to the blockchain.

2. Proof of Stake (POS): This is used on the Ethereum network.

Although, proof of work and proof of stake are both consensus mechanisms, yet, proof of stake is quite a different consensus mechanism from proof of work. With proof of stake, network participants are referred to as “validators” instead of being called miners. Rather than solving math problems, validators lock up a personal set amount of cryptocurrency in a smart contract on the blockchain. The amount they set up is the stake or collateral which they have on the network. In exchange for their stake, they get a chance to validate new transactions and earn a reward and if they improperly validate a bad or fraudulent data, they may lose some or all of their stake. Proof of stake makes it easier for people to participate in the blockchain network as validators as there is no need to buy and expensive computing system that consume high amount of electricity to stake crypto.

Many validators verify blocks, and when a certain number of these validators confirm that the block is correct, it is considered completed and locked.

How POS works in practice and what the process involves.

First of all, the coin holder would have to stake his coin and establish his own validator node. Staking crypto is just a way of pledging your coins to be used for transaction verification even though the staked assets that is locked up can still be redeemed any time you want. Once a block of transaction is ready for processing, the cryptocurrency’s proof of stake mechanism selects a validator node to review it. The review is just for the validator to verify that the activities inside the chain are legitimate. After it has been confirmed to be legitimate, then, they add the block to the blockchain and collect cryptocurrency incentives for their efforts. Conversely, if it is confirmed that the validated data is fraudulent, then the validator would be penalized by losing some or all his staked assets.

Advantages of proof of stake

a. It consumes low amount of energy

b. Validators does not need to purchase specialized equipment to solve

complex equations.

c. It has greater scalability and throughput because transactions and blocks can be approved quicker without the need to solve extremely complex equations.

d. The power to validate transactions is transferred to those with the most holdings of the network’s native currency. Those players with a significant stake in the system are less likely to manipulate it. If they do it, they could have their stake destroyed.

e. Adaptability: This is another advantage that POS has. Users’ needs and

blockchains are changing, and so is POS. The mechanism is very versatile,

and it can easily fit more blockchain use cases.

Examples: Ethereum, Cardano, Tezos, Algorand

Delegated Proof of stake (DPoS):

Delegated Proof of stake (DPoS): This is a variation of Proof of Stake. It can be described as where a limited number of trusted nodes are chosen by the community to create and validate blocks. The elected nodes are known as delegates or witnesses, and they produce blocks one after another. In DPoS, token holders in a blockchain network have the ability to vote for delegates who will be responsible for validating transactions and maintaining the blockchain. These delegates are responsible for maintaining the blockchain and ensuring its security. This is a breakdown of how DPoS works:

1. Token holders in the network have voting power and can use this power to elect delegates they trust to validate transactions.

2. The number of delegates to be elected can vary depending on the blockchain network, but typically, a small number of delegates are chosen.

3. Once the delegates are elected, they will take turns validating transactions and adding them to the blockchain.

Features of DPoS:

1. Voters: One special feature of DPoS is the voting method and this is

done by every user who owns coins on the DPoS blockchain. In order

words, the users on the network have the ability to delegate their

voting power to another person and the nodes for which users vote in

a delegated proof of stake are known as witnesses.

2. Delegates: Delegates do not play a part in transaction control because

they have another crucial task which they carry out within the DPoS

protocols; propose changing the block size, or amount of witness that

should be paid for validating a block. These changes are subject to a

vote by the users.

3. Witnesses: The witnesses are in charge or protecting and legitimizing the blockchain and the number of witnesses on a server can vary between 21 and 101. It is not necessary for a user to have cryptocurrency to become a witness. Yet they must have sufficient votes to be elected due to its competitive nature. Any transaction that is successfully completed by a witness is recorded officially on the ledger and then the witness received incentive for the job done.

4. Block Validators: These ones are in charge of validating the blocks created by the witnesses. Block validators ensures that the block rules comply with specific consensus rules. To become a block validator, you must run a full node but do not expect monetary rewards for this position because block validators are not incentivized.

photo credit: gate.io

Advantages of DPoS

Affordability and sustainability: Delegated Proof of Stake omits the reliance on expensive and powerful equipment required in other mechanisms, like PoW, for network operation.

Therefore, the expenses of maintaining the network are reduced. In addition, DPoS does not require large amounts of power, making DPoS networks sustainable.

Reward distribution: As mentioned above, users who elect delegates for block creation and transaction verification also receive part of the rewards earned for successful validations. This motivates users to only elect delegates who are likely to perform well in order to receive higher rewards. This not only means that all parties are financially rewarded, but that the safety of the system is the main objective of all sides.

LIMITATIONS OF DPoS

Requires honesty and genuineness: In order to achieve successful decision-making and block validation, users must be truly interested in the rightful governance of the network and must vote for delegates that they believe will be able to make a contribution.

Possibility for centralization: As noted above, there is a limited number of delegates chosen for every new block. This creates concerns about whether the consensus protocol can truly maintain the decentralized nature of blockchain. When a limited number of witnesses take part in block validation, the process can quickly turn around to resemble centralized decision-making.

Faster transaction speeds: By limiting the number of validating nodes, DPOS achieves consensus much faster. DPOS blockchains can process over 1000 transactions per second, compared to 3–7 TPS for Bitcoin. This makes DPOS suitable for decentralized apps and enterprise use.

Energy efficiency: DPOS eliminates the massive computing power needed for POW mining, drastically reducing electricity consumption by over 99% by some estimates. This supports sustainability.

Quick finality: Transactions are confirmed irreversibly faster with DPOS than POW where several block confirmations are generally recommended for finality.

Examples: EOS, Lisk, Ark, Tron, BitShares, Steem

CONCLUSION

As mentioned above, the success of Web 3 largely depends on the efficiency of Consensus mechanism that’s runs it and as discussed, consensus mechanisms are the backbone of decentralized systems because they provide a way for participants to agree on the state of a decentralized network. Newer alternatives like Delegated Proof of Stake (DPoS) aim to strike a better balance by prioritizing speed and scalability. The choice of a consensus mechanism ultimately depends on the specific types of projects, but it would be great to consider factors like security, decentralization, and environmental impact.

Coauthors:

Anderson Osayerie

Chibundo Idike

Chukwuka Chibueze

Alikwe Caleb

--

--