Consensus Protocols in Blockchain
Tags: Blockchain Technology, Proof Of Work, Consensus, Proof Of Stake, Blockchain

Consensus Protocols

The consensus protocols, at a high-level tries to solve “Byzantine General” problem. This is the term you will hear, when talking about consensus mechanisms in Blockchain. There is an interesting story behind this.

Imagine this scenario. There is a castle in the middle and lieutenants have surrounded the castle. The General plans to launch an attack. However, since the army is so scattered, the General doesn’t have centralized control. The only way that the castle could be defeated is if the army launches a planned and synchronized attack, at the same time. The only way that Generals can agree on the timing, is by sending messages via messengers. Now, the problem is, what if the messenger gets captured by the enemy and their message is tampered with. Also, what if the General himself is corrupt and looking to spread discord among the Generals. So, there is no way to check if the message is authentic, so how do we, as the finest military strategists in the land, create a “trustless” system that ensures victory in attacking the city? This is Byzantine Generals problem.

Proof-of-Work (PoW)

Source: en.bitcoinwiki.org

This is the most popular consensus mechanism, as PoW is the mechanism used in Bitcoin, Ethereum and most other Blockchain networks. In PoW, each participating node performs a mathematically challenging problem, to add a new transaction to the block. Whoever performs this complex task first, will broadcast their work to the entire network and the other nodes verifies the work and updates the Blockchain. Here, the miner who solves the problem first, receives a reward for doing the work. As the miner is performing work and presenting the proof for the work they have done, this is called as “proof-of-work” protocol.

Proof of Work was the original solution to the double-spend problem and has proven to be reliable and secure. Bitcoin proved that we don’t need centralized entities to prevent the same funds from being spent twice.

For PoW, as the network grows, mining requires lot of energy. At some point, miners might not have any advantage for mining, as the spend vs reward might not be worth participating in mining process. This might pose a problem of having few big players participating in the mining, negating the advantage of having decentralized network where anyone can participate.

Proof-of-Stake (PoS)

Source: en.bitcoinwiki.org

Proof of Stake (PoS) is a category of consensus algorithms for public blockchains that depend on a validator’s economic stake in the network. Note the term validator. That’s because no coin creation (mining) exists in proof of stake. Instead, all the coins exist from day one, and validators (also called stakeholders, because they hold a stake in the system) are paid strictly in transaction fees. Here, a set of validators take turns proposing and voting on the next block, and the weight of each validator’s vote depends on the size of its deposit (i.e. stake). Significant advantages of PoS include security, reduced risk of centralization, and energy efficiency. So, in this type of consensus algorithm, instead of investing in expensive computer equipment in a race to mine blocks, a ‘validator’ invests in the coins of the system.

In proof of stake, your chance of being picked to create the next block depends on the fraction of coins in the system you own.

Proof-of-Activity

Proof of activity is a hybrid approach that combines both PoW and PoS. In proof of activity, mining kicks off in a traditional proof-of-work fashion, with miners racing to solve a cryptographic puzzle. At this point, the system switches to proof of stake. Based on information in the header, a random group of validators is chosen to sign the new block. The more coins in the system a validator owns, the more likely he or she is to be chosen. The template becomes a full-fledged block as soon as all of the validators sign it.

Conclusion

In the world of Blockchain, consensus protocols dictates the functionality of the technology. There is lot of research and experimentation going on in this area. As the technology is becoming more and more popular with each day, it has to be scalable and consensus protocol affects the latency and the usability of Blockchain. Proof-of-work is effective, but it brings many downsides with it, giving space to other protocols like Proof-of-stake and Proof-of-activity. However, it is still in its infancy stage and there will be lot of advances in this area, in the near future. Irrespective of the future of Cryptocurrency, Blockchain is going to stay and will find its way into many fields and consensus mechanisms becomes key with each application.