{"eip":7748,"title":"State conversion to Verkle Tree","description":"Describes a state conversion procedure to migrate key-values from the Merkle Patricia Tree to the Verkle Tree.","authors":["Guillaume Ballet (@gballet)","Ignacio Hagopian (@jsign)","Gajinder Singh (@g11tech)","Ansgar Dietrichs (@adietrichs)","Gottfried Herold (@GottfriedHerold)","Jamie Lokier (@jlokier)","Tanishq Jasoria (@tanishqjasoria)","Parithosh Jayanthi (@parithosh)","Gabriel Rocheleau (@gabrocheleau)","Karim Taam (@matkt)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2024-07-23","requires":[7612],"discussionsTo":"https://ethereum-magicians.org/t/eip-7748-state-conversion-to-verkle-tree/20625","repo":"EIPs","label":"EIP-7748","officialUrl":"https://eips.ethereum.org/EIPS/eip-7748","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7748.md","url":"https://eips.huatuo.xyz/eip-7748/","tldr":{"en":"Draft plan to migrate Ethereum's entire state from the Merkle Patricia Tree to a Verkle tree a fixed number of items per block, so the overlay tree can eventually be removed.","ja":"Ethereum の全ステートを、ブロックごとに一定数のアイテムずつ Merkle Patricia Tree から Verkle ツリーへ移行する計画のドラフト。最終的にオーバーレイツリーを取り除けるようにする。","ko":"이더리움의 전체 상태를 블록마다 정해진 개수의 항목씩 Merkle Patricia Tree에서 Verkle 트리로 옮기는 계획 초안. 결국 오버레이 트리를 제거할 수 있게 한다.","zh":"草案计划：每个区块迁移固定数量的条目，把以太坊的全部状态从 Merkle Patricia Tree 迁移到 Verkle 树，最终得以移除覆盖树（overlay tree）。"},"tags":["core","state","verkle","stateless","migration"],"explainers":{"en":{"lang":"en","tldr":"Draft plan to migrate Ethereum's entire state from the Merkle Patricia Tree to a Verkle tree a fixed number of items per block, so the overlay tree can eventually be removed.","tags":["core","state","verkle","stateless","migration"],"related":[7612,6800,7864,7610],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7748/","markdown":"## What problem does it solve?\n\nMoving Ethereum to a Verkle tree (for smaller witnesses and stateless clients) means every account and storage slot must end up in the new tree. [EIP-7612](/eip-7612/) defines an **overlay tree**: new writes go to the Verkle tree, reads fall back to the old Merkle Patricia Tree (MPT). But if migration only happens when transactions touch data, much of the state would sit in the MPT forever, and clients would have to keep both trees indefinitely.\n\nEIP-7748 actively walks through the whole MPT and copies everything over in bounded steps, so the migration finishes in a predictable time.\n\n## How it works\n\n- From `CONVERSION_START_TIMESTAMP`, every block runs a conversion step **before** executing its transactions.\n- Each step converts up to `CONVERSION_STRIDE` **conversion units**. A unit is either one storage slot, or one account's basic data (nonce, balance, code hash, etc.) plus its code.\n- The client walks accounts in MPT key order. For each account it first converts its storage slots one by one, then its code (chunked and inserted in one go) and account data, then moves to the next account.\n- The client state tracks a cursor (current account and phase) so the walk resumes in the next block.\n- Storage values are only written if the Verkle tree does not already have them, because a transaction may have written a newer value there in an earlier block.\n- Accounts with nonce 0 and no code skip storage conversion; this covers the 28 inaccessible accounts described in [EIP-7610](/eip-7610/).\n- When the walk passes the last account, the conversion is finished and the overlay can be dropped.\n\n## Sample code\n\nSimplified per-block step (pseudocode adapted from the spec):\n\n```python\ndef state_convert(state, stride):\n    n = 0\n    while n \u003c stride and not state.conversion_finished:\n        acct = state.conversion_cursor()\n        if acct.nonce == 0 and not acct.code:\n            acct.phase = ACCOUNT_DATA            # skip unreachable storage\n        if acct.phase == STORAGE:\n            slot, value, next_key = storage_trie(acct).next_at(acct.next_key)\n            if slot is not None:\n                write_storage_if_empty(acct.address, slot, value)\n                n += 1\n            if next_key is None:\n                acct.phase = ACCOUNT_DATA\n            else:\n                acct.next_key = next_key\n        else:\n            write_code_chunks(acct.address)       # whole code in one go\n            write_account_data(acct.address)       # nonce, balance, code hash...\n            n += 1\n            state.advance_to_next_account()\n```\n\n## Things to know\n\n- Status is **Draft**. Both `CONVERSION_START_TIMESTAMP` and `CONVERSION_STRIDE` are still `TBD`, and test cases are not yet in the spec.\n- It requires [EIP-7612](/eip-7612/), which is **Stagnant**, as is the Verkle state EIP [EIP-6800](/eip-6800/). Recent stateless work has been exploring a binary tree instead ([EIP-7864](/eip-7864/)); a similar conversion would be needed there.\n- Because code is converted in one step, a single large contract can push a block over the stride by roughly 24 KB / 31 ≈ 793 units. The authors accepted this to keep the algorithm simple.\n- Clients must be able to map hashed MPT keys back to the original addresses and slots (a flat database or a preimage dump) to write Verkle keys.\n"},"ja":{"lang":"ja","tldr":"Ethereum の全ステートを、ブロックごとに一定数のアイテムずつ Merkle Patricia Tree から Verkle ツリーへ移行する計画のドラフト。最終的にオーバーレイツリーを取り除けるようにする。","tags":["core","state","verkle","stateless","migration"],"related":[7612,6800,7864,7610],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7748/","markdown":"## 何を解決するのか\n\nEthereum を Verkle ツリーに移行する（witness を小さくし、ステートレスクライアントを実現するため）には、すべてのアカウントとストレージスロットが新しいツリーに入る必要があります。[EIP-7612](/eip-7612/) は**オーバーレイツリー**を定義しています。新しい書き込みは Verkle ツリーへ行き、読み取りは古い Merkle Patricia Tree（MPT）にフォールバックします。しかし、トランザクションがデータに触れたときにしか移行が起きないなら、ステートの多くは永久に MPT に残り、クライアントは両方のツリーを無期限に保持し続けなければなりません。\n\nEIP-7748 は、MPT 全体を能動的にたどり、上限付きのステップですべてをコピーしていきます。これにより、移行は予測可能な時間で完了します。\n\n## 仕組み\n\n- `CONVERSION_START_TIMESTAMP` 以降、すべてのブロックは、トランザクションを実行する**前**に変換ステップを 1 回実行します。\n- 各ステップは最大 `CONVERSION_STRIDE` 個の**変換ユニット**を変換します。1 ユニットは、ストレージスロット 1 つ、または 1 つのアカウントの基本データ（nonce、残高、コードハッシュなど）とそのコードのどちらかです。\n- クライアントは MPT のキー順にアカウントをたどります。各アカウントについて、まずストレージスロットを 1 つずつ変換し、次にコード（チャンク化して一括で挿入）とアカウントデータを変換してから、次のアカウントへ進みます。\n- クライアントのステートはカーソル（現在のアカウントとフェーズ）を保持しており、次のブロックで走査を再開します。\n- ストレージの値は、Verkle ツリーにまだ存在しない場合にのみ書き込まれます。以前のブロックで、トランザクションがより新しい値をそこに書き込んでいる可能性があるためです。\n- nonce が 0 でコードを持たないアカウントはストレージの変換をスキップします。これは [EIP-7610](/eip-7610/) に記載された 28 個のアクセス不能なアカウントを対象としています。\n- 走査が最後のアカウントを通過すると、変換は完了し、オーバーレイを破棄できます。\n\n## サンプルコード\n\n簡略化したブロックごとのステップ（仕様から改変した擬似コード）:\n\n```python\ndef state_convert(state, stride):\n    n = 0\n    while n \u003c stride and not state.conversion_finished:\n        acct = state.conversion_cursor()\n        if acct.nonce == 0 and not acct.code:\n            acct.phase = ACCOUNT_DATA            # skip unreachable storage\n        if acct.phase == STORAGE:\n            slot, value, next_key = storage_trie(acct).next_at(acct.next_key)\n            if slot is not None:\n                write_storage_if_empty(acct.address, slot, value)\n                n += 1\n            if next_key is None:\n                acct.phase = ACCOUNT_DATA\n            else:\n                acct.next_key = next_key\n        else:\n            write_code_chunks(acct.address)       # whole code in one go\n            write_account_data(acct.address)       # nonce, balance, code hash...\n            n += 1\n            state.advance_to_next_account()\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。`CONVERSION_START_TIMESTAMP` と `CONVERSION_STRIDE` はどちらもまだ `TBD` で、テストケースも仕様にはまだありません。\n- [EIP-7612](/eip-7612/) を必要としますが、これは **Stagnant** です。Verkle ステートの EIP である [EIP-6800](/eip-6800/) も同様です。最近のステートレス関連の取り組みは、代わりにバイナリツリー（[EIP-7864](/eip-7864/)）を探っています。そちらでも同様の変換が必要になるでしょう。\n- コードは 1 ステップで変換されるため、大きなコントラクト 1 つで、ブロックがストライドをおよそ 24 KB / 31 ≈ 793 ユニット超えることがあります。著者はアルゴリズムを単純に保つために、これを許容しました。\n- クライアントは、ハッシュ化された MPT キーを元のアドレスやスロットに対応付けられる必要があります（フラットなデータベースやプリイメージのダンプ）。そうしないと Verkle キーを書き込めません。\n"},"ko":{"lang":"ko","tldr":"이더리움의 전체 상태를 블록마다 정해진 개수의 항목씩 Merkle Patricia Tree에서 Verkle 트리로 옮기는 계획 초안. 결국 오버레이 트리를 제거할 수 있게 한다.","tags":["core","state","verkle","stateless","migration"],"related":[7612,6800,7864,7610],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7748/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움을 Verkle 트리로 옮기려면(더 작은 witness와 스테이트리스 클라이언트를 위해) 모든 계정과 스토리지 슬롯이 결국 새 트리에 들어가야 합니다. [EIP-7612](/eip-7612/)는 **오버레이 트리**를 정의합니다. 새로운 쓰기는 Verkle 트리로 가고, 읽기는 옛 Merkle Patricia Tree(MPT)로 폴백합니다. 그런데 트랜잭션이 데이터를 건드릴 때만 마이그레이션이 일어난다면, 상태의 상당 부분이 MPT에 영원히 남고 클라이언트는 두 트리를 무기한 유지해야 합니다.\n\nEIP-7748은 MPT 전체를 능동적으로 훑으며 한정된 단계로 모든 것을 복사해 옮깁니다. 그래서 마이그레이션이 예측 가능한 시간 안에 끝납니다.\n\n## 어떻게 동작하나요?\n\n- `CONVERSION_START_TIMESTAMP`부터 모든 블록은 트랜잭션을 실행하기 **전에** 변환 단계를 하나 실행합니다.\n- 각 단계는 최대 `CONVERSION_STRIDE`개의 **변환 단위**를 변환합니다. 한 단위는 스토리지 슬롯 하나이거나, 계정 하나의 기본 데이터(nonce, 잔액, 코드 해시 등)와 그 코드입니다.\n- 클라이언트는 MPT 키 순서대로 계정을 훑습니다. 각 계정에 대해 먼저 스토리지 슬롯을 하나씩 변환하고, 그다음 코드(청크로 나눠 한 번에 삽입)와 계정 데이터를 변환한 뒤 다음 계정으로 넘어갑니다.\n- 클라이언트 상태는 커서(현재 계정과 단계)를 추적하여 다음 블록에서 순회를 이어갑니다.\n- 스토리지 값은 Verkle 트리에 아직 없을 때만 씁니다. 이전 블록에서 트랜잭션이 더 최신 값을 이미 거기에 썼을 수 있기 때문입니다.\n- nonce가 0이고 코드가 없는 계정은 스토리지 변환을 건너뜁니다. 이는 [EIP-7610](/eip-7610/)에 설명된 접근 불가능한 계정 28개에 해당합니다.\n- 순회가 마지막 계정을 지나면 변환이 끝나고 오버레이를 버릴 수 있습니다.\n\n## 샘플 코드\n\n단순화한 블록별 단계(스펙을 바탕으로 한 의사 코드):\n\n```python\ndef state_convert(state, stride):\n    n = 0\n    while n \u003c stride and not state.conversion_finished:\n        acct = state.conversion_cursor()\n        if acct.nonce == 0 and not acct.code:\n            acct.phase = ACCOUNT_DATA            # skip unreachable storage\n        if acct.phase == STORAGE:\n            slot, value, next_key = storage_trie(acct).next_at(acct.next_key)\n            if slot is not None:\n                write_storage_if_empty(acct.address, slot, value)\n                n += 1\n            if next_key is None:\n                acct.phase = ACCOUNT_DATA\n            else:\n                acct.next_key = next_key\n        else:\n            write_code_chunks(acct.address)       # whole code in one go\n            write_account_data(acct.address)       # nonce, balance, code hash...\n            n += 1\n            state.advance_to_next_account()\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다. `CONVERSION_START_TIMESTAMP`와 `CONVERSION_STRIDE`는 둘 다 아직 `TBD`이고, 테스트 케이스도 아직 스펙에 없습니다.\n- [EIP-7612](/eip-7612/)가 필요한데, 이것은 **Stagnant** 상태입니다. Verkle 상태 EIP인 [EIP-6800](/eip-6800/)도 마찬가지입니다. 최근 스테이트리스 작업은 대신 바이너리 트리([EIP-7864](/eip-7864/))를 탐색하고 있으며, 그쪽에도 비슷한 변환이 필요할 것입니다.\n- 코드는 한 단계에서 변환되므로, 큰 컨트랙트 하나가 블록을 스트라이드보다 대략 24 KB / 31 ≈ 793 단위만큼 넘게 만들 수 있습니다. 저자들은 알고리즘을 단순하게 유지하려고 이를 받아들였습니다.\n- 클라이언트는 해시된 MPT 키를 원래 주소와 슬롯으로 되돌려 매핑할 수 있어야 합니다(플랫 데이터베이스나 프리이미지 덤프). 그래야 Verkle 키를 쓸 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"草案计划：每个区块迁移固定数量的条目，把以太坊的全部状态从 Merkle Patricia Tree 迁移到 Verkle 树，最终得以移除覆盖树（overlay tree）。","tags":["core","state","verkle","stateless","migration"],"related":[7612,6800,7864,7610],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7748/","markdown":"## 它解决什么问题？\n\n要把以太坊迁移到 Verkle 树（为了更小的 witness 和无状态客户端），每个账户和存储槽最终都必须进入新树。[EIP-7612](/eip-7612/) 定义了一棵**覆盖树**：新的写入进入 Verkle 树，读取则回落到旧的 Merkle Patricia Tree（MPT）。但如果只有在交易触及数据时才发生迁移，大部分状态将永远留在 MPT 中，客户端不得不无限期地同时维护两棵树。\n\nEIP-7748 主动遍历整棵 MPT，以有界的步长把所有内容复制过去，因此迁移能在可预测的时间内完成。\n\n## 它如何运作\n\n- 从 `CONVERSION_START_TIMESTAMP` 起，每个区块在执行其交易**之前**先运行一个转换步骤。\n- 每个步骤最多转换 `CONVERSION_STRIDE` 个**转换单元**。一个单元是一个存储槽，或者一个账户的基本数据（nonce、余额、代码哈希等）加上它的代码。\n- 客户端按 MPT 键的顺序遍历账户。对每个账户，先逐个转换它的存储槽，然后转换它的代码（分块并一次性插入）和账户数据，再转到下一个账户。\n- 客户端状态记录一个游标（当前账户和阶段），以便在下一个区块继续遍历。\n- 只有当 Verkle 树中还没有存储值时才会写入，因为某笔交易可能在之前的区块中已经向那里写入了更新的值。\n- nonce 为 0 且没有代码的账户会跳过存储转换；这涵盖了 [EIP-7610](/eip-7610/) 中描述的 28 个不可访问账户。\n- 当遍历越过最后一个账户时，转换完成，覆盖树即可丢弃。\n\n## 示例代码\n\n简化的每区块步骤（改编自规范的伪代码）：\n\n```python\ndef state_convert(state, stride):\n    n = 0\n    while n \u003c stride and not state.conversion_finished:\n        acct = state.conversion_cursor()\n        if acct.nonce == 0 and not acct.code:\n            acct.phase = ACCOUNT_DATA            # skip unreachable storage\n        if acct.phase == STORAGE:\n            slot, value, next_key = storage_trie(acct).next_at(acct.next_key)\n            if slot is not None:\n                write_storage_if_empty(acct.address, slot, value)\n                n += 1\n            if next_key is None:\n                acct.phase = ACCOUNT_DATA\n            else:\n                acct.next_key = next_key\n        else:\n            write_code_chunks(acct.address)       # whole code in one go\n            write_account_data(acct.address)       # nonce, balance, code hash...\n            n += 1\n            state.advance_to_next_account()\n```\n\n## 需要注意\n\n- 状态为 **Draft**。`CONVERSION_START_TIMESTAMP` 和 `CONVERSION_STRIDE` 仍都是 `TBD`，规范中也还没有测试用例。\n- 它依赖 [EIP-7612](/eip-7612/)，而后者处于 **Stagnant** 状态，Verkle 状态 EIP [EIP-6800](/eip-6800/) 也是如此。近期的无状态工作转而探索二叉树（[EIP-7864](/eip-7864/)）；那边也需要类似的转换。\n- 由于代码在一个步骤中转换，单个大型合约可能让一个区块超出步长约 24 KB / 31 ≈ 793 个单元。作者为了保持算法简单，接受了这一点。\n- 客户端必须能把哈希后的 MPT 键映射回原始地址和存储槽（扁平数据库或原像转储），才能写入 Verkle 键。\n"}}}
