Skip to content
Crypto.world

The Ledger

Ethereum Researcher Proposes Cheaper Replay-Protection Storage

An Ethereum Research forum post proposes packed storage lanes to reduce the cost of recording replay-protection flags. Its example estimates about 75% lower gas for 32 flags, while calling for execution-layer support for cheaper restricted writes.

Ethereum Researcher Proposes Cheaper Replay-Protection Storage

“Roots move the cost; a better-priced write would remove it.”

dlebee

An Ethereum Research post published November 2 proposes changes to how EVM applications pay to record replay-protection flags, the persistent marks that prevent a nonce, nullifier or session share from being used twice. The author argues that proof systems have reduced the cost of checking many operations, but the on-chain records that mark those operations as spent still consume storage.

The post is a design discussion, not an adopted Ethereum proposal or a change to the EVM. It asks whether applications can pack flags more efficiently and whether execution layers should offer storage operations priced for restricted, append-once updates.

Four sessions share one storage word

The post compares three layouts. A mapping from a hash to a Boolean gives each flag its own storage slot; the author estimates about 22,100 gas for each new flag under the stated assumptions. A bitmap can group 256 flags in one word when their identifiers are dense, with the first flag paying for a fresh slot and later flags costing about 5,000 gas each.

The proposed lane arrangement targets operations settled by several parties. It divides a 256-bit word into four 64-bit lanes, assigning one lane to each of four sessions and one bit within that lane to each operator. The example uses eight operators settling shares of a session, so each session’s lane records which operators have already settled.

For four sessions and eight operators—32 flags in total—the author’s calculation puts the separate-slot layout at about 707,200 gas. The packed layout is estimated at about 177,100 gas: one fresh write followed by 31 cheaper bit updates. That is roughly 75% less in this example, not a benchmark of a deployed system.

Sequential identifiers make the savings possible

The design computes a storage key from an entity identifier and the sequence number shifted right by two bits. That groups four consecutive operations for the same entity into one word. The author says the example could fit connectivity settlements handled by multiple independent operators, but presents the pattern as applicable more broadly.

Its savings depend on sequence numbers clustering as expected. Gaps can leave bits unused and reduce the benefit; unpredictable, hash-based nullifiers cannot generally be grouped by locality. The post also notes that lane widths are fixed at deployment: a 64-bit lane accommodates up to 64 parties, while a smaller group leaves unused bits.

The request is for cheaper writes, not just tighter packing

Even after packing, the post estimates that each later flag costs about 5,000 gas, while the first flag still pays for a fresh slot. The author argues that no storage geometry can beat those costs on its own, and warns that higher state charges under proposed repricing models could make the problem harder.

One alternative is to keep flags off-chain and publish a root, then require users to prove membership or non-membership when they claim. The post argues that this shifts proof, calldata and verification costs to the claim stage rather than necessarily reducing total lifecycle gas; it also raises the question of who maintains the set behind the root.

Instead, the author asks whether the execution layer could price append-once bit updates near their marginal cost, or offer span allocation, bulk storage access or lower pricing for restricted writes such as monotonic counters and insert-only sets. Such a change would concern the EVM execution layer, the post says, and could apply to L2s and L3s that run the EVM as well as mainnet. The open issue is whether those cheaper writes can be introduced without undermining efforts to price persistent state growth.

Sources

  1. Original source Ethereum Research ethresear.ch

Related stories

Explore

More articles