---
eip: 8310
label: EIP-8310
title: Post-Quantum Keystore for Stateful Keys
status: Draft
type: Standards Track
category: Interface
created: 2026-06-19
requires: 2335, 3076
official: https://eips.ethereum.org/EIPS/eip-8310
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8310.md
canonical: https://eips.huatuo.xyz/eip-8310/
lang: en
tldr: A keystore format (version 5) for post-quantum XMSS validator keys that can only sign each leaf once, with strict rules on where signing state lives and how keys are backed up and restored.
tags: [post-quantum, keystore, xmss, validators, staking]
---

# EIP-8310: Post-Quantum Keystore for Stateful Keys

> A keystore format for XMSS and other consumable signing keys, defining state authority, durability ordering, and safe import/export.

**TL;DR:** A keystore format (version 5) for post-quantum XMSS validator keys that can only sign each leaf once, with strict rules on where signing state lives and how keys are backed up and restored.

## What problem does it solve?

Validators today store BLS keys in [ERC-2335](/eip-2335/) keystores. Those keys are **reusable**: the file never changes, can be copied to another machine, and can be restored from any backup.

Lean Ethereum plans to replace BLS with **XMSS**, a hash-based, post-quantum signature scheme. XMSS keys are **consumable**: every signature uses a one-time leaf, and signing two different messages with the same leaf lets an attacker forge signatures, destroying the key, possibly with no visible on-chain penalty. Copying the key to two machines, or restoring an old backup, becomes dangerous. EIP-8310 keeps the 2335 container but adds the state-management rules a consumable key needs.

## How it works

- **Version 5 keystore.** Cipher must be AES-256 class (`aes-256-gcm` recommended; `aes-128-ctr` forbidden), and `argon2id` is allowed as a KDF. The encrypted payload is the XMSS **seed**, not live signing state.
- **`scheme` object.** Immutable parameters needed to regenerate the public key and verify signatures: scheme name (`leanxmss`), hash identifier, tree height, encoding, Winternitz base, dimension, target sum, `index_mode` and lifetime. Readers must refuse unknown schemes.
- **`state` snapshot.** Shows capacity and high-water mark for operators, but must always say `"authoritative": false`. It is never used when signing.
- **Where the real state lives.** In *synchronized* mode the leaf is derived from the epoch or slot, so the [EIP-3076](/eip-3076/) slashing-protection database is authoritative: "never double-sign a slot" equals "never reuse a leaf", and key and history must move together. In *counter* mode (off-protocol signing such as builder bids) a dedicated atomic store keyed by keystore UUID holds the counter.
- **Commit before sign.** The advanced high-water mark must be durably written (flushed and atomically committed) before a signature is released, so a crash can never cause reuse.
- **Reserved ranges.** The leaf space can be split into disjoint ranges, each owned by one signer instance, for concurrent signers. Exhausting a range means refusing to sign.
- **Recover vs. resume.** Recovering the key from the seed is always safe; resuming signing needs the latest authoritative state. Importing with empty state is a hard error, and a detected high-water regression blocks signing.

## Sample code

Shape of a v5 keystore (other ERC-2335 fields such as `crypto`, `pubkey`, `uuid` omitted):

```json
{
  "version": 5,
  "scheme": {
    "name": "leanxmss",
    "params": {
      "hash": "<hash identifier>",
      "tree_height": 32, "hypertree_layers": 1,
      "encoding": "target_sum", "winternitz_w": 8, "dimension": 46, "target_sum": 200,
      "index_mode": "synchronized", "activation_epoch": 0, "lifetime_leaves": 4294967296
    }
  },
  "state": {
    "authoritative": false,
    "authority": "slashing-protection",
    "high_water": 12345,
    "reserved_ranges": []
  }
}
```

Commit-before-sign ordering:

```python
def sign(msg, leaf):
    hw = store.high_water()            # authoritative store, never the file
    if leaf <= hw:
        raise RefuseToSign("leaf reuse")
    store.write_and_fsync(leaf)        # durable before release
    sig = xmss_sign(seed, leaf, msg)
    return sig
```

## Things to know

- **Status: Draft** (category: Interface). Test cases and a reference implementation are still marked "to be added", and the concrete hash function (for example Poseidon over KoalaBear) is still under evaluation.
- v5 is not readable by v4 tools, by design: a v5-aware client must never treat a consumable key as a reusable one.
- The biggest operational risk is restoring a stale backup and signing. Back up the seed, but always reconcile with the latest state before resuming.
- Keys have finite capacity (for example 2^32 leaves with these parameters); monitor remaining leaves.


---

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