What Was EIP-158? Cleaning Up Ethereum's Empty Accounts
EIP-158 removed Ethereum's empty accounts to fight state bloat after 2016's spam attacks — a history lesson in managing blockchain state growth.
EIP-158 (also known as "State Clearing") is an Ethereum protocol change activated in the October 2016 Spurious Dragon hard fork that removed empty accounts from the network's state trie, reducing the disk space nodes needed to store and process the chain after a wave of spam transactions had bloated it.
It's a niche, decades-old proposal by crypto standards, but it's a genuinely useful case study: it shows how a blockchain actually responds when someone finds a way to attack it economically rather than cryptographically, and it's a preview of the "state growth" problem that still shapes Ethereum's roadmap today.
The problem: the 2016 spam attacks
In September and October 2016, an attacker exploited the fact that gas costs for certain opcodes were priced far below their actual computational and storage burden on the network. By repeatedly calling operations that created large numbers of near-empty accounts, the attacker could bloat every full node's state database cheaply while barely paying for it — a classic case of a fee structure that didn't match real resource costs.
This wasn't a hack in the sense of stolen funds. Nobody's money was at risk. It was an availability attack: node sync times ballooned, some clients crashed under memory pressure, and the health of the network itself was the target.
What EIP-158 actually did
Ethereum's state trie is the giant lookup structure mapping every account (and every smart contract's storage) to its current balance, nonce, code, and storage root. Every full node keeps a copy. The bigger it gets, the more expensive it is to run a node — more disk, more memory, slower syncs.
EIP-158 introduced a rule: any account with zero balance, zero nonce, and no code — an "empty" account — gets automatically removed from the state trie. Combined with a companion change (EIP-161) that adjusted how new empty accounts got created in the first place, this let nodes prune out the huge number of junk accounts the spam attack had generated, shrinking state size back down.
It shipped alongside other gas repricing fixes in the same fork family (EIP-150 and EIP-160) that raised the gas cost of the specific opcodes the attacker had exploited, so the underlying incentive to spam accounts in the first place was also removed.
Why this matters beyond the history lesson
State growth is a permanent, structural problem for any blockchain that stores account and contract data forever by default — it's one of the underlying tensions in the scalability trilemma. Every byte written to state has to be kept, synced, and served by every full node indefinitely, while transaction fees for writing that byte are a one-time payment. That mismatch is the same root issue that made the 2016 spam attack possible, and it's why Ethereum's research roadmap still includes ideas like state expiry and stateless clients years later.
EIP-158 is a useful historical marker because it was the first time this problem became acute enough to force an emergency-style protocol response, rather than a theoretical concern discussed in research papers.
How it compares to Ethereum's later scaling responses
| Response | Era | What it addressed |
|---|---|---|
| EIP-158 state clearing | 2016 | Removed junk empty accounts from state after a spam attack |
| EIP-150/160 gas repricing | 2016 | Fixed underpriced opcodes that made the spam attack cheap |
| Gas limit adjustments | Ongoing | Caps how much state/computation is added per block |
| Statelessness research (Verkle trees) | 2020s–ongoing | Long-term plan to let nodes verify blocks without storing full state |
| Rollup-centric roadmap | 2020s–ongoing | Moves execution off Ethereum's base Layer 1, reducing what base-layer state has to hold |
Bottom line
EIP-158 isn't relevant to anyone's day-to-day use of Ethereum today — it's ancient history to a chain that has since gone through the Merge, the Dencun upgrade, and a full proof-of-stake transition. But it's worth knowing about because it's the clearest early proof that blockchain state isn't free, that fee structures have to track real resource costs or they get exploited, and that "just add more disk" isn't a scaling strategy — problems Ethereum is still actively solving through rollups, Layer 2s, and ongoing state-management research rather than one-off patches.
Related articles
This article is for educational purposes only and is not financial advice. DeFi involves significant risk, including total loss of funds. Always do your own research.