Proof Of Stake

x1xx1x
4 min read

What is it?

Proof of Stake (PoS) is a blockchain consensus mechanism that allows validators to create new blocks and validate transactions based on the number of coins they hold and are willing to "stake" as collateral. Unlike Proof of Work (PoW), it does not require energy-intensive computations, making it more environmentally friendly.

Breaking down Proof of Stake

Proof of Stake underlies the consensus mechanism used by the Ethereum network and many other blockchains today. The core idea is as follows:

  • Validators stake capital in the form of $ETH tokens into a smart contract on Ethereum mainnet

  • The staked ETH acts as collateral and can be destroyed if the validator behaves maliciously by lying about the current state of the blockchain or not responding to requests made by other validators

  • The validator is then responsible for checking that new blocks being formed are valid, and sometimes creating those blocks themselves

With the stake in place, lying as a validator can cause you to lose your staked capital. Therefore, validators are financially incentivized to not lie about their actions.

Block Production

In Proof of Stake, validators replace miners, and the need for energy-intensive mathematical puzzle-solving is eliminated.This is a significant advantage in terms of reducing energy consumption and making blockchain networks more environmentally friendly.

How do you become a validator?

To become a validator, you need to:

  1. Put up some money (in Ethereum, you need to put down 32 ETH which’s like betting on yourself).

  2. Run some special software ( an execution client eg go-ethereum, a consensus client, and a validator client)on your computer. It’s like setting up a few different programs to help with the network.

What Do Validators Do?

  • Validators don’t need to solve any puzzles. Instead, they take turns proposing new blocks .

  • Every 12 seconds, one validator is randomly chosen to propose the next block.

The Voting Process

  • Once a validator proposes a block, other validators vote on whether that block is good or not. This is called an attestation.

  • If enough validators say, “Yep, that’s a good block,” then it gets added to the Ethereum blockchain.

  • If a validator tries to cheat and proposes a bad block, they can lose their money. So, they’re motivated to be honest!

Sybil Resistance

Proof of stake is actually a sybil resistance mechanism and a block producer selector.

Sybil Resistance is a measure of how well a protocol would do against a Sybil Attack. A Sybil Attack is the problem where one user, or one group, pretends to be many different users or many different groups

Proof of Stake helps protect against these kind of Sybil Attacks by making validators put up their stake as collateral, therefore having them put their money where their mouth is. The more number of validators you want to act as, the higher stake you need to put up. Each validator has a minimum requirement of 32 ETH required to be staked. If you act maliciously and pretend to be multiple validators, you must have multiples of 32 ETH at stake, therefore a higher collateral at risk of getting slashed. This acts as an economic deterrent to sybil attacks.

Chain Selection Rules

Occasionally, due to issues such as internet latency, it is possible for two validators to have two different views of the current state of the blockchain, and therefore two different views of what constitutes a valid new block. This is what's called a fork in the blockchain.

Normally, when the network is performing optimally and honestly, there is only one block at the head of the chain, and all validators can agree on that. In the case of a fork however, it is important to have a way to converge back to a single chain and therefore have a single view of the current state of the network.

The "correct chain" must be chosen to prevent the splitting of state and letting the fork continue for too long.

To do this, Proof of Stake Ethereum uses an algorithm called LMD-GHOST which works to identify which fork has the greatest amount of attestations in its history. For example, if the chain splits into two at some point, and different validators have different beliefs, LMD-GHOST will figure out which of the two forks has received a higher number of positive votes i.e. was approved by a majority of validators on the network. Then, the other validators will converge on resuming from the majority chain and the other fork will be discarded.

Occasionally, this also means that transactions which get validated as part of a temporary fork may be rolled back once the fork is replaced in favor of a different fork. This is a good segue into the concept of Finality.

Finality

A transaction has finality on Ethereum when it's part of a block that cannot be changed, i.e. the transactions in that block cannot be rolled-back, at least not feasibly.

Additional Resources

The following are optional, but recommended, additional readings to help you understand even more about Proof of Stake:

0
Subscribe to my newsletter

Read articles from x1x directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

x1x
x1x

Everyday learner