---
eip: 8297
label: EIP-8297
title: Partitioned Binary Tree
status: Draft
type: Standards Track
category: Core
created: 2026-06-11
official: https://eips.ethereum.org/EIPS/eip-8297
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8297.md
canonical: https://eips.huatuo.xyz/eip-8297/
lang: en
tldr: "Proposes replacing Ethereum's Merkle Patricia tries with a single binary tree divided into zones for account headers, deduplicated code and storage, so state proofs become much smaller and easier to prove with validity proofs."
tags: [state, binary-tree, statelessness, zk, core]
---

# EIP-8297: Partitioned Binary Tree

> Switch Ethereum state tree to a partitioned binary tree

**TL;DR:** Proposes replacing Ethereum's Merkle Patricia tries with a single binary tree divided into zones for account headers, deduplicated code and storage, so state proofs become much smaller and easier to prove with validity proofs.

## What problem does it solve?

Ethereum's state is stored in hexary Merkle Patricia tries (MPT): one account trie, plus a separate storage trie per contract. That design is hard to use with validity (SNARK) proofs. It uses RLP and Keccak, it is a "tree of trees", and its Merkle proofs are large. The spec estimates that a branch at depth 12 of the account trie is about 5.7 KB. Proving a single byte of contract code also means revealing the whole bytecode, up to 64 KiB.

EIP-8297, from Vitalik Buterin and others, specifies a **partitioned binary tree**. A binary tree gives the smallest Merkle branches. Putting everything in one tree with fixed "zones" gives clear boundaries for future features like state expiry. It is a successor design to the unified binary tree in [EIP-7864](/eip-7864/).

## How it works

- **One tree, variable-length keys, 32-byte values.** Keys must be prefix-free. There are only two node types: leaves, which commit their full key, and branches, which carry a compressed bit prefix (no separate extension nodes).
- **Zones**, given by the first key byte:

  | Zone | Contents |
  | --- | --- |
  | `0x00` | Account headers |
  | `0x01` | Code chunks, addressed by code hash |
  | `0x02`–`0xFE` | Reserved |
  | `0xFF` | Storage |

- **Account header:** a single leaf packs version, code size, nonce and balance. The same stem also holds the code hash (or an [EIP-7702](/eip-7702/) delegation), plus storage slots 0–63, so common reads need few proof openings.
- **Code** is split into 31-byte chunks, each prefixed with a byte counting leading PUSHDATA. Chunks are keyed by `code_hash`, so contracts with identical bytecode share them.
- **Storage** slots 64 and up live in the storage zone under `key_hash(address)`, in groups of 256 adjacent slots.
- Writing 32 zero bytes deletes a key, so zero and absent are the same state, as in the MPT.
- The hash function is **not final**. The reference implementation uses BLAKE3; Keccak and Poseidon2 are also candidates.

Converting existing state is covered separately in [EIP-8347](/eip-8347/), which converts offline and then catches up using block access lists ([EIP-7928](/eip-7928/)).

## Sample code

Key derivation, condensed from the spec:

```python
ACCOUNT_ZONE, CODE_ZONE, STORAGE_ZONE = 0x00, 0x01, 0xFF
HEADER_STORAGE_OFFSET, HEADER_STORAGE_SLOTS, WIDTH = 64, 64, 256

def get_tree_key(zone, tree_position, sub_index):
    return bytes([zone]) + tree_position + bytes([sub_index])

def header_key(addr32, sub_index):                       # 34 bytes
    return get_tree_key(ACCOUNT_ZONE, key_hash(addr32), sub_index)

def code_chunk_key(code_hash, chunk_id):                  # 34 bytes
    idx = (chunk_id // WIDTH).to_bytes(32, "big")
    return get_tree_key(CODE_ZONE, key_hash(code_hash + idx), chunk_id % WIDTH)

def storage_key(addr32, slot):
    if slot < HEADER_STORAGE_SLOTS:                       # hot slots in header
        return header_key(addr32, HEADER_STORAGE_OFFSET + slot)
    idx = (slot // WIDTH).to_bytes(32, "big")
    pos = key_hash(addr32) + key_hash(addr32 + idx)       # 66-byte key
    return get_tree_key(STORAGE_ZONE, pos, slot % WIDTH)
```

## Things to know

- **Status: Draft.** The hash function, and therefore every test-vector digest, is still open. No fork is scheduled.
- Invisible to the EVM: `SLOAD`/`SSTORE`, `EXTCODEHASH` (still Keccak) and the gas schedule are unchanged.
- It breaks contracts that verify MPT state proofs on-chain; they will need the new proof format after the switch.
- Being hash-based only, the tree avoids the elliptic-curve commitments of the earlier Verkle proposal ([EIP-6800](/eip-6800/), now Stagnant), which the authors cite for post-quantum security.
- Deleting an account removes its header and storage, but its code chunks are removed only if no other account has the same code hash.


---

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