A consensus mechanism is a fault-tolerant mechanism used in blockchain and computer 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.
In the ever-evolving cryptosphere, blockchain requires an efficient, fair, real-time, functional, reliable, and secure mechanism to ensure that all the transactions occurring on the network are genuine and all participants agree on a consensus on the status of the ledger.
The different kinds of consensus mechanism algorithms are as follows-
1.Proof-of-Work Consensus Protocol
The Proof of Work consensus protocol was the first to solve the Byzantine General’s Problem. In PoW, miners solve cryptographic puzzles for mining a block which is added to the blockchain. The process exhausts a large amount of computational power. The puzzles have been designed in such a manner that they progressively become difficult to solve.
However, Proof of Work has its own flaws. It is an extremely inefficient process due to the energy it consumes. Organizations can afford more powerful and faster ASICs which will facilitate faster mining.
2. Proof of Stake Consensus Protocol
In Proof of Stake consensus mechanism, the validators must lock up some of their coins at stake. After the validators have staked coins, they can start validating the blocks. The validators acquire a reward proportionate to their stakes if the block gets appended.
Proof of Stake will make the entire mining process virtual and replace miners with validators.
Barriers to adoption of Proof of Stake
Ethereum developers plan to eventually move on to Proof of Stake. However, a major flaw in the Proof of Stake needs to be addressed.
Consider that there is a blue chain and a red chain which branches from the main chain.
The plausible risk of a hard fork can be mitigated in a PoW consensus mechanism. A miner willing to mine on the red chain is left empty-handed as he cannot get any other miner to join on the red chain. Miners will continue to mine on the blue chain as it is the longer chain and is thus more profitable and risk-free.
It is futile to invest resources on a block which will invariably be rejected by the network. Hence, chain splits are generally avoided in a Proof of Work system as the attacker will need to spend an exorbitant amount.
However, it is a different case with PoS consensus mechanism. A validator can put money in both the chains, without any possible consequence. The validators has nothing to lose even if his actions are malicious. This is known as the “Nothing at Stake Problem”
In order to fully utilize the PoS system, cryptocurrencies need to address this issue. The issue can be solved by adapting the Casper Protocol.
Casper has implemented a process to punish the malicious stakers. Under Casper, if a validator acts in a malicious manner and tries to do a “Nothing at Stake”, his stake will be slashed. The implementation of Casper protocol with Proof of Stake will be critical when Ethereum plans to scale up.
3. Delegated Proof of Stake Consensus Protocol
Presently, DPoS consensus mechanism is being used by EOS to scale up millions of transactions per second. Anyone holding tokens on EOS platform can select the producers through a continuous approval voting system. Anyone taking part in the block producer election will be provided an opportunity to produce blocks in accordance with the votes they receive to all other producers.
Blocks are produced in rounds of 21. At the beginning of each round, 21 block producers are chosen. Then, the producers are shuffled using a random number derived from the block time. This is done to ensure balance connectivity to all producers. In order to sustain regular block production block time is kept to 3 seconds and producers are punished for not participating. If in case they do not participate, they are removed from consideration.
How to become a producer in DPoS Economy?
For a producer to continue to be in consideration, he needs to produce a minimum of one block every 24 hours. The DPoS consensus mechanism hasn’t experienced a fork and it can be attributed to the fact that instead of competing for blocks the producers need to cooperate. If a fork happens, the consensus will shift to the longest chain.
A DPoS usually has 100% block producer participation. The transactions are confirmed within 1.5 seconds from the time of broadcast (with 99.9% certainty). If a node needs to have complete certainty over a transaction a supermajority needs to be achieved.
If in case a fork takes place, each block must obtain a 2/3rd majority to considered a part of the chain. Due to the short block creation time, the nodes can be warned if they are in the major or minor chain within 9 seconds. If a node misses 2 consecutive blocks there is 95% chance that they in a minority fork. If a node misses 3 blocks, then there is a 99% chance of them being on a minority chain.
4.Delegated Byzantine Fault Tolerance (DBFT) Consensus Protocol
Presently, NEO uses DBFT as a consensus mechanism. Imagine there is a country and it has a lot of citizens. Each of these citizens would elect a Delegate to represent them and to make them happy. The job of these delegates is to pass laws that will make the citizens happy, if they are not good at their job then the citizens can simply vote for another delegate the next time.
First, one of the delegates is chosen as a speaker. The speakers consider the demands of the citizens and creates a law. Second, the happiness factor is calculated, to see if the number is enough to fulfill citizen’s need or not. Third, it is passed down to the delegates. Lastly, the delegates individually verify the speaker’s calculations. If the speaker’s number matches the Delegate’s then they give their approval; if not, then they give their disapproval. 66% of the delegates need to give their approval for the law to pass. If the majority is not sealed, then a new leader is chosen and the process starts again.
In a blockchain people who own tokens are ordinary nodes and Delegates are the bookkeeping nodes. In order to be a bookkeeping node, a Delegate needs to qualify on certain parameters like having special equipment, dedicated internet connections and a certain amount of GAS. The “demands of the citizens” are basically the various transactions made by the token holders. The “law” is the current block that is to be added to the blockchain. The “happiness factor” is the hash of the current block.
However, two situations are possible-
The Speaker is Malicious
If a speaker has sent a false message B to two delegates and an accurate message to one, this problem can be easily resolved with the majority rule. The two delegates will verify that their hash doesn’t match with that of the speaker. The proposal will be disapproved by 2 out of 3 and henceforth, the speaker will be removed.
The Delegate is Malicious
If in case the delegates decide to act falsely and declare that his hash doesn’t match up with the speaker, he will not have any benefits. As 2 out of the 3 delegates are non-malicious, they will approve the law which will then be passed since a 66% consensus has been reached.
5.Proof of Activity Consensus Protocol
Proof of Activity is a mixed approach that combines Proof of Work (PoW) consensus protocol and Proof of Stake (PoS). In PoA, the mining process initially starts as a standard PoW process with various miners trying to outpace each other with higher computing power to find a new block. When a new block is found (mined), the system switches to PoS, with the newly found block containing only a header and the miner’s reward address.
A random group of validators is selected to validate or sign the block. The validator with more coins has more chances to become a signer. Once the blocks have been signed, it gains the status of a complete block and gets added to the blockchain network. If some of the selected signers are unavailable to sign the block, the process moves to the next winning block with a new set of validators being chosen at random depending on their coin stake. The process continues till a block receives the required number of signers and becomes a complete block. The rewards are split among the miners and the validators who contributed to sign off on the block.
PoA still requires a lot of power to mine blocks during the PoW phase. Moreover, coin hoarders can still get on the signers list and accumulate more rewards. Decred uses the PoA consensus mechanism.
6.Proof of Burn Consensus Protocol
Proof of Burn consensus mechanism has been implemented to ensure that all participating nodes come to an agreement about the true and valid state of the blockchain network. Consequently, avoiding any possibility of double spending. It follows the principle of burning or destroying coins held by the miners that grant them mining rights.
Iain Stewart, the inventor of POB algorithm, cites an analogy – “Burnt coins are mining rigs. Essentially, a miner burns his/her coins to buy a virtual mining rig that gives him/her the power to mine blocks. The more coins burned by the miner, the bigger the ensuing virtual mining rig.”
In order to burn the coins, miners send them to a verifiably unspendable address. Participants can send out transactions to the network and burn his own cryptocoins. Other participants can mine/burn on top of these blocks, and can also add transactions of other participants to the block. All such burning activity keeps the network agile and participants are consequently rewarded for the activities.
In order to prevent any possibility of undue advantages for early adopters, PoB has intrinsically implemented a mechanism that promotes the periodic burning of cryptocoins to maintain mining power. The power of burnt coins reduces partially each time a new block is mined. It promotes regular activity by the miners, instead of the one-time early investment. Moreover, to remain in the game with a competitive edge, miners may also need to invest periodically in better equipment similar to the work done in physical mining rigs with advancement in technology. Slimcoin uses PoB consensus mechanism.
7.Proof of Elapsed Time Consensus Protocol
PoET is a consensus mechanism algorithm often used on the permissioned blockchain networks to decide the mining rights or the block winners on the network.
Each participating node in the network is required to wait for a randomly chosen time period, and the first one to complete the designated waiting time wins the new block. Each node in the blockchain network generates a random wait time and goes to sleep for that specified duration.
The one with the shortest wait time commits a new block to the blockchain.
The PoET network consensus mechanism needs to ensure two important factors. One, that the participating nodes genuinely select a time that is indeed random and not a shorter duration chosen purposely by the participants in order to win. Two, that the winner has indeed completed the waiting time.
PoET controls the cost of the consensus process so that it remains proportional to the value derived from the process.
8.Proof of Capacity Consensus Protocol
Proof of Capacity (PoC) is a consensus mechanism algorithm which allows the mining devices in the network to use their available hard drive space to decide the mining rights.
PoC works by storing a list of possible solutions on the mining device’s hard drive even before the mining activity commences. Proof of Capacity involves a two-step process that involves plotting and mining.
Plotting and Mining
First, PoC creates a list of all possible nonce values by repetitive hashing. Each such nonce contains 8192 hashes . PoC pairs hashes into scoops – that is, adjacent hashes combine to form a pair of two.
Second, a miner calculates a scoop number. For instance, say a miner begins the mining activity and generates a scoop number 38. The miner would then go to scoop number 38 of nonce 1, use that scoop’s data to calculate a deadline value. The miner repeats the process for calculating the deadline for each nonce. The miners selects the one with a minimum deadline. A deadline represents the duration of time in seconds that must elapse since forging of the last block before it allows a miner forge a new block.
If no one else has forged a block within this time, the miner can forge a block and claim the block reward. For example, if miner X comes up with a minimum deadline of 36 seconds and no other miners can forge the block within the next 36 seconds, X will be secure the chance to forge the next block and get rewarded.
PoC allows advantages in terms of using any regular hard drives including those with Android-based systems. It claims to be 30 times more energy-efficient than the ASIC-based mining of the Bitcoin cryptocurrency. Moreover, there is no need for dedicated hardware or constant upgrading of hard drives. Burstcoin uses Proof of Capacity consensus algorithm.
Conclusion
Conclusively, systems cannot achieve Byzantine fault tolerance without consensus mechanisms. On the other hand, it is important to remember that no consensus mechanism is perfect. With newer cryptocurrencies coming out with new protocols, blockchain will witness a new transformation.