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.

EIP-158 proposes reducing Ethereum's state size by automatically removing empty accounts.

This article translates, summarizes, and expands on the following historical proposal.

More EIP explainers:

Specification

The proposal describes several changes to Ethereum's account-handling rules after a network upgrade.

Account deletion

Under the original specification, when an account undergoes a state change that leaves its nonce and balance at zero, with empty code and storage, it is deleted instead of being saved. This prevents unnecessary account records from remaining in the state.

Deletion through touching

An existing empty account can also be deleted when its address is touched. Here, touching refers to an operation that would have created an account if the destination did not exist.

Account existence checks in the EVM

For the relevant existence checks performed during EVM execution, an empty account is treated like a nonexistent account. The proposal aims to eliminate the need to distinguish these two conditions.

Reduced gas costs

Zero-value CALL and SUICIDE operations no longer incur the additional 25,000-gas account-creation charge. This does not mean that these operations have no other gas costs.

These changes aim to limit unnecessary state growth and reduce certain execution costs.

SUICIDE and zero-value operations

SUICIDE was the historical name of the EVM instruction now called SELFDESTRUCT.

SUICIDE (self-destruction)

Under the historical semantics discussed in the proposal, a contract could schedule its own deletion and transfer its remaining ETH balance to a beneficiary. Its code and storage were removed from the current state when the deletion took effect.

This did not erase historical blockchain records.

Modern Ethereum changed SELFDESTRUCT semantics through EIP-6780: in most cases it no longer deletes the contract's code and storage unless the contract was created in the same transaction. The explanation here concerns the historical rules.

Zero-value operations

A zero-value SUICIDE operation occurs when no ETH is transferred to the beneficiary because the executing account has no balance to transfer.

The distinction matters because an operation that would otherwise create an unnecessary empty beneficiary account can increase state size and incur account-creation costs. EIP-158 removes that additional charge for zero-value operations.

The proposal identifies the following situations in which an address can be touched:

  • Zero-value CALL
    • A call that transfers no ETH.
  • CREATE
    • Contract creation that would leave empty code and a zero ETH balance.
  • Zero-value SUICIDE
    • Self-destruction with no ETH transferred to the beneficiary.
  • Transaction recipients
    • Accounts addressed by transactions, including zero-value transactions.
  • Contracts created by contract creation transactions
    • Newly created contract accounts.
  • Miners receiving transaction fees
    • Including historical cases involving zero gas prices and subsequent block, uncle, or nephew rewards.

For the purpose of calculating the additional 25,000-gas charge, specification variant 1b defines emptiness using a zero balance, empty code, and zero nonce, without considering storage contents.

This simplifies client implementations and avoids requiring additional cache-enumeration logic for pathological account states.

Block, uncle, and nephew rewards

These terms refer to Ethereum's historical proof-of-work reward system.

Block rewards

Miners producing canonical blocks received newly issued ETH as a block reward. They also received applicable transaction fees, which were a separate source of compensation.

Uncle rewards

Ethereum's proof-of-work protocol allowed eligible noncanonical blocks, also called uncles or ommers, to be referenced by canonical blocks. The miners who produced those eligible blocks received a reward. This reduced some of the disadvantages of competing block production.

Nephew rewards

The miner including an eligible uncle in a canonical block received an additional inclusion reward. This incentivized miners to reference eligible uncles.

These mechanisms were part of Ethereum's former proof-of-work protocol and do not describe its current proof-of-stake reward system.

Specification (1c)

EIP-158 also presents an alternative approach to clearing empty accounts.

Handling existing empty accounts

Under this alternative, new empty accounts cannot be created, but existing empty accounts are not deleted merely because they are touched unless their state actually changes.

The proposal uses the following emptiness predicate:

js
is_empty(acct): return get_balance(acct) == 0 and get_code(acct) == "" and get_nonce(acct) == 0

Gradual removal of empty accounts

Beginning at a designated block N, the alternative proposes selecting and deleting up to 1,000 remaining empty accounts per block, ordered by the hash of their addresses.

Ordering accounts by the historical sha3(address) expression, referring to Ethereum's Keccak-based hashing convention, makes them easier to locate when traversing the state tree.

This gradual approach aims to remove unnecessary state entries over time rather than relying exclusively on ordinary transactions to touch them.

Historical context: specification 1c is an alternative discussed in EIP-158, not a rule that should be assumed to run on modern Ethereum. EIP-161 describes the invariant-preserving state-clearing rules associated with Spurious Dragon, including deletion of touched empty accounts at the end of a transaction.

Rationale

Benefits of removing empty accounts

Earlier protocol rules allowed numerous empty accounts to be created at low cost. Removing them reduces unnecessary state entries, lowers disk requirements for full clients, and can shorten synchronization times.

Once empty account records have been cleared, representing them through nonexistence simplifies the protocol.

Short-term concerns

The original proposal identifies a temporary performance concern during state clearing. Its historical estimates describe state changes to existing empty accounts costing 700 gas per account, or an effective 350 gas per account after the then-applicable SUICIDE refunds.

A greater number of state writes per block could temporarily increase block-processing times and uncle rates. The proposal anticipated that this concern would diminish once existing empty accounts had been cleared.

These gas figures describe the historical proposal rather than current Ethereum gas pricing.

The overall objective is to improve long-term state efficiency while accounting for the temporary operational costs of clearing existing accounts.

References

Citation

Vitalik Buterin (@vbuterin), "EIP-158: State clearing," Ethereum Improvement Proposals, no. 158, October 2016. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-158.

Conclusion

EIP-158 addresses unnecessary Ethereum state growth through empty-account clearing and revised account-creation gas rules. Its historical alternatives also illustrate why state-transition invariants and the timing of account deletion matter in protocol design.

Questions are welcome via Twitter @cardene777.

Other publications:

https://chaldene.net/