---
eip: 8347
label: EIP-8347
title: Offline State Migration to the PBT
status: Draft
type: Standards Track
category: Core
created: 2026-07-23
requires: 7523, 7928, 8159, 8297
official: https://eips.ethereum.org/EIPS/eip-8347
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8347.md
canonical: https://eips.huatuo.xyz/eip-8347/
lang: en
tldr: "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."
tags: [state, binary-tree, migration, statelessness, core]
---

# EIP-8347: Offline State Migration to the PBT

> Convert state to the PBT off the consensus-critical path, distribute a verifiable snapshot, and swap the commitment at a single fork

**TL;DR:** 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](/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](/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 `stateRoot` is 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

1. **Conversion (off-chain).** A finalized `ANCHOR_BLOCK` is 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.
2. **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.
3. **Catch-up via BAL-replay.** The node applies each later block's writes from its [EIP-7928](/eip-7928/) block access list straight to the PBT, without re-executing. Late joiners use re-anchored snapshots, roughly weekly (`REANCHOR_CADENCE = 50400` blocks).
4. **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.
5. **Swap.** At `PBT_ACTIVATION_FORK` the header's `stateRoot` starts 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):

```text
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:

```python
# 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_BLOCK` is 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](/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.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8347
