Proof-of-stake

PoS is a new algorithm to reach consensus between nodes in a decentralized blockchain that focuses on removing the high computing performance requirements from PoW while still keeping the network safe from attacks and malicious behavior. The way it works is based on locking Ether as a stake and validating blocks with the risk of losing your stake if you misbehave. Here's the process:

  • People that want to participate in the PoS process are called validators. They start by locking a specific number of coins as their stake (for instance, 100 Ether) that they can't touch while they are mining. It should be expensive enough to guarantee that groups of people don't agree on attacking the system with the risk of losing their stake if they're unsuccessful.
  • Then, they start receiving transactions from people using the Ethereum blockchain. Validators run programs to validate that the transactions they are receiving are valid so that they can create new blocks by grouping transactions in order. When they have enough transactions to cover the gas limit per block, they place bets on those blocks – for instance, 20 Ether from the initial 100 Ether staked.
  • The block with the most bets is selected as the winner.
  • When the winning block is selected from the pool of generated blocks, the miners that bet on that valid block get a percentage of the total gas used in that block based on their bets. They are not paid in block rewards but in transaction fees. For instance, if the block selected has 100 transactions accumulating a total of 0.5 Ether in transaction costs, that 0.5 Ether will have to be distributed between all the validators that bet on that block. If that block has a sum bet of 1,000 Ether from 10 users and you bet 20 ether, you'd get a 2% of 0.5 Ether, since that's how much you bet for that block. In total, you'd earn 0.01 Ether.

You don't lose any money when betting for blocks, it's just an indicator of how much you trust the validity of that block. It may seem a small reward considering that there aren't block rewards, just fees, but you must consider that these blocks are being generated in a matter of seconds. Maybe even one second per block, which ends up generating a lot of money over the day.

It looks great in theory, but there's a major roadblock that's stopping PoS from being completely viable. It's called the Nothing at Stake problem and is shown in the following scenario, where there is a main chain and a new chain being created with PoS:

When it comes to PoW, you can mine on any fork that you desire without any risk, since you can place bets on every block that looks good to you. What's stopping you from deciding to put all your eggs in a new chain, thus generating a hard fork?

If we were using PoW, you couldn't move to a new chain without having to spend lots of processing power and time generating new blocks for as long as people decide to accept it as a new blockchain. You'd be mining for many months with a very slim chance of creating a new chain that could be accepted as a new coin, worth much less money because of its reduced use.

But with PoS, you can simply diversify your portfolio and bet on all the blocks that look appealing without consequences, since you won't be losing your stake as long as you're validating good transactions. You'd be generating blocks on several different blockchains without risks. This kind of possibility could end up creating hundreds of different blockchains, since people could be mining on all of them simultaneously. That's why it's called the Nothing at Stake problem, because you don't lose anything when participating in the mining process.

This is one of the main reasons why Ethereum has been unable to switch fully to PoS in recent times.

Researchers at Ethereum have been working on solving this problem for a long time. One of the proposals, known as Casper, intends to solve it by punishing users that mine on new chains mindlessly by taking their stake out of them, so that users focus on betting for the longest chain. Casper also punishes nodes that don't actively participate on the network so that they don't start consuming resources without providing value.

At the end of the day, PoW has to improve or change completely to become sustainable, given that many large mining pools are starting to gain too much power. We are at a point where four mining companies can achieve about 60% of the total transaction power, giving them the choice to run a 51% attack and force all users to mine on their own terms with their own corrupted blockchains. PoS is here to stay and bring balance back once again.