---
eip: 8125
label: EIP-8125
title: Temporary Contract Storage
status: Draft
type: Standards Track
category: Core
created: 2026-01-14
requires: 2200, 2929
official: https://eips.ethereum.org/EIPS/eip-8125
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8125.md
canonical: https://eips.huatuo.xyz/eip-8125/
lang: en
tldr: "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."
tags: [evm, storage, state-growth, opcodes, core]
---

# EIP-8125: Temporary Contract Storage

> Adds bounded-lifetime contract storage via TMPLOAD/TMPSTORE opcodes that is automatically cleared on a fixed schedule.

**TL;DR:** 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](/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)` and `TMPLOAD(key)`, scoped to the executing contract like `SSTORE`/`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_PERIOD` blocks. The two system accounts take turns being "current" and "previous". At the first block of a new period, the account becoming current has its `storageRoot` reset to empty, a constant-time operation.
- `TMPSTORE` writes non-zero values to the current account; writing `0` deletes the slot from both accounts.
- `TMPLOAD` reads 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:

```python
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.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8125
