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.
Background
EIP-3529 removed the gas refund for SELFDESTRUCT and reduced the refund for clearing a storage slot with SSTORE. It also changed the maximum refund per transaction. This article explains why Ethereum made those changes and what still qualifies for a refund.
This article explains the proposal linked below.
I also cover other Ethereum proposals in the index.
Overview
Ethereum uses gas to measure the execution resources a transaction consumes. Different types of transaction can use different amounts of gas.
SELFDESTRUCT and SSTORE are EVM instructions. Before EIP-3529, SELFDESTRUCT could remove a contract and send its remaining Ether to a designated address, earning a refund intended to encourage state cleanup. This describes the historical context of the proposal. The opcode's account-deletion behavior was later restricted by EIP-6780. SSTORE updates contract storage and can qualify for a refund under specific conditions, including when a nonzero value is set to zero.
EIP-3529 removed the SELFDESTRUCT refund and lowered the SSTORE clearing refund. It retained a clearing incentive without allowing the slot to serve as an effective way to save gas for use in another transaction. Strategies such as preparing contracts when gas prices were low and removing them when prices rose could save money for individual users while creating extra work for the network.
Motivation
Ethereum introduced gas refunds to encourage developers to clear storage and contracts they no longer needed. The benefits were smaller than expected, and refunds had several unintended effects.
Good state hygiene means managing a program's state and freeing data or resources when they are no longer needed.
Removing unused data
Remove data or release objects the program no longer uses to avoid unnecessary memory use.
Releasing resources
Close files and database connections after use. This returns resources to the system and avoids leaks.
Managing cache use
Keep a cache large enough for useful data without letting it consume resources the program needs elsewhere.
Making state management explicit
Keep track of which component owns each piece of state and when the state changes. This helps avoid inconsistent or unexpected behavior.
Following memory-management practices
In garbage-collected languages, remove references to objects that should be collected. In languages such as C or C++, release memory allocated by the program when its lifetime ends.
These practices are especially important in long-running applications and large systems, where small leaks can affect performance or stability over time.
Problems with gas refunds
The rise of GasToken
GasToken let users shift some gas expenditure from high-price periods to low-price periods. It treated blockchain state as a place to store claims on future gas refunds, increasing state size and affecting the efficiency of block execution.
GasToken was a mechanism for reducing the total price paid for gas on Ethereum. The price of gas changes with network demand.
How GasToken worked
- During low-price periods, users created GasToken by performing operations that occupied state, such as writing to storage, when gas was relatively cheap.
- During high-price periods, users redeemed the token by triggering operations that earned refunds. The refund reduced the gas charged to the later transaction. The savings could exceed the amount paid for gas in the earlier one.
Drawbacks
- Larger state. Writing state to obtain future refunds increased how much data Ethereum clients had to maintain and could slow synchronization and processing.
- Inefficient gas use. Saving and later reclaiming gas through state changes distorted how much work Ethereum did in a block, especially during periods of high demand.
A GasToken user could pay less while imposing extra work on the network.
Greater variation in block execution work
Because refunds could cover up to 50% of a transaction's gas use, the gas returned to the block's available budget could allow subsequent transactions to execute. A block could therefore perform nearly twice the work implied by its gas limit. The additional variability was undesirable alongside EIP-1559. Refunds could keep this level of execution work going for much longer.
The “on-paper gas limit” is the block gas limit specified by the protocol. Nodes agree on the limit to manage how much work a block can include.
Under the old refund rules, the amount of gas consumed before refunds could be greater than that limit, because some of the gas used by a transaction was returned to the block budget. Each refund was limited to half the gas used by that transaction, so total execution work could approach twice the block limit. This made the work involved in processing blocks less predictable.
Summary
Refunds contributed to growth in the Ethereum state and greater variation in execution work per block. Removing the SELFDESTRUCT refund and lowering the SSTORE clearing refund addressed the incentives that gave rise to those effects.
Specification
| Parameter | Value |
|---|---|
| FORK_BLOCK | TBD |
| MAX_REFUND_QUOTIENT | 5 |
The proposal text uses FORK_BLOCK as a placeholder for activation. On Ethereum mainnet, EIP-3529 was activated as part of London. At and after activation, the following rules apply.
- Remove the refund for
SELFDESTRUCT. - Replace the EIP-2200 value of
SSTORE_CLEARS_SCHEDULEwithSSTORE_RESET_GAS + ACCESS_LIST_STORAGE_KEY_COST. The result is4,800gas under EIP-2929 and EIP-2930.
For background on EIP-2929, see the following article.
[EIP-2929] Increasing gas costs for certain opcode accesses
For background on EIP-2930, see the following article.
[EIP-2930] Access lists and the transaction type that carries them
- Cap the applied refund at
gas_used // MAX_REFUND_QUOTIENT. The previous cap wasgas_used // 2. With the quotient set to5, a transaction can recover at most one fifth of its gas use. - The new clearing refund combines the storage reset charge with the cost of an access-list storage key.
The lower refund cap makes execution work more predictable, and the instruction-level reductions discourage using gas tokens to save gas across transactions.
Rationale
EIP-2200 defines three cases where an SSTORE operation adds a refund.
Three refund cases
The original value was nonzero and the new value is zero
Clearing such a slot adds SSTORE_CLEARS_SCHEDULE to the refund counter. That was 15,000 gas before EIP-3529. The refund was intended to reward freeing state.
The original value was zero, the current value is nonzero, and the new value is zero
Restoring a slot to its original zero value adds SSTORE_SET_GAS - SLOAD_GAS, or 19,900 gas in the proposal's example. Earning it first requires spending 20,000 gas to change the same slot from zero to nonzero in the same transaction. The refund therefore cannot create a gas token.
The original value was nonzero, the current value is a different nonzero value, and the new value matches the original
Restoring the original nonzero value adds SSTORE_RESET_GAS - SLOAD_GAS, or 4,900 gas in the proposal's example. It likewise corresponds to gas already spent on the same slot. The relevant prior charge in the example is 5,000 gas.
What the EIP targets
The first case made it possible to write a nonzero value in one transaction and claim a refund for clearing it in a later one. That made gas tokens viable and increased the amount of execution a block could contain before refunds.
The objective
The aim is to prevent a storage slot from producing more gas in refunds than it costs to access and write. The design pairs each refund with an earlier charge on the same slot in the same transaction.
The solution
To ensure the total gas charge for a slot remains positive, SSTORE_CLEARS_SCHEDULE must not exceed SSTORE_RESET_GAS + ACCESS_LIST_STORAGE_KEY_COST. EIP-3529 reduces the refund to that sum.
Result
Clearing data that the transaction has not already read offers no net gas gain after the access and write costs. Clearing data the transaction has already read can still yield a net refund for that operation. This distinction keeps an incentive to remove data as part of useful work without rewarding transactions that exist primarily to collect refunds.
The proposal uses “unread” and “read” as proxies for whether a transaction had another reason to touch a slot.
What counts as “unneeded” data?
A contract can retain obsolete information from a prior transaction or data no longer needed for its current work. Clearing an unread slot still increases the refund counter if it qualifies, but after its own access and write costs there is no net gas gain. That makes it less attractive to write data just to reclaim gas later.
What counts as “useful” data?
Some slots contain information an ongoing transaction needs to read before deciding how to update its state. If that work makes a value obsolete, clearing it can still be cheaper at the margin. The EVM measures access, rather than assessing the purpose of the data directly.
Effect
Reducing the reward for storing unused data solely to clear it later discourages that use of Ethereum state. Keeping a refund for qualifying updates still improves the economics of ordinary storage use.
Compatibility
The refund changes affect what users ultimately pay for execution. This section describes the effect on EVM execution and applications.
When refunds apply
Refunds apply only after execution. They do not add gas to a call frame during execution. Removing a refund therefore does not prevent existing instructions or calls from running, but can make an application uneconomical.
Effect on gas tokens
Gas tokens relied on refunds to offset transaction execution costs. Reducing the refunds made that strategy lose its value. Applications such as DeFi arbitrage bots that used gas tokens to reduce costs no longer benefit from those integrations.
Effects on common patterns
The EIP preserves the refund for new = original = 0 != current and part of the refund for other nonzero-to-zero cases. A zero → nonzero → zero sequence in one transaction still has a marginal cost of about 100 gas under the conditions described in the proposal, before applying the transaction-wide cap and accounting for setup costs. Examples include the following.
- Reentrancy guards. The contract sets a lock from zero to one before a child call and clears it afterward.
- ERC-20 approval and transfer. An allowance changes from zero to a nonzero amount. The approved transfer consumes the allowance and resets it to zero.
The expression new = original = 0 != current is evaluated at the point of the storage write.
- Original is the slot value before the transaction began.
- Current is the slot value just before the write.
- New is the value the write will store.
- The slot starts at zero.
- The transaction temporarily writes a nonzero value.
- A later write in the same transaction sets it back to zero.
The final value equals the original, although there was a temporary modification. A refund recognizes that no new persistent value is left in the slot. This supports patterns including reentrancy locks and approval followed immediately by a transfer.
Effect on incentives to clear storage
Reducing refunds changes whether users prefer to clear a slot now or keep a small nonzero value for future use.
Incentives to clear storage
Earlier proposals such as EIP-3298 and EIP-3403 were criticized for removing the clearing incentive entirely. When any possibility of reusing the slot remains, a user might then prefer to keep it nonzero.
Example
A holder who wants to sell one unit of an ERC-20 token could transfer 0.999999 units and leave a tiny balance. If the same address later receives more tokens, changing a nonzero balance costs 5,000 gas in the proposal's example, comprising 2,100 for the read and 2,900 for the write. The Japanese article gives 20,100 gas for changing a zero balance to nonzero. The proposal uses 22,100, including the cold-access charge, which is the value behind the probability estimates below.
The previous 15,000-gas clearing refund made retaining a nonzero balance worthwhile only at a high probability of reuse. The article uses 87.7% as the break-even probability. Under EIP-3298 or EIP-3403, eliminating that reward would make retaining the slot more attractive whenever the probability was greater than zero.
Under the new refund
The 4,800-gas clearing refund retains some incentive to clear a slot. The article's break-even estimate for keeping it nonzero is 28.1%. For many wallets, the chance of reacquiring a token after selling the full balance may be lower than that.
The refund cap
Limiting refunds to one fifth of gas used bounds the increase in execution work attributable to refunds to roughly 25% of the charged gas. That limits the extra storage-write pressure a denial-of-service scenario could impose using refunds.
Tests
EIP-2929 gas costs
EIP-2929 distinguishes between warm and cold storage access. A slot is warm if it has already been accessed in the transaction or was prewarmed by the transaction's access list. The first access to a cold slot costs more. This is intended to reflect the underlying work more accurately.
The following examples assume the slots are warm. “Original” records the value at the start of the transaction, while the later columns record the values written by consecutive operations. The net column subtracts the refund counter without applying the transaction-wide refund cap. A negative value does not represent a negative transaction fee. The original article includes one misaligned row in the first table. The reduced-refund table below shows the same bytecode with all columns populated.
| Bytecode | Gas used | Refund | Original | First | Second | Third | Net gas (before refund cap) |
|---|---|---|---|---|---|---|---|
0x60006000556000600055 |
212 | 0 | 0 | 0 | 0 | 212 | |
0x60006000556001600055 |
20,112 | 0 | 0 | 0 | 1 | 20,112 | |
0x60016000556000600055 |
20,112 | 19,900 | 0 | 1 | 0 | 212 | |
0x60016000556002600055 |
20,112 | 0 | 0 | 1 | 2 | 20,112 | |
0x60016000556001600055 |
20,112 | 0 | 0 | 1 | 1 | 20,112 | |
0x60006000556000600055 |
3,012 | 15,000 | 1 | 0 | 0 | -11,988 | |
0x60006000556001600055 |
3,012 | 2,800 | 1 | 0 | 1 | 212 | |
0x60006000556002600055 |
3,012 | 0 | 1 | 0 | 2 | 3,012 | |
0x60026000556000600055 |
3,012 | 15,000 | 1 | 2 | 0 | -11,988 | |
0x60026000556003600055 |
3,012 | 0 | 1 | 2 | 3 | 3,012 | |
0x60026000556001600055 |
3,012 | 2,800 | 1 | 2 | 1 | 212 | |
0x60026000556002600055 |
3,012 | 0 | 1 | 2 | 2 | 3,012 | |
0x60016000556000600055 |
3,012 | 15,000 | 1 | 1 | 0 | -11,988 | |
0x60016000556002600055 |
212 | 0 | 1 | 1 | 1 | 212 | |
0x60016000556001600055 |
212 | 0 | 1 | 1 | 1 | 212 | |
0x600160005560006000556001600055 |
40118 | 19900 | 0 | 1 | 0 | 1 | 20218 |
0x600060005560016000556000600055 |
5918 | 17800 | 1 | 0 | 1 | 0 | -11882 |
Reduced refunds
This table changes SSTORE_CLEARS_SCHEDULE from 15,000 to 4,800 gas and assumes the removal of the SELFDESTRUCT refund.
| Bytecode | Gas used | Refund | Original | First | Second | Third | Net gas (before refund cap) |
|---|---|---|---|---|---|---|---|
0x60006000556000600055 |
212 | 0 | 0 | 0 | 0 | 212 | |
0x60006000556001600055 |
20,112 | 0 | 0 | 0 | 1 | 20,112 | |
0x60016000556000600055 |
20,112 | 19,900 | 0 | 1 | 0 | 212 | |
0x60016000556002600055 |
20,112 | 0 | 0 | 1 | 2 | 20,112 | |
0x60016000556001600055 |
20,112 | 0 | 0 | 1 | 1 | 20,112 | |
0x60006000556000600055 |
3,012 | 4,800 | 1 | 0 | 0 | -788 | |
0x60006000556001600055 |
3,012 | 2,800 | 1 | 0 | 1 | 212 | |
0x60006000556002600055 |
3,012 | 0 | 1 | 0 | 2 | 3,012 | |
0x60026000556000600055 |
3,012 | 4,800 | 1 | 2 | 0 | -788 | |
0x60026000556003600055 |
3,012 | 0 | 1 | 2 | 3 | 3,012 | |
0x60026000556001600055 |
3,012 | 2,800 | 1 | 2 | 1 | 212 | |
0x60026000556002600055 |
3,012 | 0 | 1 | 2 | 2 | 3,012 | |
0x60016000556000600055 |
3,012 | 4,800 | 1 | 1 | 0 | -788 | |
0x60016000556002600055 |
3,012 | 0 | 1 | 1 | 2 | 3,012 | |
0x60016000556001600055 |
212 | 0 | 1 | 1 | 1 | 212 | |
0x600160005560006000556001600055 |
40,118 | 19,900 | 0 | 1 | 0 | 1 | 20,218 |
0x600060005560016000556000600055 |
5,918 | 7,600 | 1 | 0 | 1 | 0 | -1,682 |
- Gas used is the amount spent before refunds in the example.
- Refund is the credit accumulated in the refund counter.
- Original, first, second, and third show the original slot value and successive values.
- Net gas subtracts the refund counter before applying the transaction-wide cap.
The tables show the reduction from 15,000 to 4,800 for clearing a qualifying slot. For example, one row for 0x60006000556000600055 changes from -11,988 to -788 before the cap. The Japanese article says that row turns positive, but its displayed values remain negative. The actual charged amount still reflects the transaction refund cap.
The reduced refund particularly affects applications that depended on large refunds to be worthwhile.
Security considerations
The change affects how much work Ethereum can process in a block and how clients can avoid unnecessary state writes.
Execution and refund accounting
Accumulated refunds do not affect the transaction's execution logic. They are applied when settling gas charges after execution.
Block gas accounting
The block gas limit bounds the charged gas used by its transactions. A transaction that sets a slot to nonzero and then restores it to zero can still receive a refund, reducing the charged gas. The refund remains subject to the overall cap.
Restoring a slot and updating the state trie
If a slot ends the transaction with its original value, it does not need a permanent state trie update. The refund offsets part of the execution charge, and the client can avoid the corresponding persistent write.
Optimizing storage writes
Clients should skip a database update when the final slot value equals its original value. This has long been useful and matters especially when contracts make temporary writes that are restored before the transaction finishes.
Citation
Vitalik Buterin (@vbuterin), Martin Swende (@holiman), “EIP-3529: Reduction in refunds,” Ethereum Improvement Proposals, no. 3529, April 2021. Available at https://eips.ethereum.org/EIPS/eip-3529.
Conclusion
EIP-3529 removed the SELFDESTRUCT gas refund, lowered the refund for clearing an SSTORE slot, and limited the total refund to one fifth of gas used. The changes made gas-token strategies uneconomical while preserving refunds for some ordinary storage patterns.
Questions are welcome by direct message.
I also publish elsewhere.


