On Proof of Stake
What, Why, and How is consensus achieved by proof of stake?
Before I jump into the core idea of this post, I would like to take a moment to dedicate it to Shakti Goap who passed away earlier last week. He through his company Devfolio brought the hacker culture to India and empowered thousands of students/dropouts/etc to build. He and his team were also behind ETH India. He will be missed.
I’ve been talking a lot about DeFi lately with many of my friends and some strangers on crypto discord servers. But one thing that I’ve found in common is that they get what Proof of Work does but are highly confused about the “What, Why, and How of proof of stake” which is why I will attempt to simplify and reduce confusion around it.
Mainly because a sizeable chunk of these people is betting on side-chains and other cryptocurrencies with a proof of stake consensus mechanism thinking that Proof of Stake somehow miraculously solves all the security problems and especially the 51% attack.
I found myself explaining this idea a lot, so I thought why not just write about it and share it with anyone interested in quickly understanding this consensus mechanism.
Also, moving forward I will be using the abbreviations like PoW and PoS for proof of work and proof of stake.
Why not PoW?
There are several reasons for not using PoW but one, in particular, means a lot to me, which is fairness. Mining coins using PoW is not fair to everyone who participates in the process because:
A big company can easily get discounts on things like hardware, electricity, network and various other things. They can enjoy the benefits of economies of scale.
But an indie miner who doesn’t have the resources to order in bulk or large enough electricity usage to cut a deal with the electricity board will suffer unfairness because they don’t have the same opportunity. Their unit economics will be far greater.
So in PoW, economies of scale clearly apply which means the system doesn’t provide equal opportunity to every one according to their weight class.
There are many other reasons not to use PoW but they are very popular and are widely covered in many public posts. So we won’t get into them.
What is PoS?
PoS stands for proof of stake and the keyword to understand here is stake.
It is a consensus mechanism that randomly chooses special kinds of users (called validators) to validate a set of transactions and submit blocks to the blockchain.
To become a validator, these users have to deposit a minimum amount of tokens (called a stake) which usually gets locked by the network. The probability of being chosen randomly, directly depends on the amount of your stake.
These validators get rewarded in return for putting up stake and validating transactions. The reward for validating a transaction is always lower than the stake.
There are some obvious benefits, which I will list out in this section, and in the next section, I will illustrate how each one of them works.
Some protection against 51% attacks (Yes, no system is 100% resistant)
More accessible, fair, and decentralized than PoW (economies of scale)
Low energy consumption
How does PoS work?
😈 Protection against Malicious Validators
The sneaky part about PoS is if a whale validator tries to add/validate a malicious transaction they can lose their entire stake. If they go offline or fail to validate after being chosen, a part of their stake can be slashed (or taken away); This incentivizes them for having good behavior because they have an asset on the line which can be taken away if they go rogue.
This is awesome because in PoW there’s nothing you can do to punish a miner, but now we have some options atleast!
📉 Some Protection against 51% Attack
The game is unfair to attackers in PoS.
In PoW (GPU), there is no way of defending and a persistent attacker might cause the chain to render useless. Also, over time the attacker’s cost will decrease since the “honest miners” will drop out, hence the attacker doesn’t need to put together that much mining power.
In PoS there are certain advantages:
For certain types of 51% attacks, there’s an inbuilt slashing mechanism that automatically destroys a sizeable chunk of the attacker’s stake.
For harder to detect 51% attacks, the community can coordinate on minority-user-activated-soft-fork (UASF) in which the attacker’s stake is destroyed. No need for a hard fork to delete coins.
The incentives are aligned against the attacker because every time they attack the network, they stand a chance to burn millions of dollars and keep burning more with subsequent attacks. As a result of this, the entire ETH community gets richer, because burning the attacker’s ETH reduces the supply of ETH that in turn increases the overall value of ETH.
🤘 More Accessible, Fair, and Decentralized
The probability of being randomly chosen is directly proportional to the amount of Stake you deposit, the chance is linear according to the stake. Look below:
Therefore PoS is fairer because economies of scale do not exist, this is also the reason for PoS being more decentralized since the requirements for a validator are way low and thus it is more accessible to people.
In ETH 2.0, an account must have a minimum of 32 ETH to become a validator and having any more amount wouldn’t increase your rewards. But if you have a surplus in the denomination of 32 ETH, then you can create more validators and increase your chances (& rewards) for validating transactions!
⚡️ Low Energy Consumption
Now since people are being chosen randomly by the network, they don’t have to compete against each other with mining power which implies that they don’t need to have a huge mining rig to participate in the process. Hence PoS chains save a huge chunk of energy that was previously being consumed by the network.
🔮 Censorship Resistance
PoS is also more censorship-resistant than PoW (GPU/ASIC). It is fairly easy to find a mining farm because they all require expensive hardware, huge electricity usage, and large warehouses. While a PoS validator can be a simple laptop in a small town.
In conclusion, PoS definitely has some really good benefits both for the network and for the environment. Even though PoS makes it comparatively easier to defend against attacks by changing the incentives completely, it doesn’t mean that PoS is resistant to those attacks. It is a better alternative to PoW in many aspects for sure, which is why new chains are adopting this consensus mechanism and ETH is almost using it.
I hope I made some sense with this post and hopefully helped you better understand some of these concepts. Writing this post and researching on multiple advanced posts, helped me understand PoS even better.
Please feel free to correct me if you feel that I may have not explained something correctly or if there’s a better explanation of these concepts. I would love to go through them and improve my understanding even further!
Also if you enjoyed this post, please subscribe and follow me on Twitter to watch me explore interesting things in the blockchain space and frontier tech in general.