[Ethereum] How does the Casper proof of stake algorithm work

casperconsensusproof-of-stake

Ethereum plans to move to the Casper proof of stake algorithm in a future version of the network. What are the details of that algorithm, and how does it compare to previous Proof of Stake consensus protocols?

Best Answer

The friendly Ghost

Casper is a security-deposit based economic consensus protocol. This means that nodes, so called bonded validators, have to place a security deposit, an action called bonding, in order to serve the consensus by producing blocks.

In Casper style proof of stake anyone can participate in block production by posting a bond. After posting a bond you have an opportunity to bet on which block will be included next. The incentives are such that you make money by betting with the eventual consensus and lose money by betting against the consensus. Any crypto-graphically provable misbehavior results in the forfeit of the bond.

An analogy can be made to proof of work where each miner is betting with their hash power on which block will be accepted. If they bet wrong then any block they produce will be orphaned causing them to lose money.

This protocol has several nice properties:

  • Anyone can participate
  • Consensus can be reached in a timely manner
  • It quickly converges on an irreversible consensus
  • It is free of politics

Casper in non-economic terms

Casper is an eventually-consistent blockchain-based consensus protocol. It favours availability over consistency, see the CAP theorem. It is always available, and consistent whenever possible. It is robust to unpredictable message delivery times because nodes come to consensus via re-organization of transactions, after delayed messages are eventually received. It has an eventual fault tolerance of 50%, in the sense that a fork created by >50% correct nodes scores higher than any fork created by the remaining potentially-faulty validators. Notably, though, clients cannot be certain that any given fork created with 51% participation won’t be reverted because they cannot know whether some of these nodes are Byzantine. Clients therefore only consider a block as finalized if it has the participation of a supermajority of validators or bonded stake.