Blockchain consensus protocol’s
We are very much aware that blockchain is a distributed ledger that’s secure, decentralized & transparent. These features come from the roots of it’s design — The Consensus Protocol
The general definition of consensus is, coming to an agreement and protocol are a set of rules that need to be followed to perform actions. So in blockchain, Consensus Protocols are fixed rules in which all the nodes in the network agree to the new state(copy) of the blockchain.
Let’s say there are 4 nodes in a network having a copy of the blockchain consisting of 4 blocks. Now, node A mines a new block and adds it to the copy of the blockchain that it holds. As we know, blockchain is a distributed ledger hence all the nodes should have the same copy of the blockchain.
All the remaining nodes will follow a protocol and come to a consensus to verify whether it’s a valid block or not.
If the block is valid, it will be added to the chain and the miner will be rewarded some tokens of that blockchain.
Basically that’s how a consensus protocol works in blockchain. Different blockchain’s have different consensus protocol
1. Proof Of Work (PoW)
Yes, it means what it sounds like, showing the proof that you have done the work. As we know mining is basically solving a complex mathematical problem that requires high computational power. At a time when many miners compete to mine a block, the node that wins the race has a proof of work of spending energy and resources and hence it’s rewarded when the block is verified and added to the chain. If the node tries to perform malicious activity, the block will not be verified by other nodes in the network and the miner doesn’t get the reward, which is a total waste of its resources and time. Bitcoin works on PoW, while Ethereum is on its way to Proof of Stake. Proof Of Work requires a lot of power as many miners try to compete to mine a block, Proof Of Stake is a better alternative.
2. Proof of Stake (PoS)
In Proof of Stake, instead of miners competing in a race to mine a block, they are asked to stake (deposit) some minimum tokens of that blockchain to become validators (Miners in PoS are called as Validators). The validators are chosen randomly taking into consideration how many tokens they have staked or for how long they have been staking. If a validators performs any malicious activity he’s penalized from the stake. It is a more energy efficient protocol as not all the validators compete against each other which lowers transaction cost and increases throughput. This is one of the primary reasons for Ethereum to migrate to PoS.
3. Proof of History (PoH)
Proof of History is an extension of proof of Stake, developed by Solana. And it’s one of the primary reason why Solana is very fast having the block time of 400 millisecond compared to Ethereum (1Sec) & BTC (10Mins). PoH introduces a variable of time in the block, it’s showing the proof that a historical event had occurred. In other consensus protocols the validators need to talk to each other to agree on, when a block was added and how much time has passed. Whereas in Solana it has it’s own clock coded in a SHA256 algorithm, the validators keep mining blocks and they are sequentially added to the chain.
Looking to start your Smart Contract Development journey? There’s no place better than our Youtube Channel
We are present in the multiverse of social media, do follow to not miss even small drop of knowledge.