{"eip":6190,"title":"Verkle-compatible SELFDESTRUCT","description":"Changes SELFDESTRUCT to only cause a finite number of state changes","authors":["Gavin John (@Pandapip1)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2022-12-20","requires":[2929,6188,6189],"discussionsTo":"https://ethereum-magicians.org/t/eip-6190-functional-selfdestruct/12232","repo":"EIPs","label":"EIP-6190","officialUrl":"https://eips.ethereum.org/EIPS/eip-6190","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6190.md","url":"https://eips.huatuo.xyz/eip-6190/","tldr":{"en":"A stagnant proposal to make SELFDESTRUCT touch a fixed, small amount of state, turning the contract into a forwarding stub instead of wiping all its storage, so it could work with Verkle trees.","ja":"SELFDESTRUCT が固定された少量のステートだけに触れるようにし、すべてのストレージを消去する代わりにコントラクトを転送用のスタブにして、Verkle ツリーと両立させようとする、停滞中の提案。","ko":"SELFDESTRUCT가 고정된 소량의 상태만 건드리게 하고, 모든 스토리지를 지우는 대신 컨트랙트를 전달용 스텁으로 바꿔 Verkle 트리와 함께 동작하게 하려는 정체된 제안.","zh":"一个已停滞的提案：让 SELFDESTRUCT 只触及固定的少量状态，把合约变成转发存根，而不是清除其全部存储，使其可以配合 Verkle 树工作。"},"tags":["selfdestruct","verkle","evm","opcode","core"],"explainers":{"en":{"lang":"en","tldr":"A stagnant proposal to make SELFDESTRUCT touch a fixed, small amount of state, turning the contract into a forwarding stub instead of wiping all its storage, so it could work with Verkle trees.","tags":["selfdestruct","verkle","evm","opcode","core"],"related":[6188,6189,2929,6780],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6190/","markdown":"## What problem does it solve?\n\n`SELFDESTRUCT` deletes a contract's code, balance and *all* of its storage for a fixed gas price. The amount of work is unbounded: a contract with millions of storage slots costs the same to destroy as an empty one.\n\nThat becomes a real obstacle with **Verkle trees**, the planned state structure in which every storage slot is its own key. Clients would not be able to enumerate and delete every key belonging to an account. EIP-6190 proposed a version of `SELFDESTRUCT` that changes only a bounded number of values, as a step toward Verkle compatibility.\n\n## How it works\n\nInstead of deleting the contract at the end of the transaction, the opcode would:\n\n1. Set the contract's code to `0x1` and its nonce to `2^64-1`.\n2. Write into storage slot `0` the address that a `CREATE` from this contract would produce with that nonce.\n3. If the call reached the contract through one or more *alias contracts*, write that same address into each alias's slot `0`.\n4. Send the whole balance to the beneficiary address on the stack, as today.\n\nThe code `0x1` and maximal nonce come from the companion proposals [EIP-6189](/eip-6189/) (alias contracts that forward calls) and [EIP-6188](/eip-6188/) (nonce cap). The effect is that the old account becomes an alias pointing at a fresh address, so a later redeployment effectively starts from empty storage, without having to erase the old slots.\n\nGas: a base cost of 5,000, plus 5,000 per alias contract the call passed through, plus the [EIP-2929](/eip-2929/) cold-access surcharge. The 5,000 figures reflect the cost of setting the nonce and slot 0.\n\n## Sample code\n\nPseudocode for the proposed end-of-transaction handling:\n\n```python\nMAX_NONCE = 2**64 - 1\n\ndef apply_selfdestruct(state, contract, beneficiary, alias_chain):\n    state.set_code(contract, b\"\\x01\")          # mark as alias (EIP-6189)\n    state.set_nonce(contract, MAX_NONCE)        # protected nonce (EIP-6188)\n    new_addr = create_address(contract, MAX_NONCE)  # same rule as CREATE\n    state.set_storage(contract, 0, new_addr)\n    for alias in alias_chain:                   # contracts that forwarded the call\n        state.set_storage(alias, 0, new_addr)\n    state.add_balance(beneficiary, state.get_balance(contract))\n    state.set_balance(contract, 0)\n\ndef selfdestruct_gas(alias_chain, beneficiary_is_cold):\n    return 5000 + 5000 * len(alias_chain) + (2600 if beneficiary_is_cold else 0)\n```\n\n## Things to know\n\n- **Status: Stagnant.** It was never scheduled for a network upgrade, and its Security Considerations section still reads \"Needs discussion\".\n- It only works together with EIP-6188 and EIP-6189, which are themselves non-final proposals.\n- Ethereum took a different route: [EIP-6780](/eip-6780/) (Cancun) restricts `SELFDESTRUCT` so it only deletes an account when called in the same transaction that created it; otherwise it just sends the balance.\n- The cold-access figure in the sample reflects EIP-2929's usual 2,600 surcharge for a cold account and is illustrative.\n"},"ja":{"lang":"ja","tldr":"SELFDESTRUCT が固定された少量のステートだけに触れるようにし、すべてのストレージを消去する代わりにコントラクトを転送用のスタブにして、Verkle ツリーと両立させようとする、停滞中の提案。","tags":["selfdestruct","verkle","evm","opcode","core"],"related":[6188,6189,2929,6780],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6190/","markdown":"## 何を解決するのか\n\n`SELFDESTRUCT` は、固定のガス価格で、コントラクトのコード、残高、そして*すべての*ストレージを削除します。作業量に上限がありません。何百万ものストレージスロットを持つコントラクトでも、空のコントラクトと同じコストで破棄できてしまいます。\n\nこれは **Verkle ツリー** では現実的な障害になります。Verkle ツリーは計画されているステート構造で、すべてのストレージスロットがそれぞれ独自のキーになります。クライアントは、アカウントに属するすべてのキーを列挙して削除することができなくなります。EIP-6190 は、Verkle への対応に向けた一歩として、上限のある数の値だけを変更する `SELFDESTRUCT` のバージョンを提案しました。\n\n## 仕組み\n\nこのオペコードは、トランザクションの終了時にコントラクトを削除する代わりに、次のことを行います。\n\n1. コントラクトのコードを `0x1`、ノンスを `2^64-1` に設定する。\n2. ストレージスロット `0` に、このコントラクトから、そのノンスで `CREATE` を行った場合に生成されるアドレスを書き込む。\n3. 呼び出しが 1 つ以上の*エイリアスコントラクト*を経由してそのコントラクトに到達していた場合は、その同じアドレスを各エイリアスのスロット `0` に書き込む。\n4. 現在と同様に、残高のすべてをスタック上のベネフィシャリーのアドレスに送る。\n\nコード `0x1` と最大のノンスは、関連する提案である [EIP-6189](/eip-6189/)（呼び出しを転送するエイリアスコントラクト）と [EIP-6188](/eip-6188/)（ノンスの上限）に由来します。その結果、古いアカウントは新しいアドレスを指すエイリアスになり、後から再デプロイしても、古いスロットを消去しなくても、実質的に空のストレージから始まります。\n\nガス: 基本コスト 5,000、加えて呼び出しが経由したエイリアスコントラクトごとに 5,000、さらに [EIP-2929](/eip-2929/) のコールドアクセス追加料金。5,000 という数字は、ノンスとスロット 0 を設定するコストを反映しています。\n\n## サンプルコード\n\n提案されているトランザクション終了時の処理の擬似コード:\n\n```python\nMAX_NONCE = 2**64 - 1\n\ndef apply_selfdestruct(state, contract, beneficiary, alias_chain):\n    state.set_code(contract, b\"\\x01\")          # mark as alias (EIP-6189)\n    state.set_nonce(contract, MAX_NONCE)        # protected nonce (EIP-6188)\n    new_addr = create_address(contract, MAX_NONCE)  # same rule as CREATE\n    state.set_storage(contract, 0, new_addr)\n    for alias in alias_chain:                   # contracts that forwarded the call\n        state.set_storage(alias, 0, new_addr)\n    state.add_balance(beneficiary, state.get_balance(contract))\n    state.set_balance(contract, 0)\n\ndef selfdestruct_gas(alias_chain, beneficiary_is_cold):\n    return 5000 + 5000 * len(alias_chain) + (2600 if beneficiary_is_cold else 0)\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant。** ネットワークアップグレードにスケジュールされたことはなく、Security Considerations の節は今も「Needs discussion」のままです。\n- EIP-6188 と EIP-6189 と組み合わせた場合にのみ機能しますが、これら自体も最終化されていない提案です。\n- Ethereum は別の道を選びました。[EIP-6780](/eip-6780/)（Cancun）は `SELFDESTRUCT` を制限し、アカウントを作成したのと同じトランザクション内で呼ばれた場合にのみアカウントを削除し、それ以外では残高を送るだけにします。\n- サンプル中のコールドアクセスの値は、コールドアカウントに対する EIP-2929 の通常の追加料金 2,600 を反映したもので、説明用です。\n"},"ko":{"lang":"ko","tldr":"SELFDESTRUCT가 고정된 소량의 상태만 건드리게 하고, 모든 스토리지를 지우는 대신 컨트랙트를 전달용 스텁으로 바꿔 Verkle 트리와 함께 동작하게 하려는 정체된 제안.","tags":["selfdestruct","verkle","evm","opcode","core"],"related":[6188,6189,2929,6780],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6190/","markdown":"## 어떤 문제를 해결하나요?\n\n`SELFDESTRUCT`는 고정된 가스 가격으로 컨트랙트의 코드, 잔액, 그리고 *모든* 스토리지를 삭제합니다. 작업량에 상한이 없습니다. 수백만 개의 스토리지 슬롯이 있는 컨트랙트를 파괴하는 비용이 빈 컨트랙트와 같습니다.\n\n이는 **Verkle 트리**에서는 실질적인 걸림돌이 됩니다. Verkle 트리는 계획된 상태 구조로, 모든 스토리지 슬롯이 각자의 키가 됩니다. 클라이언트는 한 계정에 속한 모든 키를 열거해 삭제할 수 없게 됩니다. EIP-6190은 Verkle 호환을 향한 한 단계로, 한정된 개수의 값만 변경하는 `SELFDESTRUCT` 버전을 제안했습니다.\n\n## 어떻게 동작하나요?\n\n이 옵코드는 트랜잭션이 끝날 때 컨트랙트를 삭제하는 대신 다음을 수행합니다.\n\n1. 컨트랙트의 코드를 `0x1`로, 논스를 `2^64-1`로 설정합니다.\n2. 스토리지 슬롯 `0`에, 이 컨트랙트가 그 논스로 `CREATE`를 했을 때 만들어질 주소를 기록합니다.\n3. 호출이 하나 이상의 *별칭 컨트랙트(alias contract)*를 거쳐 이 컨트랙트에 도달했다면, 같은 주소를 각 별칭의 슬롯 `0`에 기록합니다.\n4. 지금처럼 전체 잔액을 스택에 있는 수혜자 주소로 보냅니다.\n\n코드 `0x1`과 최대 논스는 함께 제안된 [EIP-6189](/eip-6189/)(호출을 전달하는 별칭 컨트랙트)와 [EIP-6188](/eip-6188/)(논스 상한)에서 온 것입니다. 그 결과 옛 계정은 새 주소를 가리키는 별칭이 되고, 나중에 다시 배포하더라도 옛 슬롯을 지우지 않고도 사실상 빈 스토리지에서 시작합니다.\n\n가스: 기본 비용 5,000, 호출이 거친 별칭 컨트랙트마다 5,000, 그리고 [EIP-2929](/eip-2929/)의 콜드 접근 추가 비용. 5,000이라는 수치는 논스와 슬롯 0을 설정하는 비용을 반영합니다.\n\n## 샘플 코드\n\n제안된 트랜잭션 종료 시 처리의 의사 코드:\n\n```python\nMAX_NONCE = 2**64 - 1\n\ndef apply_selfdestruct(state, contract, beneficiary, alias_chain):\n    state.set_code(contract, b\"\\x01\")          # mark as alias (EIP-6189)\n    state.set_nonce(contract, MAX_NONCE)        # protected nonce (EIP-6188)\n    new_addr = create_address(contract, MAX_NONCE)  # same rule as CREATE\n    state.set_storage(contract, 0, new_addr)\n    for alias in alias_chain:                   # contracts that forwarded the call\n        state.set_storage(alias, 0, new_addr)\n    state.add_balance(beneficiary, state.get_balance(contract))\n    state.set_balance(contract, 0)\n\ndef selfdestruct_gas(alias_chain, beneficiary_is_cold):\n    return 5000 + 5000 * len(alias_chain) + (2600 if beneficiary_is_cold else 0)\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 네트워크 업그레이드에 예정된 적이 없으며 Security Considerations 항목은 아직 \"Needs discussion\"으로 되어 있습니다.\n- EIP-6188 및 EIP-6189와 함께일 때만 동작하는데, 이들 역시 확정되지 않은 제안입니다.\n- 이더리움은 다른 길을 택했습니다. [EIP-6780](/eip-6780/)(Cancun)은 `SELFDESTRUCT`를 제한해, 계정을 만든 같은 트랜잭션에서 호출된 경우에만 계정을 삭제하고 그렇지 않으면 잔액만 보냅니다.\n- 샘플의 콜드 접근 수치는 콜드 계정에 대한 EIP-2929의 일반적인 추가 비용 2,600을 반영한 것으로 설명용입니다.\n"},"zh":{"lang":"zh","tldr":"一个已停滞的提案：让 SELFDESTRUCT 只触及固定的少量状态，把合约变成转发存根，而不是清除其全部存储，使其可以配合 Verkle 树工作。","tags":["selfdestruct","verkle","evm","opcode","core"],"related":[6188,6189,2929,6780],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6190/","markdown":"## 它解决什么问题？\n\n`SELFDESTRUCT` 以固定的 gas 价格删除合约的代码、余额和*全部*存储。工作量没有上限：销毁一个拥有数百万个存储槽的合约，与销毁一个空合约的成本相同。\n\n这在 **Verkle 树**下会成为真正的障碍。Verkle 树是计划中的状态结构，其中每个存储槽都有自己的键。客户端将无法枚举并删除属于某个账户的每一个键。EIP-6190 提出了一个只更改有限数量数值的 `SELFDESTRUCT` 版本，作为迈向 Verkle 兼容的一步。\n\n## 它如何运作\n\n该操作码不会在交易结束时删除合约，而是：\n\n1. 把合约的代码设为 `0x1`，nonce 设为 `2^64-1`。\n2. 向存储槽 `0` 写入：由该合约以该 nonce 执行 `CREATE` 所会产生的地址。\n3. 如果调用是通过一个或多个*别名合约（alias contract）*到达该合约的，则把同一个地址写入每个别名合约的槽 `0`。\n4. 与现在一样，把全部余额发送到栈上的受益地址。\n\n代码 `0x1` 和最大 nonce 来自配套提案 [EIP-6189](/eip-6189/)（转发调用的别名合约）和 [EIP-6188](/eip-6188/)（nonce 上限）。其效果是：旧账户变成一个指向全新地址的别名，因此之后的重新部署实际上从空存储开始，而无需擦除旧的槽。\n\nGas：基础成本 5,000，加上调用经过的每个别名合约 5,000，再加上 [EIP-2929](/eip-2929/) 的冷访问附加费。5,000 这个数字反映了设置 nonce 和槽 0 的成本。\n\n## 示例代码\n\n提议中的交易结束处理的伪代码：\n\n```python\nMAX_NONCE = 2**64 - 1\n\ndef apply_selfdestruct(state, contract, beneficiary, alias_chain):\n    state.set_code(contract, b\"\\x01\")          # mark as alias (EIP-6189)\n    state.set_nonce(contract, MAX_NONCE)        # protected nonce (EIP-6188)\n    new_addr = create_address(contract, MAX_NONCE)  # same rule as CREATE\n    state.set_storage(contract, 0, new_addr)\n    for alias in alias_chain:                   # contracts that forwarded the call\n        state.set_storage(alias, 0, new_addr)\n    state.add_balance(beneficiary, state.get_balance(contract))\n    state.set_balance(contract, 0)\n\ndef selfdestruct_gas(alias_chain, beneficiary_is_cold):\n    return 5000 + 5000 * len(alias_chain) + (2600 if beneficiary_is_cold else 0)\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 它从未被排入任何网络升级，其 Security Considerations 部分仍写着\"Needs discussion\"。\n- 它只有与 EIP-6188 和 EIP-6189 配合才能工作，而这两者本身也是未最终确定的提案。\n- 以太坊选择了另一条路：[EIP-6780](/eip-6780/)（Cancun）限制了 `SELFDESTRUCT`，使其只有在创建该账户的同一笔交易中被调用时才会删除账户；否则它只是发送余额。\n- 示例中的冷访问数字反映了 EIP-2929 对冷账户通常的 2,600 附加费，仅作说明。\n"}}}
