EIP-8347 · Draft · Core · 2026-07-23
EIP-8347: Offline State Migration to the PBT
A plan to move Ethereum's state from the Merkle Patricia Trie to the Partitioned Binary Tree by converting it off-chain into a verifiable snapshot, catching up with block access lists, and switching the state root at a single fork.
What problem does it solve?
EIP-8297 proposes replacing Ethereum's hexary Merkle Patricia Trie (MPT) with a Partitioned Binary Tree (PBT), which is friendlier to stateless clients and zk provers. The hard part is moving hundreds of gigabytes of live mainnet state to the new commitment without splitting the chain.
One family of proposals (EIP-7748 and similar) converts state online: a few accounts per block, inside consensus, with an overlay tree in between. EIP-8347 takes the other path: convert offline, outside consensus, then switch everything at once. The benefits it claims:
- The fork changes only how
stateRootis computed. No conversion cursor lives in state and no MPT walk order becomes consensus-critical. - The state root always commits to the whole state (MPT before, PBT after), so no hybrid proofs are needed.
- zkEVM provers never have to prove a conversion step.
The costs: nodes hold both trees for a while (roughly double state storage), apply every block's writes to both, and consensus cannot see conversion progress directly.
How it works
- Conversion (off-chain). A finalized
ANCHOR_BLOCKis picked. Producers build a preimage file (raw addresses and slot keys behind the MPT's hashed paths) and a byte-canonical PBT snapshot containing only leaves. Both are pure functions of the anchor state, so independent producers must emit identical bytes. - Distribution and dual-check. Anyone may distribute the artifacts (P2P, era-style files, CDNs, torrents). Every node verifies them twice: rebuild the PBT and match the claimed root, and re-hash the same leaves under the MPT schema and match the anchor block's header
stateRoot. The second check ties the snapshot to consensus, so the source need not be trusted. - Catch-up via BAL-replay. The node applies each later block's writes from its EIP-7928 block access list straight to the PBT, without re-executing. Late joiners use re-anchored snapshots, roughly weekly (
REANCHOR_CADENCE = 50400blocks). - Shadow commitment. Attesters should publish signed PBT roots of each block, so the network can see agreement before the switch. This is for observability only.
- Swap. At
PBT_ACTIVATION_FORKthe header'sstateRootstarts holding the PBT root. No header field is added or retyped, and the beacon chain treats the root as opaque bytes.
Sample code
Record layout of the preimage file (byte-canonical, sorted by hashed key):
record = address[20] | slotCount[4, big-endian] | slotKey[32] * slotCount
- records sorted ascending by keccak256(address)
- slot keys within a record sorted ascending by keccak256(slotKey)
Snapshot layout and the dual-check, as pseudocode:
# snapshot = record* | 0x07 | pbtRoot[32]
# tags: 0x00-0x02 account header, 0x03 code group, 0x04-0x06 storage
def verify_snapshot(snapshot, preimages, anchor_header):
leaves, claimed_root = parse_snapshot(snapshot)
assert build_pbt(leaves).root == claimed_root # internal consistency
assert mpt_root_from(leaves, preimages) == anchor_header.state_root # consensus anchoring
Things to know
- Status: Draft.
ANCHOR_BLOCKis TBD and the activation fork is not scheduled; that is left to a future hard-fork meta EIP. - It depends on the PBT design in EIP-8297 (itself a Draft), on BALs from EIP-7928, and on empty accounts being gone (EIP-7523), so empty accounts are excluded from the snapshot.
- Recovering all key preimages is the expensive part, because Keccak cannot be inverted. They come from clients that retained them, from BALs, or from replaying the chain.
- Expect more disk and write load during the transition window, until the activation block is finalized.
- Reorgs must be handled on the PBT too: nodes should keep the last finalized PBT as a base and treat newer blocks as discardable layers.