EIPs Explained

EIP-6465 · Draft · Core · 2023-02-08

EIP-6465: SSZ withdrawals root

Proposes switching the execution block header's withdrawals_root from a Merkle Patricia Trie root to an SSZ hash_tree_root, so the execution and consensus layers commit to withdrawals the same way.

What problem does it solve?

Validator withdrawals (EIP-4895) are pushed from the consensus layer into each execution block. Both layers store a withdrawals_root, but they mean different things: the execution block header holds a Merkle Patricia Trie (MPT) root of RLP-encoded withdrawals, while the consensus ExecutionPayloadHeader holds an SSZ root.

Same name, two different hashes. EIP-6465 makes the execution header use the SSZ root as well. That removes one more place where clients need MPT, and makes withdrawals_root mean one thing everywhere.

How it works

  • The consensus Withdrawal container is migrated to an EIP-7495 ProgressiveContainer with the same four fields: index, validator_index, address (20 bytes) and amount (in Gwei).
  • The block's withdrawals become a ProgressiveList[Withdrawal] (progressive lists come from EIP-7916).
  • The execution header's withdrawals_root is set to that list's SSZ hash_tree_root() instead of an MPT root.
  • The consensus ExecutionPayload.withdrawals uses the same progressive list type, and the state transition still caps withdrawals at MAX_WITHDRAWALS_PER_PAYLOAD.

It is part of a family of "SSZ everywhere" proposals alongside EIP-6404 (SSZ transactions root).

Sample code

The new definitions and root computation, in the spec's Python style:

class Withdrawal(ProgressiveContainer(active_fields=[1, 1, 1, 1])):
    index: WithdrawalIndex          # uint64
    validator_index: ValidatorIndex # uint64
    address: ExecutionAddress       # Bytes20
    amount: Gwei                    # uint64

withdrawals = ProgressiveList[Withdrawal](
    withdrawal_0, withdrawal_1, withdrawal_2, ...)

# Before: MPT root over RLP-encoded withdrawals
# After:
block_header.withdrawals_root = withdrawals.hash_tree_root()

Things to know

  • Status is Draft. It is a Core change that needs a hard fork and is not live on mainnet.
  • It was originally considered for Shanghai but was postponed so withdrawals could ship sooner.
  • Anything that verifies withdrawals against the header's MPT withdrawals_root (light clients, provers, indexers) would need to switch to SSZ proofs.
  • RLP and SSZ encodings of withdrawals can collide. Use only one format per channel, and check the block's fork to know which applies.

#ssz #withdrawals #core #consensus #block-header

Details

Authors
Etan Kissling (@etan-status), Mikhail Kalinin (@mkalinin)
Status
Draft
Type
Standards Track / Core
Created
2023-02-08
Requires
Required by

Machine-readable: Markdown · JSON