Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article covers EIP-8246, which prevents SELFDESTRUCT from destroying ETH and preserves the account balance.

EIP-8246 proposes removing the remaining ETH burn behavior of SELFDESTRUCT. Here, burn refers to removing ETH from the total supply. Even when a contract created within the same transaction executes SELFDESTRUCT, its balance is preserved, and only its code, storage, and nonce are cleared during finalization.

This article explains the proposal linked below.

Overview

EIP-8246 proposes eliminating the removal of ETH from the total supply through SELFDESTRUCT. Accounts marked for SELFDESTRUCT have their code, storage, and nonce cleared at the end of the transaction. Their balances, however, are preserved.

This change does not completely disable SELFDESTRUCT. For contracts created within the same transaction, it retains the effect of deleting code and storage during finalization. What changes is the operation that clears the balance to burn ETH.

The following diagram illustrates the proposal. The original diagrams in this article retain their Japanese labels.

Overview of EIP-8246

The left side shows how ETH can disappear through the remaining behavior of SELFDESTRUCT. The right side shows the behavior after EIP-8246. The balance is preserved, but executable code and persistent storage no longer exist.

EIP-6780 already restricted most of the deletion effects of SELFDESTRUCT. However, ETH could still be subject to burn when a contract created within the same transaction executed SELFDESTRUCT. EIP-8246 removes this remaining behavior.

Motivation

The remaining burn behavior of SELFDESTRUCT is rarely used in practice. Nevertheless, EVM implementations, specifications, and tests must handle it as a special case. The problem is that a rarely used feature adds complexity to client implementations and test cases.

Even after EIP-6780, contracts created within the same transaction can burn ETH. Specifically, this occurs when a newly created contract executes SELFDESTRUCT with itself as the beneficiary, or when it receives additional ETH via CALL or another SELFDESTRUCT after executing SELFDESTRUCT.

The proposal reports the results of replaying Ethereum mainnet from genesis to approximately 25 million blocks. After Cancun, there were two instances of ETH being subject to burn through this behavior, and zero instances of balances being subject to burn during transaction finalization. In the pre-Cancun history, there were 54 instances of self-burn in total.

These figures show that the remaining burn behavior is used even less frequently than the behavior removed by EIP-6780. Its removal would therefore have a very limited impact.

Another motivation is to eliminate the last mechanism in the EVM that removes ETH from the total supply. Removing the remaining burn behavior of SELFDESTRUCT means that no EVM instruction alone can remove ETH from the total supply.

Specification

EIP-8246 changes the balance handling and finalization behavior of SELFDESTRUCT for contracts created within the same transaction. All other SELFDESTRUCT behavior remains unchanged.

The key specification changes are as follows.

Target Behavior after the change
A contract created within the same transaction executes SELFDESTRUCT with itself as the beneficiary The account balance remains unchanged.
An account marked for SELFDESTRUCT at the end of a transaction Instead of deleting the account, reset its nonce to 0, preserve its balance, and clear its code and storage.
All other SELFDESTRUCT cases Unchanged from the behavior after EIP-6780.
An account with a zero balance after finalization Removed from the state under EIP-161.

Balance during execution

When a contract created within the same transaction executes SELFDESTRUCT and names itself as the beneficiary, its balance remains unchanged. This prevents ETH from disappearing through operations such as SELFDESTRUCT(address(this)).

The change does not introduce a new transfer to the beneficiary. It simply removes the special case that destroys the balance when the beneficiary is the contract itself.

Transaction finalization

At the end of a transaction, an account marked for SELFDESTRUCT is changed to the following state.

Component After finalization
nonce Reset to 0.
balance Unchanged.
code Cleared.
storage Completely cleared.

The following diagram shows finalization for a contract created and subject to SELFDESTRUCT within the same transaction.

Transaction finalization after EIP-8246

The central idea is to separate the balance from the executable state during finalization. The balance is preserved, but code and storage are cleared, and the nonce is reset to zero. If the balance is zero, the account is removed from the state under EIP-161.

Balance-only accounts

If a balance remains after finalization, the address persists in the state as a balance-only account. Because it has no code, contract logic at that address can no longer be executed. Its storage is also cleared, so its previous state cannot be retrieved.

Resetting the nonce to zero is also important. A remaining balance does not prevent recreation at the same address via CREATE2 in a future transaction.

Rationale

Rather than compensating for the burn elsewhere, EIP-8246 removes the operation that causes the burn. This eliminates the need for EVM implementations and specifications to maintain a special case that destroys ETH only in this pattern.

However, the proposal does not remove all finalization effects of SELFDESTRUCT. For contracts created within the same transaction, it retains the clearing of code, storage, and nonce. As a result, an address after SELFDESTRUCT does not remain an executable contract.

Preserving only the balance keeps the scope of the change as small as possible. An alternative would be to preserve the nonce, code, storage, and balance. However, that would disable SELFDESTRUCT more broadly and introduce a larger semantic change than the intended removal of the burn behavior.

The nonce is reset to zero to avoid interfering with future CREATE2 operations. Even if a balance-only account remains, a contract can be recreated at the same address in a subsequent transaction as long as there is no code and the nonce is zero.

Backward Compatibility

EIP-8246 changes consensus rules and therefore requires a hard fork. It changes the final state when a contract created within the same transaction executes SELFDESTRUCT.

The following diagram shows the scope of the impact.

Compatibility and impact of EIP-8246

The change targets the remaining burn behavior of contracts created within the same transaction. For contracts not created within that transaction, SELFDESTRUCT remains unchanged from the behavior after EIP-6780. The removal of zero-balance accounts under EIP-161 also remains in effect.

Previously, a contract created within the same transaction could burn ETH by executing SELFDESTRUCT with itself as the beneficiary. ETH could also be sent to the contract after SELFDESTRUCT, causing the balance to disappear at the end of the transaction. After EIP-8246, neither pattern results in a burn of ETH.

Previously, this type of contract was deleted at the end of the transaction. After the change, contracts with a final balance of zero are deleted, while contracts with a nonzero final balance remain as balance-only accounts. Their code, storage, and nonce are cleared.

Recreating a contract at the same address via CREATE2 in a subsequent transaction continues to work. Because the nonce is reset to zero and the code is cleared, even an account with a remaining balance does not prevent recreation.

Rather than making a broader change to SELFDESTRUCT as a whole, this proposal targets only the remaining burn behavior.

One caveat is that Optimism-based L2s use the burn functionality of SELFDESTRUCT in normal operation. Applying the same change as mainnet requires a separate migration plan.

Test Cases

The proposal notes that the large number of SELFDESTRUCT combinations makes it necessary to update existing SELFDESTRUCT tests and add tests for the changed behavior. In particular, the following dimensions are tested in combination.

Dimension What to verify
Call hierarchy Top-level transaction or internal call.
Call type CALL, CREATE, or CREATE2.
Code state Execution within initialization code or from deployed code.
Execution result Whether SELFDESTRUCT succeeds or fails due to insufficient gas.
revert Whether the effects of SELFDESTRUCT persist or are undone by a revert in an internal call.
Balance Whether the balance is zero or nonzero when SELFDESTRUCT executes.

Opcode-level tests

At the opcode level, the tests check which beneficiary a contract created in the same transaction specifies when executing SELFDESTRUCT.

No Case
1 A contract created in the same transaction executes SELFDESTRUCT with itself as the beneficiary.
2 After executing SELFDESTRUCT with itself as the beneficiary, the contract executes SELFDESTRUCT again with itself as the beneficiary.
3 After executing SELFDESTRUCT with itself as the beneficiary, the contract executes SELFDESTRUCT with another address as the beneficiary.
4 After executing SELFDESTRUCT with another address as the beneficiary, the contract executes SELFDESTRUCT with itself as the beneficiary.

Transaction finalization tests

Finalization tests check cases where ETH is received after SELFDESTRUCT and whether code, storage, and nonce are cleared.

No Case
5 After executing SELFDESTRUCT with another address as the beneficiary, send ETH to the affected account via CALL.
6 After executing SELFDESTRUCT with another address as the beneficiary, send ETH to the affected account via multiple CALL operations.
7 After executing SELFDESTRUCT with another address as the beneficiary, send ETH via CALL, then execute SELFDESTRUCT with another address as the beneficiary.
8 After executing SELFDESTRUCT with another address as the beneficiary, send ETH via CALL, then execute SELFDESTRUCT with the account itself as the beneficiary.
9 After executing SELFDESTRUCT with the account itself as the beneficiary, send ETH to the affected account via CALL.
10 After executing SELFDESTRUCT with the account itself as the beneficiary, send ETH to the affected account via multiple CALL operations.
11 After executing SELFDESTRUCT with the account itself as the beneficiary, send ETH via CALL, then execute SELFDESTRUCT with another address as the beneficiary.
12 After executing SELFDESTRUCT with the account itself as the beneficiary, send ETH via CALL, then execute SELFDESTRUCT with the account itself as the beneficiary again.
13 Create a new account, have it create another account to increment its nonce, then execute SELFDESTRUCT with itself as the beneficiary.
14 Create a new account, have it create another account to increment its nonce, then execute SELFDESTRUCT with another address as the beneficiary.
15 Create a new account, have it write to storage, then execute SELFDESTRUCT with itself as the beneficiary.
16 Create a new account, have it write to storage, then execute SELFDESTRUCT with another address as the beneficiary.

Multiple transactions

The multi-transaction test creates a new account with a balance using CREATE2, has that account execute SELFDESTRUCT with itself as the beneficiary, and then repeats the same operation. The test verifies that even if a balance-only account remains, it can be recreated in a subsequent transaction because the nonce and code have been cleared.

Security Considerations

Changes to SELFDESTRUCT behavior affect a wide range of tests combining multiple calls and contract creations. Consequently, even though the scope of the change appears small, the amount of testing is substantial. The proposal suggests reusing existing tests for EIP-6780 and adapting them to the new finalization behavior.

Another consideration is use cases that rely on the burn of ETH. After the change, such use cases leave accounts holding only small balances. However, because the transaction sender pays the gas cost of creating new accounts, this does not provide a DoS mechanism for increasing state size at no cost.

The mainnet replay described in the proposal recorded two instances of this behavior from Cancun through approximately 25 million blocks. The actual impact is therefore very limited.

Conclusion

This article covered EIP-8246, which prevents SELFDESTRUCT from destroying ETH and preserves the account balance.

EIP-8246 proposes removing the operation through which SELFDESTRUCT destroys ETH. The balance is preserved, while code, storage, and nonce are cleared, so the account does not remain an executable contract. The change removes a rarely used special case and simplifies EVM implementations and tests.

I also write articles elsewhere, so feel free to explore them.