---
eip: 8188
label: EIP-8188
title: Last-Written Block for Accounts and Slots
status: Draft
type: Standards Track
category: Core
created: 2026-03-10
requires: 8037
official: https://eips.ethereum.org/EIPS/eip-8188
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8188.md
canonical: https://eips.huatuo.xyz/eip-8188/
lang: en
tldr: Adds a consensus-level last_written_block field to every account and storage slot, giving all clients the same reliable signal of which state is actively changing so they can tier storage, with no gas changes.
tags: [core, state, storage, clients, state-growth]
---

# EIP-8188: Last-Written Block for Accounts and Slots

> Records the last-written block number of each account and storage slot as consensus-level state metadata.

**TL;DR:** Adds a consensus-level last_written_block field to every account and storage slot, giving all clients the same reliable signal of which state is actively changing so they can tier storage, with no gas changes.

## What problem does it solve?

Ethereum's state keeps growing, but most of it is rarely touched. Clients would like to keep the "hot", frequently rewritten part of state in fast, write-optimised storage and push the rest into dense, cheaper storage. Today they can only guess what is hot using local caches and snapshots, which differ from node to node and cannot be used for anything consensus-relevant.

EIP-8188 records, in the state itself, the block number at which each account and storage slot was last modified. Every client then shares the same, verifiable notion of the recently written set. It deliberately changes no gas costs; pricing based on this field is left to separate proposals such as [EIP-8296](/eip-8296/).

## How it works

**Encoding.**

- Accounts gain a fifth RLP element: `[nonce, balance, storageRoot, codeHash, last_written_block]`.
- Storage slot values become a two-item list: `[value, last_written_block]`.
- Legacy entries (4-element accounts, bare-bytestring slots, distinguished by RLP prefix) decode with `last_written_block = 0` and keep the old encoding until first written after the fork.

**Update rule.** The field is set to the current block number whenever the entry is mutated:

- A storage write that changes a value, or creates a slot, updates the slot and its account (since the account's `storageRoot` changes). Clearing a slot to zero removes it, so only the account is updated. Writing the same value changes nothing.
- Non-zero balance transfers update sender and receiver; nonce increments and account creation update the account. `SELFDESTRUCT` follows the balance-transfer rule as defined by [EIP-6780](/eip-6780/).
- **Reads never update it** (`SLOAD`, `BALANCE`, `EXTCODE*`, non-mutating calls). Otherwise reads would become trie writes and break the [EIP-214](/eip-214/) `STATICCALL` guarantee.
- On revert, the field rolls back like any other state.

## Sample code

Decoding both legacy and new encodings (Python-style pseudocode using an RLP library):

```python
import rlp

def decode_account(raw: bytes):
    fields = rlp.decode(raw)
    nonce, balance, storage_root, code_hash = fields[:4]
    lwb = int.from_bytes(fields[4], "big") if len(fields) == 5 else 0
    return nonce, balance, storage_root, code_hash, lwb

def decode_slot(raw: bytes):
    if raw[0] >= 0xC0:                      # list: [value, last_written_block]
        value, lwb = rlp.decode(raw)
        return value, int.from_bytes(lwb, "big")
    return rlp.decode(raw), 0               # legacy bare value

def encode_slot(value: bytes, block_number: int) -> bytes:
    return rlp.encode([value, block_number])
```

## Things to know

- Status: **Draft**. It requires a hard fork, since leaf encodings and therefore state roots change, but no tree conversion.
- Size cost: about 5 extra bytes per account and 6 per storage slot for entries written after the fork. The authors' worst-case estimate is around 10.8 GB if all state were rewritten.
- It interacts with [EIP-8037](/eip-8037/) state-creation pricing; the spec recommends raising its bytes-per-new-account and per-new-slot parameters (120 to 125 and 64 to 70) to cover the new field.
- The field only enables client optimisations (separate hot and cold stores, smaller commit working set, faster cache warm-up after restart). It does not mandate any particular client design.


---

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