Blockchain is a classic example of a distributed system with no central source of truth. Like any distributed database, it cannot have consistency, availability, and partition tolerance simultaneously (following CAP theorem). Most of the blockchains ensure availability and are partition tolerant. But it is often possible for participating nodes to be in an inconsistent state. Each peer in the blockchain network can build up a different set of transaction histories leading to divergences called forks. To achieve consensus among different copies of blockchain at each node in a trustless setup, without being fault-tolerant at the same time, has been a challenge for blockchain developers. Let’s delve into how blockchains achieve this. Byzantine’s Generals Problem One of the typical failures of a distributed system in an unreliable network is node failure, often represented by a thought experiment called “Byzantine Generals Problem.” According to it, some group of generals of a Byzantine army camped with their troops around an enemy city. One group in itself is not enough to defeat the city, so generals must agree upon a common battle plan. These groups of armies are separated from each other and communicate through messengers. But while transferring the message, the messenger can be captured by the enemy. The message could be altered or lost forever. It may result in one general attacking while the others hold their grounds. On receiving a message, an acknowledgement is sent from receiving general to the sender, that messenger could get caught. However, there may be an infinite loop of sending acknowledgements back and forth to achieve consensus here. Neither general knows if the message has been received or not. Moreover, one or more of the generals can be a traitor and lie about their choice and try to confuse others. Similarly, the problem to find an algorithm to ensure that the loyal generals will reach an agreement represents the problem among different components of a distributed system to achieve a consensus on blockchain state. This problem could be solved only if when more than two-thirds of the generals are loyal. The consensus is impossible to achieve if one-third or more of the generals are traitors. Byzantine Fault Tolerance A blockchain network experiences a lot of asynchronicity caused by messaging delays. There are no prior assumptions on the behavior of participating nodes. Every blockchain employs a consensus mechanism to provide eventual consistency among nodes despite having malicious actors who would love to hack the system to get access to the wealth. The blockchain system is capable to tolerate the failures brought in by byzantine’s generals problem as long as the number of malicious nodes does not exceed a third of the honest nodes. In Bitcoin (the original blockchain), Proof of Work provides the consensus. Many other blockchains like Ethereum, Litecoin, Dogecoin, Monero, etc also employ this protocol. Miners compete to create new blocks, mint new coins, and keep these rewards. This is a highly incentivized system for miners with nothing at stake to prevent any malicious behavior. Proof of Work involves a computationally challenging puzzle that miners compete to solve. The annual energy consumption of Bitcoin alone is comparable to the power consumption of Chile. A Bitcoin single transaction has a carbon footprint equivalent to that of 720,232 VISA transactions. To prevent this wasteful usage of electricity, many other consensus protocols have been suggested. Proof of Stake is one such protocol, first adopted by Peercoin. PoS Algorithm Developed as an energy-saving alternative to PoW, Proof of Stake is adopted by many blockchains today. It introduces security deposits called stakes. Miners are replaced by the validators. They are selected based on their stakes to perform mining and add a new block. The blockchains implementing this protocol consumes less energy. These have a stronger immunity to centralization (unlike mining pools in PoW) and lowers the hardware requirement barriers to mining. Typically the block size is larger, and the block time is much shorter, thus the transaction throughput is much higher. PoS networks flip incentives from rewards for miners to penalties by slashing the stake to simulate the incentives of PoW. It is used as a mechanism for converging consensus among honest validators and a threat to dishonest validators. Each node chooses the longest fork, with each block weighted by its block reward. Block rewards are proportional to the total amount of ether actively validating it. It ensures that the chains with more actively validating ether grow faster. So each node in the network adopts the blockchain on which the validators have the most value at stake. This can be thought of as the chain in which validators lose the least money. PoS is adopted by various blockchains including Ethereum 2.0, Cardano, Sp8de, Tezos, Algorand, etc. PoS in Ethereum: Ethereum is moving to the PoS consensus mechanism from PoW via … Continued
The post A Complete Guide on the Proof of Stake (PoS) in Blockchain appeared first on Cryptoknowmics-Crypto News and Media Platform.
from Live Crypto News – Cryptoknowmics-Crypto News and Media Platform