EIP-6046 Deactivate instead of self-destruct (Replace SELFDESTRUCT with DEACTIVATE)
No call decision · EVM & execution · EIP status Stagnant · created 2022-11-25
A proposal to replace SELFDESTRUCT, which erases an account entirely, with DEACTIVATE, which leaves storage untouched, empties only the balance, and marks the account as deactivated by setting the nonce to a special value.
Why it is needed
There has long been concern that although SELFDESTRUCT has a fixed gas cost, it actually has to erase every key stored in the account, so the amount of work required cannot be known in advance. Moreover, under the Verkle trees to be introduced in the future, each account attribute and storage entry exists as its own independent key, making it impossible to enumerate and traverse every key that was used. This makes it hard to implement the 'delete all storage' behavior that SELFDESTRUCT performs today. Instead of erasing storage, this proposal simply marks the account as 'deactivated,' staying compatible with Verkle trees while not drastically breaking existing usage patterns such as account revival.
What changes
Today
- SELFDESTRUCT erases every storage key of an account and marks the account as deleted.
- Because the scope of storage deletion cannot be known in advance, throughput cannot be predicted.
- Under Verkle trees there is no way to traverse and erase all of an account's keys.
After EIP-6046
- DEACTIVATE (formerly SELFDESTRUCT) does not erase storage; it only zeroes out the balance and sends it to the destination.
- It marks the 'deactivated' state by setting the account nonce to the special value 2^64-1.
- Calls to a deactivated account return only an empty value, and CREATE2 can plant new code there again.
Who is affected
- Contract developer: Code that relied on the pattern of deleting an account with SELFDESTRUCT and recreating it with CREATE2 must now be written on the assumption that existing storage values remain.
- Client and protocol teams: With the Verkle tree transition in mind, account deletion logic must change from 'full-traversal deletion' to 'nonce-based state marking.'
- Security leads and auditors: Security reviews must be redone on the assumption that previous storage values can remain intact on a recreated contract.
In depth
Adjusting the nonce ceiling (amending EIP-2681)
Lowers the general nonce increment limit set by EIP-2681 from 2^64-1 to 2^64-2, one step down. This applies from genesis. As a result, the value 2^64-1, which can never be reached through ordinary nonce increments, is reserved exclusively as the special value denoting deactivation.
New behavior of DEACTIVATE (formerly SELFDESTRUCT)
Leaves the account's storage keys untouched. The account's balance is transferred to the specified destination and its own balance is set to zero. The account nonce is set to 2^64-1, marking it as deactivated. Following EIP-3529 there is no gas refund, and the SELFDESTRUCT-related gas rules set by EIP-2929 remain unchanged.
Handling calls to a deactivated account
If an external transaction or a CALL*-family instruction attempts to execute an account whose nonce is 2^64-1, execution is treated as successful and an empty buffer is returned. However, deposits that do not execute code, such as coinbase rewards or value transfers from another account's DEACTIVATE, can still be received.
Allowing redeployment via CREATE2
Allows account creation via CREATE2 even for an account whose nonce is 2^64-1. Note that in this case the account's code and storage may not be empty. If CREATE2 succeeds, the account's code, nonce, and in some cases balance all change.
Reason for the opcode rename
Because the meaning of account revival changes, the opcode is renamed from SELFDESTRUCT to DEACTIVATE. Previously it could be assumed that storage was empty upon revival, but now past storage entries may remain, so newly deployed code at revival must be written with this in mind.
Differences from prior removal proposals
Most other proposals that would eliminate SELFDESTRUCT entirely remove the deletion feature outright, breaking existing usage patterns. This proposal instead leaves storage intact and gives the recreated contract the flexibility to reuse or erase storage slots one at a time, aiming to solve the Verkle tree transition problem without completely breaking existing patterns. This change affects only newly deployed code and does not alter the behavior of existing code.
Backwards compatibility and security
Because this EIP changes consensus rules, it requires a protocol upgrade (hard fork). Lowering the nonce ceiling to 2^64-2 is not an issue since it is still far larger than any value that could affect real accounts. Contracts that used the revival pattern will continue to work, but code deployed upon revival must be designed with the awareness that storage keys may already exist, which also has implications for security design.
Current status
This EIP is in Stagnant status, with no active discussion or adoption process underway. The call records contain no mention of an inclusion decision either.