15 June 2020
But what is a consensus algorithm? What is proof of stake (PoS)? What is of proof of work (PoW)? Let’s delve in and explore.
What is a consensus algorithm?
Consensus is a method through which members of a group reach a dynamic agreement without causing disharmony. A consensus algorithm is a method through which a group reaches a consensus.
A consensus algorithm must meet these six rules.
- It must give a result.
- The votes of all participants must carry equal weight.
- Participants must actively participate in the process.
- It must create a spirit of collaboration.
- The interests of the group must come before those of the individuals.
- All participants should feel included in the process.
Now that you understand what a consensus algorithm is let’s look at the two types of consensus algorithms: proof of work and proof of stake and how they work.
What is Proof of Work (PoW)?
Not everyone in a blockchain network is honest. To prevent fraud, miners have to validate new transactions before they are recorded on the blockchain.
Miners validate transactions by competing to solve complex cryptographic puzzles. The first miner to find the answer is rewarded in cryptocurrency. For instance, in the Bitcoin blockchain, miners are rewarded with Bitcoin, while in Ethereum, they are rewarded with Ether. Finding the answer is also proof that the miner has done his/her work in validating blocks.
Proof of work serves two purposes in a network.
- It helps ensure all transactions are legitimate.
- It creates new currency by rewarding miners for validating blocks.
Advantages of Proof of Work
The proof of work algorithm ensures that the blockchain network is secure by having miners validate incoming blocks.
It also ensures that miners cannot cheat the system because the work they put into solving a current puzzle does not enhance their ability to solve future puzzles.
It prevents those with huge capital reserves from taking control of the system because only your computing power is important.
Disadvantages of Proof of Work
Proof of work requires a lot of computing power. Because the system rewards those with better hash rates, it has led to people creating colossal mining farms. Even worse, miners are combining their power to form pools of miners, causing the blockchain to become more centralized. This also increases the risk of a 51% attack.
These shortcomings of proof of work consensus algorithm necessitate the need for a better method of validating transactions. One such method is the proof of stake algorithm.
What is Proof of Stake (PoS)?
In the proof of stake system, those who validate transactions are chosen from a pool of users with coins staked or held in a wallet. The more coins a user has, the more likely he is to be selected to add a block to the ledger.
Proof of stake miners are known as validators. Validators have to have enough computing power to process transactions, and since there is no additional need to calculate hashes the required computing power significantly lower than on PoW.
The proof of stake model works on the idea that the more someone invests in something, the less they would want to cheat. The stake is a certain amount of crypto coins that the validator invests in the system. Once you stake your coins, you cannot spend them.
Those who wish to become validators deposit some of their coins in the network as stake. The size of their stake determines a validator’s ability to create the next block on the blockchain; the bigger your stake, the higher your chances of validating a block.
Different blockchain networks use stakes in different ways. The four most common ones include:
- Random selection- a block publisher is chosen randomly. The network examines all the validators and selects one based on the ratio of the coins used to the total amount.
- Multi-round voting system – here, the network selects several validators who will cast a vote for the proposed block. It may take several rounds of voting to create a new block.
- Coin age system – in this system, the stacked crypto has an age property. It can only count towards helping the owner validate a block after a certain period has passed. The staked coins also have an age reset, meaning that the validator must wait until the requisite time has passed before using the coins again.
- Delegate system – in this system, users vote for nodes to become publishing nodes. A user’s voting power is tied to their stake; the more significant their stake, the more their voting power.
Advantages of Proof of Stake
Proof of stake does not require massive amounts of energy to secure the blockchain. Also, it does not require the creation of more coins because validators are not incentivized using coins.
Because economies of scale are not a big issue in proof of stake, the method is less likely to encourage centralization.
Additionally, proof of stake makes it more expensive to take over the network hence reducing the chances of a 51 % attack.
Disadvantages of Proof of Stake
Because the proof of stake requires validators to use their coins to gain validating power, the rich are likely to be chosen more often. They, in turn, become richer and increase their chances of becoming a validator again.
An even bigger problem with this consensus algorithm is that the validators don’t always show up to do their job, making this a more flawed consensus algorithm than proof of work.
Conclusion: Proof of Work vs Proof of Stake
Proof of work (PoW) and proof of stake (PoS) are critical consensus mechanisms for blockchain networks, and in this article, we have provided a simple explanation of how they work. But who would win in a battle of PoW and PoS?
That would depend on who you ask. While a PoS is undeniably better in terms of lower energy consumption, it’s largely untested. PoW on the other hand, is widely used has seen over a decade of testing on the Bitcoin network.