Lesson 4 of 4 Ethereum Fundamentals

Proof of Stake Consensus

Consensus decides which blocks become part of the chain. This lesson explains how Ethereum moved from proof of work to proof of stake, how validators, slots and epochs work, and what finality means for applications that wait for confirmations.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how the Merge replaced proof of work with proof of stake.
  • Explain validators, slots, epochs, attestations and slashing.
  • Explain how finality is reached and how long it takes.
  • Translate mining terminology into proof-of-stake terms.

From proof of work to proof of stake

Ethereum launched with proof of work. Miners repeatedly hashed candidate blocks until one found a hash below a difficulty target; the winner earned the block reward and fees. Security came from the cost of hardware and electricity, and blocks arrived roughly every 13 to 15 seconds. Most 2018-era material, including the original framing of this exam, describes this model, with miners, mining difficulty and, on development networks, "mining" blocks.

On 15 September 2022, the Merge switched Ethereum to proof of stake. The existing execution chain was joined to the Beacon Chain, which had been running proof of stake since December 2020. Energy use fell by more than 99.9%, mining ended, and the accounts, contracts and transaction history carried on unchanged. Development tools still use the word "mine" for producing a block on a local chain.

Match the pairs

Translating older terms

Exam skills 7.1.3

Match each proof-of-work term from older material with its current proof-of-stake equivalent.

Log in to try this activity Interactive activities are free with an account.

Validators, slots and epochs

Proof of stake replaces computing power with deposited capital. The following terms describe its main parts.

Validator
A participant that has deposited at least 32 ETH and runs software to propose and attest to blocks.
Slot
A 12-second period in which one randomly selected validator may propose a block.
Epoch
32 slots (6.4 minutes); validator duties and checkpoints are organised by epoch.
Attestation
A validator's signed vote for the block it sees as the head and for checkpoints.
Slashing
Removal of part of a validator's stake and ejection for provably dishonest actions, such as signing two conflicting blocks.

Validators earn rewards for proposing blocks and making timely, correct attestations, and they receive the priority fees of the transactions they include. Being offline costs small penalties; attacking the chain risks losing a large share of the stake. Since the Pectra upgrade, a single validator can hold an effective balance of up to 2,048 ETH.

Fork choice and finality

Ethereum's consensus protocol, Gasper, has two parts. The LMD-GHOST fork-choice rule picks the head of the chain as the branch with the most recent attestation weight, so the chain keeps growing even under poor network conditions. The Casper FFG finality gadget looks at checkpoint blocks at the start of each epoch: when validators holding two thirds of the staked ether attest to a checkpoint, it becomes justified, and when the next checkpoint is also justified, the earlier one becomes finalised.

A finalised block can only be reverted if at least one third of all staked ether is slashed, which would cost attackers billions of dollars. Finality normally arrives after about two epochs, roughly 12.8 minutes.

The following diagram shows checkpoints becoming justified and finalised.

Fork choice and finality in Gasper. The LMD-GHOST fork-choice rule picks the head of the chain from the latest attestations, so recent blocks can still change in a reorganisation. Casper FFG looks at the checkpoint at the start of each epoch: when validators with two thirds of the stake attest to it, it is justified, and when the next checkpoint is justified, the earlier one is finalised. Reverting a finalised block would require at least one third of all stake to be slashed. Finality normally arrives after about two epochs, roughly 12.8 minutes.
Recent blocks can change; finalised blocks practically cannot.
Put in order

From proposal to finality

Exam skills 7.1.3

Arrange the stages a block passes through on its way to finality.

Log in to try this activity Interactive activities are free with an account.

What this means for developers

Applications choose how long to wait before treating a transaction as settled. The following comparison shows the main options.

Included in a block
Time after inclusion0 seconds
Reversal riskSmall: the block could be reorganised out
Typical useUpdating a user interface
A few confirmations
Time after inclusionAbout 1 minute
Reversal riskVery small
Typical useLow-value transfers
Finalised
Time after inclusionAbout 13 minutes
Reversal riskPractically none
Typical useExchanges crediting deposits, bridges

Block timestamps follow the slot schedule, so a block's timestamp is predictable to within the slot. This makes timestamps reliable for coarse deadlines but never a source of randomness.

Fill in the number

Timing on proof of stake

Exam skills 7.1.3

Calculate common timings that applications rely on.

Log in to try this activity Interactive activities are free with an account.
Worked example

Terminology from older material

A practice question asks: "Who receives the transaction fees of the transactions in a block?" and offers "the miner" and "the block proposer". Which answer is correct today?

On current Ethereum, the block proposer, a validator, receives the priority fees (tips); the base fee is burned. "The miner" was correct before the Merge, when miners received both the block reward and all fees. When a question uses mining terminology, translate it to the proof-of-stake equivalent, and note that before the London upgrade (August 2021) there was no base fee to burn.

Worked example

How long should an exchange wait?

A cryptocurrency exchange credits customer deposits as soon as they appear in a block. A security reviewer says this is risky for large deposits. What should the exchange do?

A block that is included but not finalised can, rarely, be removed by a chain reorganisation, which would undo the deposit after the exchange had credited it. For large amounts, the exchange should wait for finality, about 13 minutes, which JSON-RPC exposes through the "finalized" block tag (for example eth_getBlockByNumber("finalized", false)). Small deposits can be credited sooner if the exchange accepts the small risk.

Check yourself

How long is a slot, how many slots are in an epoch, and roughly how long does finality take?

Show answer

A slot is 12 seconds, an epoch is 32 slots (6.4 minutes), and finality normally arrives after about two epochs, roughly 13 minutes, once two thirds of staked ether has attested to the checkpoints.

Exam Tips

Remember for the exam

  • The Merge (15 September 2022) replaced proof of work and miners with proof of stake and validators.
  • Slots are 12 seconds, epochs are 32 slots, and validators stake at least 32 ETH.
  • Finality needs two thirds of staked ether and takes about two epochs.
  • Proposers receive priority fees; the base fee is burned.