Before understanding what proof of stake means, we need to understand what proof of work is because proof of stake was introduced because of limitations present in the proof of work.
Proof of stake is a consensus mechanism to choose a validator from a pool of validators.
One of the primitive ways was to let all the validators solve a problem. The problem is mathematical, requiring a lot of computation power, and its difficulty is increased each time a new block is mined.
Whoever solves the problem first is given a reward associated with that block, and that is how validators (or miners in this case) are incentivized to participate.
This mechanism, also known as Proof of Work, is used in securing the Bitcoin network. It consumes much energy since billions of computers fight for that reward, but unfortunately, only one will win. Thus, all the work done until the last point is wasted, and so is the energy.
You might have heard that the Bitcoin network consumes around 91 terawatt-hours of electricity annually, more than what is consumed by Finland, a nation of about 5.5 million.
That really is a massive concern for the environment and the network's sustainability.
What are Consensus Mechanisms?
Consensus means to agree upon something in a large group of people; it is like proposing an idea for a particular thing and asking the community whether they agree on that or not. If the majority of the people decide, we go ahead with that idea. Otherwise, we drop it.
Proof of Work and Proof of Stake are both "consensus mechanisms," which are methods for maintaining the integrity of the underlying blockchain network.
When a transaction is done in the network, it is like an idea, and all the nodes (computers) check or agree whether the transaction is genuine or fraudulent.
If I only have $10 in my account and I bought a bobblehead with it worth $10, my account balance should be reduced to 0, but what if for some reason my balance is still $10? I.e. for some reason, my previous transaction was not settled, and yet I was able to go on ahead with a new transaction. (These are the issues that are tackled by Banking Infrastructures that are centralized in nature and it is pretty easy for them to solve it, but things are complicated when the whole infrastructure is decentralized in nature).
In this scenario, the network asks does this user spends his money to buy a bobblehead? The majority of the network should agree upon it and say yes, he did, and if so, my balance should be reduced to zero, and I should not be allowed to spend anymore.
If, for some reason, the majority of the network says no, then there is something wrong with it, and this occurs when we have a 51% attack.
How Proof of Stake Consensus Works?
Proof of Stake is similar to Proof of Work; both are used to attain consensus and keep the underlying blockchain secure. Unlike proof of work, there is no race amongst the nodes (computers) to validate a transaction.
Instead, they now participate in a lucky draw whose winner is decided by the blockchain itself.
How is the winner decided?
The Proof Of Stake method selects a node to be the validator of the next block using a pseudo-random selection process based on a combination of parameters such as
- Staking age (the longer you stay in the network, the more trustworthy you are considered and the higher are your chances to be selected as the validator)
- Randomization (it is evident that we need to have some salt to include randomization otherwise, it will be predictable who will be the next validator which can cause an attack on that validator and reduce the security of the network)
- Node's wealth (the more money you have put on the stake, the more your chances to be selected as the next validator)
The winner then validates the transaction and gets a reward for solving the problem and having consumed much lesser electricity.