{"eip":7736,"title":"Leaf-level state expiry in verkle trees","description":"Simple state expiry scheme in which only \"extension-and-suffix trees\" are expired.","authors":["Guillaume Ballet (@gballet)","Wei Han Ng (@weiihann)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2024-07-05","requires":[6800],"discussionsTo":"https://ethereum-magicians.org/t/eip-7736-leaf-level-state-expiry-in-verkle-trees/20474","repo":"EIPs","label":"EIP-7736","officialUrl":"https://eips.ethereum.org/EIPS/eip-7736","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7736.md","url":"https://eips.huatuo.xyz/eip-7736/","tldr":{"en":"A simple state-expiry design for Verkle trees: leaf groups not written to for roughly 6–12 months are deleted, and anyone can bring them back with a special resurrection transaction.","ja":"Verkle ツリー向けのシンプルなステートエクスパイア設計。約 6〜12 か月書き込みのないリーフグループは削除され、特別な復活トランザクションで誰でも元に戻せる。","ko":"Verkle 트리를 위한 단순한 상태 만료 설계. 약 6~12개월 동안 쓰기가 없던 리프 그룹은 삭제되며, 누구나 특별한 부활 트랜잭션으로 되살릴 수 있다.","zh":"为 Verkle 树设计的一种简单状态过期方案：约 6 至 12 个月没有被写入的叶子组会被删除，任何人都可以通过一种特殊的复活交易将其恢复。"},"tags":["state-expiry","verkle","statelessness","core"],"explainers":{"en":{"lang":"en","tldr":"A simple state-expiry design for Verkle trees: leaf groups not written to for roughly 6–12 months are deleted, and anyone can bring them back with a special resurrection transaction.","tags":["state-expiry","verkle","statelessness","core"],"related":[6800,4762,7748,7864,4444],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7736/","markdown":"## What problem does it solve?\n\nEthereum's state only grows. Every account and storage slot ever written must be kept by every full node forever, even if nobody has touched it in years. \"State expiry\" proposals have tried to fix this for a long time, but earlier designs needed big structural changes such as address space extension or one tree per time period, and they kept stalling on complexity.\n\nEIP-7736 offers a deliberately modest version on top of the Verkle tree from [EIP-6800](/eip-6800/): expire only the bottom of the tree (the leaf values), keep the tree's shape, and make resurrection cheap and simple.\n\n## How it works\n\nIn a Verkle tree, values are grouped under a 31-byte *stem*: one extension node with up to 256 values (an \"extension-and-suffix tree\"). This EIP:\n\n- **Adds a `last_epoch` field** to each extension node's commitment. An epoch is `EPOCH_LENGTH` = 15,778,800 seconds (about six months).\n- **Updates it on writes only.** Every write under a stem sets `last_epoch = current_epoch`. Reads do not, because updating the counter on a read would effectively turn reads into writes.\n- **Blocks access to expired data.** A read or write is allowed only if `current_epoch \u003c last_epoch + NUM_ACTIVE_EPOCHS` (2). Otherwise it reverts.\n- **Expires at epoch boundaries.** When a block starts a new epoch, nodes from the epoch that just fell out of range can be deleted. Clients keep only a small *keepsake*: the stem and the node's commitment, so new siblings can still be inserted and old data can be checked later. When and how to delete is left to clients.\n- **Resurrection transaction.** A new transaction type carries `stem`, `last_epoch` and the original `values`. The node recomputes the commitment, checks it against the keepsake, and if it matches, restores the data with `last_epoch` set to the current epoch. Gas is charged using the witness and edit costs from [EIP-4762](/eip-4762/).\n\n## Sample code\n\nThe access rule and epoch tick (pseudocode, Python syntax, following the spec):\n\n```python\nEPOCH_LENGTH = 15_778_800      # ~6 months, in seconds\nNUM_ACTIVE_EPOCHS = 2\n\ndef check_epoch_end(block):\n    global current_epoch\n    if block.timestamp \u003e= FORK_TIME + current_epoch * EPOCH_LENGTH:\n        current_epoch += 1\n        schedule_expiry(current_epoch - NUM_ACTIVE_EPOCHS)   # client-defined\n\ndef access(stem, is_write):\n    node = tree.extension(stem)\n    if not current_epoch \u003c node.last_epoch + NUM_ACTIVE_EPOCHS:\n        raise Revert(\"expired: resurrect first\")\n    if is_write:\n        node.last_epoch = current_epoch\n\ndef resurrect(stem, last_epoch, values):\n    keepsake = tree.get_keepsake(stem)\n    assert keepsake.C == extension_and_suffix_tree(stem, values, last_epoch)\n    tree.resurrect_subtree(stem, values, current_epoch)\n```\n\n## Things to know\n\n- Status is **Stagnant**, and it depends on Verkle trees ([EIP-6800](/eip-6800/)), which are also Stagnant. Research has since shifted toward a binary tree ([EIP-7864](/eip-7864/)).\n- Because only writes refresh the epoch, data that is read often but never written (for example, contract code or a config value) can still expire and would need resurrecting.\n- Fork time, the resurrection transaction type number, test cases and a reference implementation are all still TBD in the spec, and its security section says \"needs discussion\".\n- It is backward compatible with EIP-6800 because the new commitment field defaults to 0, which equals the initial epoch.\n- Resurrection restores a whole stem group at once, which is simpler but costs more than restoring a single value.\n"},"ja":{"lang":"ja","tldr":"Verkle ツリー向けのシンプルなステートエクスパイア設計。約 6〜12 か月書き込みのないリーフグループは削除され、特別な復活トランザクションで誰でも元に戻せる。","tags":["state-expiry","verkle","statelessness","core"],"related":[6800,4762,7748,7864,4444],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7736/","markdown":"## 何を解決するのか\n\nEthereum のステートは増える一方です。書き込まれたすべてのアカウントとストレージスロットは、何年も誰も触れていなくても、すべてのフルノードが永遠に保持しなければなりません。「ステートエクスパイア」の提案は長い間この問題の解決を試みてきましたが、以前の設計はアドレス空間の拡張や期間ごとに 1 本のツリーといった大きな構造変更を必要とし、複雑さのために何度も頓挫しました。\n\nEIP-7736 は、[EIP-6800](/eip-6800/) の Verkle ツリーの上に載る、意図的に控えめな案を示します。ツリーの最下部（リーフの値）だけを失効させ、ツリーの形は保ち、復活を安価で単純にします。\n\n## 仕組み\n\nVerkle ツリーでは、値は 31 バイトの*ステム*の下にまとめられます。1 つの拡張ノードに最大 256 個の値が入ります（「拡張とサフィックスのツリー」）。この EIP は次のことを行います。\n\n- 各拡張ノードのコミットメントに **`last_epoch` フィールドを追加**します。エポックは `EPOCH_LENGTH` = 15,778,800 秒（約 6 か月）です。\n- **書き込み時にのみ更新**します。ステムの下への書き込みごとに `last_epoch = current_epoch` を設定します。読み取りでは更新しません。読み取りでカウンターを更新すると、読み取りが実質的に書き込みになってしまうためです。\n- **失効したデータへのアクセスをブロック**します。読み取りまたは書き込みは `current_epoch \u003c last_epoch + NUM_ACTIVE_EPOCHS`（2）の場合にのみ許可されます。それ以外は revert します。\n- **エポックの境界で失効**します。ブロックが新しいエポックを開始すると、範囲から外れたばかりのエポックのノードを削除できます。クライアントは小さな*形見（keepsake）*、つまりステムとノードのコミットメントだけを保持します。これにより新しい兄弟ノードを挿入でき、古いデータを後で検証できます。いつ、どのように削除するかはクライアントに委ねられます。\n- **復活トランザクション。** 新しいトランザクションタイプが `stem`、`last_epoch`、元の `values` を運びます。ノードはコミットメントを再計算して形見と照合し、一致すれば `last_epoch` を現在のエポックに設定してデータを復元します。gas は [EIP-4762](/eip-4762/) の witness コストと編集コストを使って課金されます。\n\n## サンプルコード\n\n仕様に沿ったアクセスルールとエポックの更新（擬似コード、Python 構文）:\n\n```python\nEPOCH_LENGTH = 15_778_800      # ~6 months, in seconds\nNUM_ACTIVE_EPOCHS = 2\n\ndef check_epoch_end(block):\n    global current_epoch\n    if block.timestamp \u003e= FORK_TIME + current_epoch * EPOCH_LENGTH:\n        current_epoch += 1\n        schedule_expiry(current_epoch - NUM_ACTIVE_EPOCHS)   # client-defined\n\ndef access(stem, is_write):\n    node = tree.extension(stem)\n    if not current_epoch \u003c node.last_epoch + NUM_ACTIVE_EPOCHS:\n        raise Revert(\"expired: resurrect first\")\n    if is_write:\n        node.last_epoch = current_epoch\n\ndef resurrect(stem, last_epoch, values):\n    keepsake = tree.get_keepsake(stem)\n    assert keepsake.C == extension_and_suffix_tree(stem, values, last_epoch)\n    tree.resurrect_subtree(stem, values, current_epoch)\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、同じく Stagnant の Verkle ツリー（[EIP-6800](/eip-6800/)）に依存しています。研究はその後、バイナリツリー（[EIP-7864](/eip-7864/)）へ移っています。\n- エポックを更新するのは書き込みだけなので、頻繁に読まれるが書き込まれないデータ（たとえばコントラクトコードや設定値）でも失効する可能性があり、復活が必要になります。\n- フォーク時刻、復活トランザクションのタイプ番号、テストケース、リファレンス実装は、仕様ではいずれもまだ TBD で、セキュリティの節には「議論が必要」と書かれています。\n- 新しいコミットメントフィールドのデフォルトが 0 で、初期エポックと等しいため、EIP-6800 との後方互換性があります。\n- 復活はステムグループ全体を一度に復元します。これは単純ですが、1 つの値だけを復元するよりコストがかかります。\n"},"ko":{"lang":"ko","tldr":"Verkle 트리를 위한 단순한 상태 만료 설계. 약 6~12개월 동안 쓰기가 없던 리프 그룹은 삭제되며, 누구나 특별한 부활 트랜잭션으로 되살릴 수 있다.","tags":["state-expiry","verkle","statelessness","core"],"related":[6800,4762,7748,7864,4444],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7736/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움의 상태는 늘어나기만 합니다. 한 번이라도 기록된 모든 계정과 스토리지 슬롯은 몇 년 동안 아무도 건드리지 않았더라도 모든 풀 노드가 영원히 보관해야 합니다. \"상태 만료\" 제안들은 오랫동안 이 문제를 풀려고 했지만, 이전 설계는 주소 공간 확장이나 기간별 트리 하나씩 같은 큰 구조 변경이 필요했고 복잡성 때문에 계속 정체되었습니다.\n\nEIP-7736은 [EIP-6800](/eip-6800/)의 Verkle 트리 위에서 일부러 소박하게 만든 버전을 제시합니다. 트리의 맨 아래(리프 값)만 만료시키고, 트리의 모양은 유지하며, 부활을 저렴하고 단순하게 만듭니다.\n\n## 어떻게 동작하나요?\n\nVerkle 트리에서 값은 31바이트 *스템(stem)* 아래에 묶입니다. 확장 노드 하나에 최대 256개의 값이 들어갑니다(\"확장-접미사 트리\"). 이 EIP는 다음을 합니다.\n\n- 각 확장 노드의 커밋먼트에 **`last_epoch` 필드를 추가**합니다. 에포크는 `EPOCH_LENGTH` = 15,778,800초(약 6개월)입니다.\n- **쓰기 때만 갱신**합니다. 스템 아래에 쓰기가 일어날 때마다 `last_epoch = current_epoch`로 설정합니다. 읽기는 갱신하지 않습니다. 읽기 때 카운터를 갱신하면 사실상 읽기가 쓰기로 바뀌기 때문입니다.\n- **만료된 데이터에 대한 접근을 막습니다.** 읽기나 쓰기는 `current_epoch \u003c last_epoch + NUM_ACTIVE_EPOCHS`(2)일 때만 허용됩니다. 그렇지 않으면 revert됩니다.\n- **에포크 경계에서 만료됩니다.** 블록이 새 에포크를 시작하면 방금 범위를 벗어난 에포크의 노드를 삭제할 수 있습니다. 클라이언트는 작은 *기념품(keepsake)*, 즉 스템과 노드의 커밋먼트만 보관합니다. 덕분에 새 형제 노드를 삽입할 수 있고 오래된 데이터를 나중에 검증할 수 있습니다. 언제 어떻게 삭제할지는 클라이언트에 맡겨져 있습니다.\n- **부활 트랜잭션.** 새로운 트랜잭션 타입이 `stem`, `last_epoch`, 원래의 `values`를 담습니다. 노드는 커밋먼트를 다시 계산해 기념품과 대조하고, 일치하면 `last_epoch`를 현재 에포크로 설정해 데이터를 복원합니다. 가스는 [EIP-4762](/eip-4762/)의 witness 비용과 수정 비용으로 부과됩니다.\n\n## 샘플 코드\n\n스펙을 따른 접근 규칙과 에포크 틱(의사 코드, Python 문법):\n\n```python\nEPOCH_LENGTH = 15_778_800      # ~6 months, in seconds\nNUM_ACTIVE_EPOCHS = 2\n\ndef check_epoch_end(block):\n    global current_epoch\n    if block.timestamp \u003e= FORK_TIME + current_epoch * EPOCH_LENGTH:\n        current_epoch += 1\n        schedule_expiry(current_epoch - NUM_ACTIVE_EPOCHS)   # client-defined\n\ndef access(stem, is_write):\n    node = tree.extension(stem)\n    if not current_epoch \u003c node.last_epoch + NUM_ACTIVE_EPOCHS:\n        raise Revert(\"expired: resurrect first\")\n    if is_write:\n        node.last_epoch = current_epoch\n\ndef resurrect(stem, last_epoch, values):\n    keepsake = tree.get_keepsake(stem)\n    assert keepsake.C == extension_and_suffix_tree(stem, values, last_epoch)\n    tree.resurrect_subtree(stem, values, current_epoch)\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**이며, 역시 Stagnant인 Verkle 트리([EIP-6800](/eip-6800/))에 의존합니다. 이후 연구는 바이너리 트리([EIP-7864](/eip-7864/))로 옮겨갔습니다.\n- 에포크를 갱신하는 것은 쓰기뿐이므로, 자주 읽히지만 쓰이지 않는 데이터(예: 컨트랙트 코드나 설정 값)도 만료될 수 있으며 부활시켜야 합니다.\n- 포크 시각, 부활 트랜잭션 타입 번호, 테스트 케이스, 참조 구현은 스펙에서 모두 아직 TBD이며, 보안 절에는 \"논의가 필요함\"이라고 적혀 있습니다.\n- 새 커밋먼트 필드의 기본값이 0이고 이는 초기 에포크와 같으므로 EIP-6800과 하위 호환됩니다.\n- 부활은 스템 그룹 전체를 한꺼번에 복원합니다. 더 단순하지만 값 하나만 복원하는 것보다 비용이 더 듭니다.\n"},"zh":{"lang":"zh","tldr":"为 Verkle 树设计的一种简单状态过期方案：约 6 至 12 个月没有被写入的叶子组会被删除，任何人都可以通过一种特殊的复活交易将其恢复。","tags":["state-expiry","verkle","statelessness","core"],"related":[6800,4762,7748,7864,4444],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7736/","markdown":"## 它解决什么问题？\n\n以太坊的状态只增不减。每个被写入过的账户和存储槽，即使多年无人触碰，也必须由每个全节点永久保存。\"状态过期\"方案长期以来一直试图解决这个问题，但早期设计需要地址空间扩展、每个时间段一棵树等大型结构性改动，并且一再因复杂性而停滞。\n\nEIP-7736 在 [EIP-6800](/eip-6800/) 的 Verkle 树之上提出了一个刻意保持克制的版本：只让树的底部（叶子的值）过期，保持树的形状不变，并让复活变得廉价而简单。\n\n## 它如何运作\n\n在 Verkle 树中，值被归入一个 31 字节的*茎（stem）*之下：一个扩展节点最多容纳 256 个值（一棵\"扩展与后缀树\"）。本 EIP：\n\n- 在每个扩展节点的承诺中**增加一个 `last_epoch` 字段**。一个纪元（epoch）为 `EPOCH_LENGTH` = 15,778,800 秒（约六个月）。\n- **仅在写入时更新它。** 对某个 stem 下的每次写入都会设置 `last_epoch = current_epoch`。读取不会更新，因为在读取时更新计数器，实际上等于把读取变成了写入。\n- **阻止访问已过期的数据。** 只有当 `current_epoch \u003c last_epoch + NUM_ACTIVE_EPOCHS`（2）时，才允许读取或写入。否则将 revert。\n- **在纪元边界过期。** 当区块开始一个新纪元时，刚刚超出范围的那个纪元的节点即可被删除。客户端只保留一小份*纪念物（keepsake）*：stem 和节点的承诺，这样仍然可以插入新的兄弟节点，也可以之后校验旧数据。何时、如何删除由客户端决定。\n- **复活交易。** 一种新的交易类型携带 `stem`、`last_epoch` 和原始的 `values`。节点重新计算承诺，与纪念物核对，如果匹配，就恢复数据，并将 `last_epoch` 设为当前纪元。gas 按 [EIP-4762](/eip-4762/) 中的 witness 成本和编辑成本收取。\n\n## 示例代码\n\n访问规则与纪元推进（伪代码，Python 语法，依据规范）：\n\n```python\nEPOCH_LENGTH = 15_778_800      # ~6 months, in seconds\nNUM_ACTIVE_EPOCHS = 2\n\ndef check_epoch_end(block):\n    global current_epoch\n    if block.timestamp \u003e= FORK_TIME + current_epoch * EPOCH_LENGTH:\n        current_epoch += 1\n        schedule_expiry(current_epoch - NUM_ACTIVE_EPOCHS)   # client-defined\n\ndef access(stem, is_write):\n    node = tree.extension(stem)\n    if not current_epoch \u003c node.last_epoch + NUM_ACTIVE_EPOCHS:\n        raise Revert(\"expired: resurrect first\")\n    if is_write:\n        node.last_epoch = current_epoch\n\ndef resurrect(stem, last_epoch, values):\n    keepsake = tree.get_keepsake(stem)\n    assert keepsake.C == extension_and_suffix_tree(stem, values, last_epoch)\n    tree.resurrect_subtree(stem, values, current_epoch)\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**，并且依赖同样处于 Stagnant 状态的 Verkle 树（[EIP-6800](/eip-6800/)）。此后研究已转向二叉树（[EIP-7864](/eip-7864/)）。\n- 由于只有写入才会刷新纪元，经常被读取但从不被写入的数据（例如合约代码或某个配置值）仍然可能过期，需要复活。\n- 分叉时间、复活交易的类型编号、测试用例和参考实现在规范中都还是 TBD，其安全部分写的是\"需要讨论\"。\n- 它与 EIP-6800 向后兼容，因为新的承诺字段默认为 0，等于初始纪元。\n- 复活会一次性恢复整个 stem 组，这样更简单，但比只恢复单个值成本更高。\n"}}}
