EIP-8125 · Draft · Core · 2026-01-14
EIP-8125: Temporary Contract Storage
Adds TMPLOAD/TMPSTORE opcodes for contract storage that survives across transactions and blocks but is wiped automatically on a fixed schedule, giving short-lived data a home that does not grow Ethereum's state forever.
What problem does it solve?
Contracts today have two places to keep data: permanent storage (SSTORE), which stays in the state forever unless explicitly deleted, and transient storage (EIP-1153), which is gone at the end of the transaction. Many applications need something in between: data that matters for a while (minutes, days) and then becomes useless. They put it in permanent storage, and most of it is never cleaned up. The spec cites data showing over 60 % of storage slots are written once and never accessed again.
Temporary storage gives that data a bounded lifetime, so nodes do not carry it forever.
How it works
- Two new opcodes:
TMPSTORE(key, value)andTMPLOAD(key), scoped to the executing contract likeSSTORE/SLOAD. - Values live in the storage tries of two reserved system accounts, under the slot
keccak256(contract_address || key). - Time is split into periods of
TEMP_STORAGE_PERIODblocks. The two system accounts take turns being "current" and "previous". At the first block of a new period, the account becoming current has itsstorageRootreset to empty, a constant-time operation. TMPSTOREwrites non-zero values to the current account; writing0deletes the slot from both accounts.TMPLOADreads from the current account and falls back to the previous one.
The result: anything written is readable for at least one full period and at most two, regardless of when in the period it was written. Gas is meant to be well below SSTORE/SLOAD but above TSTORE/TLOAD, with no refunds for clearing; exact values are still TBD.
Sample code
The opcodes have no Solidity syntax yet; the rollover logic as pseudocode:
def period_index(n):
return (n - FORK_BLOCK) // TEMP_STORAGE_PERIOD
def accounts(n):
if period_index(n) % 2 == 0:
return ADDR_0, ADDR_1 # (current, previous)
return ADDR_1, ADDR_0
def on_block_start(block, parent):
if period_index(block.number) > period_index(parent.number):
current, _ = accounts(block.number)
state[current].storage_root = EMPTY_TRIE_ROOT # drop data older than one period
def tmpload(contract, key, n):
cur, prev = accounts(n)
slot = keccak256(contract + key)
return state[cur].storage.get(slot) or state[prev].storage.get(slot, 0)
Things to know
- Status is Draft. The period length, system addresses, fork block and all gas costs are still TBD.
- Contracts must treat temporary storage as ephemeral and handle entries that have already expired.
- Unlike transient storage, the data does persist across transactions and blocks, so it still costs nodes something; gas must be calibrated to avoid disk I/O DoS.
- Requires a hard fork; existing opcodes are unchanged.