EIPs Explained

EIP-3675 · Final · Core · 2021-07-22

EIP-3675: Upgrade consensus to Proof-of-Stake

The Merge: switched Ethereum Mainnet from Proof-of-Work to the beacon chain's Proof-of-Stake by changing block validity, rewards and fork choice while keeping the block format intact.

What problem does it solve?

Ethereum launched on Proof-of-Work (PoW): miners burned electricity to seal blocks, and the "heaviest chain" won. Meanwhile, the Proof-of-Stake beacon chain (EIP-2982) had been running on its own since December 2020 without safety or liveness failures, but it did not yet secure any user transactions.

EIP-3675 is the minimal set of execution-layer changes needed to hot-swap the consensus engine of a live network: stop accepting PoW, let the beacon chain decide which blocks are canonical, and keep everything else (accounts, contracts, transaction format, block format) working as before. It shipped as the Paris upgrade in September 2022, widely known as "The Merge".

How it works

Trigger. The switch is not tied to a block number but to terminal total difficulty (TTD). A terminal PoW block is the first block whose accumulated difficulty reaches TERMINAL_TOTAL_DIFFICULTY (Mainnet: 58750000000000000000000). A block-number trigger would let an attacker with minority hash power build a short fork that reaches the height first. Clients refuse to import any PoW block that descends from a terminal block.

Block fields become constants. From the first PoS block (TRANSITION_BLOCK), PoW-only header fields are fixed, so the RLP format is unchanged and Merkle-proof verifiers keep working:

Field Value after the Merge
difficulty 0
nonce 0x0000000000000000
ommers / ommersHash [] / Keccak256(RLP([]))
mixHash zero in this EIP; later repurposed as prevRandao by EIP-4399
extraData at most 32 bytes

No more PoW rewards. Block and ommer (uncle) rewards are removed from the execution layer. Transaction fees still go to beneficiary; issuance now happens on the beacon chain.

New fork choice. The PoW heaviest-chain rule is replaced: the execution client simply follows POS_FORKCHOICE_UPDATED events from the consensus layer, which name the head and the latest finalized block. No "optimistic" head updates are allowed.

Networking. NewBlock and NewBlockHashes devp2p messages are dropped once finality starts; blocks are gossiped on the beacon chain network instead. The EIP-2124 fork ID uses a configured FORK_NEXT_VALUE because the transition block cannot be known in advance.

Sample code

Post-Merge block headers show the constant fields. Checking them with ethers v6:

import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const block = await provider.getBlock("latest");

console.log(block!.difficulty);   // 0n on every PoS block
console.log(block!.nonce);        // "0x0000000000000000"
console.log(block!.prevRandao);   // beacon chain randomness (EIP-4399), not a PoW mix hash

Simplified validity check, following the spec's test cases:

EMPTY_OMMERS_HASH = keccak256(rlp_encode([]))
MAX_EXTRA_DATA_BYTES = 32

def validate_pos_header(h):
    assert h.ommers_hash == EMPTY_OMMERS_HASH
    assert h.difficulty == 0
    assert h.nonce == b"\x00" * 8
    assert len(h.extra_data) <= MAX_EXTRA_DATA_BYTES

Things to know

  • After this EIP, an Ethereum node is two programs: an execution client and a consensus (beacon) client, talking over the Engine API. That split comes from this design.
  • In EIP-3675 itself DIFFICULTY returns 0; EIP-4399 shipped alongside it and turned the opcode into PREVRANDAO.
  • BLOCKHASH-based pseudo-randomness got weaker, because PoS block hashes are easier for proposers to influence than PoW seals.
  • Syncing no longer requires validating history from genesis; nodes start from weak-subjectivity checkpoints.
  • Withdrawing staked ETH was not part of the Merge; it arrived later with EIP-4895.

#consensus #proof-of-stake #merge #core #paris

Details

Authors
Mikhail Kalinin (@mkalinin), Danny Ryan (@djrtwo), Vitalik Buterin (@vbuterin)
Status
Final
Type
Standards Track / Core
Created
2021-07-22
Requires
Required by

Machine-readable: Markdown · JSON