EIP-7523 · Last Call · Core · 2023-09-19
EIP-7523: Empty accounts deprecation
Declares that post-merge Ethereum state never contains empty accounts, so clients and future specs can drop EIP-161's complicated 'touch and delete' edge cases.
What problem does it solve?
An empty account has no code, a zero nonce and a zero balance. In Ethereum's early days, the 2016 Shanghai DoS attacks created huge numbers of them. EIP-161 (Spurious Dragon) stopped new ones from being created and added a rule that an empty account is deleted when it is "touched".
Those leftovers have since been cleaned up: the spec notes that all remaining empty accounts on Mainnet were cleared in block 14049881, months before the merge. Yet the "touch" rules still sit in the specification. Every new feature has to consider how it interacts with them, test suites contain cases for them, and a new client that only wants to support post-merge blocks must still implement them just to pass tests.
EIP-7523 removes that burden by formally ruling out empty accounts after the merge.
How it works
The EIP changes no behaviour that can actually happen on a live network. It adds a rule:
- On networks that went through the merge, the pre-state of the merge block must not contain empty accounts.
- On networks merged at genesis, no genesis account may be empty.
- The specification is undefined in the presence of a post-merge empty account, and test cases involving them are invalid.
Clients may skip scanning state to confirm this for:
- Mainnet (identified in the spec by its merge block hash), and
- any chain with no empty genesis accounts that had Spurious Dragon (or later) rules active at genesis.
The merge was chosen as the cutoff because it is a clear, easily identified point. Earlier cutoffs or narrower edge-case lists were considered and rejected as unnecessarily complicated.
Sample code
The definition, and the code path implementers no longer need for post-merge blocks (pseudocode):
def is_empty(account) -> bool:
return account.nonce == 0 and account.balance == 0 and len(account.code) == 0
# EIP-161 rule: at the end of a transaction, delete touched accounts that are empty.
# Under EIP-7523, post-merge state can never contain an empty account,
# so this cleanup can never fire and need not be implemented for post-merge-only clients.
def destroy_touched_empty_accounts(state, touched):
for addr in touched:
if addr in state and is_empty(state[addr]):
del state[addr]
Things to know
- Status is Last Call: it is close to final but not yet Final.
- It is a clean-up rule, not a fork that changes execution. No transaction behaves differently.
- Its validity depends on the claim that all Mainnet empty accounts were cleared before the merge; the spec asks that this be independently verified.
- Private or test networks deliberately configured with empty accounts in genesis will cause problems with tooling and clients that rely on this rule.
- Related clean-up of historical edge cases: EIP-7610 handles contract creation at addresses with non-empty storage.