---
eip: 8517
title: Post-Quantum Validator Seed Derivation
description: Derives the post-quantum seeds of Ethereum validators and builders from a mnemonic
author: Manu Nalepa (@nalepae)
discussions-to: https://ethereum-magicians.org/t/erc-8517-post-quantum-validator-seed-derivation/30516
status: Draft
type: Standards Track
category: ERC
created: 2026-11-24
---

## Abstract

This standard defines how the post-quantum secrets of an Ethereum validator or builder are derived from a seed, usually a [BIP-39](https://github.com/bitcoin/bips/blob/43ce3a461dfb48e62ffa0cfc70f5f54d1eb5c577/bip-0039.mediawiki) mnemonic. It replaces [ERC-2333](./eip-2333.md) and [ERC-2334](./eip-2334.md) for these secrets.

A tree of keys is built from the seed by hardened-only derivation with HMAC-SHA512, the hash-based message authentication code (HMAC) over SHA-512. The key of the node at path `m/5326/3600/<chain_id>/<role>/<account>` is the *account seed* of one validator or builder on one network. Networks have separate subtrees, and validators and builders have separate roles within each network. Two seeds are expanded from an account seed with the HMAC-based key derivation function (HKDF): the seed of the leanXMSS signing key, and the seed of the verifiable random function (VRF) tree. All the post-quantum keys of a validator are therefore recoverable from the mnemonic, its network, its role and its account index.

## Motivation

[ERC-2333](./eip-2333.md) derives BLS12-381 secret keys, and [ERC-2334](./eip-2334.md) assigns them paths. Post-quantum consensus replaces BLS with leanXMSS, a stateful hash-based signature scheme, and with a hash-based VRF. Both are generated from 32-byte seeds rather than from scalars of a curve. Validators register a leanXMSS public key and a VRF root for each of their indices.

Without a standard derivation, each tool generates these seeds from fresh randomness. Every key then needs its own backup, and a validator cannot recover its post-quantum keys from the mnemonic it already holds. A standard derivation gives every tool the same keys from the same mnemonic. It also lets a stake owner who holds the mnemonic build the whole registration, including the proof of possession, for a validator run by another party.

## Specification

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.

### Notation

* `a || b` is the concatenation of the octet strings `a` and `b`.
* `I2OSP(n, l)` is the big-endian encoding of the non-negative integer `n` in `l` octets, as in RFC 8017.
* `HMAC-SHA512(key, data)` is HMAC (RFC 2104) with SHA-512.
* `HKDF-Expand(prk, info, l)` is the expand step of HKDF (RFC 5869) with SHA-256.
* `x[a:b]` is the octet string of the octets of `x` at positions `a` to `b - 1`.

### Constants

| Name | Value |
| - | - |
| `MASTER_KEY_DOMAIN` | `"Ethereum PQ seed"` (ASCII, 16 octets) |
| `PQ_PURPOSE` | `5326` |
| `COIN_TYPE` | `3600` |
| `HARDENED_OFFSET` | `2**31` |
| `ROLE_VALIDATOR` | `0` |
| `ROLE_BUILDER` | `1` |
| `XMSS_SEED_INFO` | `"leanXMSS key"` (ASCII, 12 octets) |
| `VRF_SEED_INFO` | `"VRF key"` (ASCII, 7 octets) |

### Seed

The `seed` is an octet string of 16 to 64 octets. An implementation MUST refuse a seed outside this range. The `seed` SHOULD be the 64-octet BIP-39 seed of the mnemonic and its passphrase: PBKDF2 with HMAC-SHA512, 2048 iterations, the UTF-8 encoding of the NFKD-normalized mnemonic as password, and the UTF-8 encoding of `"mnemonic"` followed by the NFKD-normalized passphrase as salt. The mnemonic SHOULD have 24 words, which carry 256 bits of entropy. A seed that does not come from a mnemonic SHOULD carry at least 256 bits of entropy (see [Quantum security of the derivation](#quantum-security-of-the-derivation)). A validator that already holds an [ERC-2333](./eip-2333.md) mnemonic SHOULD use the same mnemonic and passphrase. Its BLS and post-quantum keys then share one backup. It MAY instead use a different mnemonic (see [Separate mnemonics](#separate-mnemonics)).

### Nodes

A node of the tree is a pair `(key, chain_code)` of two 32-octet strings.

The master node of `seed` is:

```text
master(seed):
    I = HMAC-SHA512(MASTER_KEY_DOMAIN, seed)
    return (I[0:32], I[32:64])
```

The child of index `index` of the node `(key, chain_code)` is, for `0 <= index < HARDENED_OFFSET`:

```text
child((key, chain_code), index):
    I = HMAC-SHA512(chain_code, 0x00 || key || I2OSP(index + HARDENED_OFFSET, 4))
    return (I[0:32], I[32:64])
```

Every child is hardened: knowing a child node, its siblings or other nodes of the tree does not reveal its parent. An implementation MUST refuse an `index` outside `[0, HARDENED_OFFSET)`.

### Path

A path is written `m / i_1 / i_2 / ... / i_n`. `m` is the master node, and `i_k` is the index of the child taken at depth `k`. Every level is hardened. Paths are written without the `'` marker of [BIP-32](https://github.com/bitcoin/bips/blob/43ce3a461dfb48e62ffa0cfc70f5f54d1eb5c577/bip-0032.mediawiki): the index `i` of a path is the child index `i + HARDENED_OFFSET`.

`chain_id` is the `DEPOSIT_CHAIN_ID` of the consensus configuration of the network on which the keys are used, as defined in the [deposit contract specification](https://github.com/ethereum/consensus-specs/blob/5fa6edcca8ab4cf548653e6680b17b9d3e04d225/specs/phase0/deposit-contract.md). It is the [EIP-155](./eip-155.md) chain ID of the execution layer of that network. For example, `chain_id` is `1` for mainnet. It MUST satisfy `1 <= chain_id < HARDENED_OFFSET`. An implementation MUST refuse a `chain_id` outside this range, and MUST NOT reduce or hash it into the range.

`role` is `ROLE_VALIDATOR` for a validator and `ROLE_BUILDER` for a builder. Other values of `role` are reserved for future roles. An implementation MUST refuse a `role` that it does not support.

The *account seed* of network `chain_id`, role `role` and account `account`, for `0 <= account < HARDENED_OFFSET`, is the `key` of the node at path `m / PQ_PURPOSE / COIN_TYPE / chain_id / role / account`:

```text
node = master(seed)                       # m
node = child(node, PQ_PURPOSE)            # m / PQ_PURPOSE
node = child(node, COIN_TYPE)             # m / PQ_PURPOSE / COIN_TYPE
node = child(node, chain_id)              # m / PQ_PURPOSE / COIN_TYPE / chain_id
node = child(node, role)                  # m / PQ_PURPOSE / COIN_TYPE / chain_id / role
(key, chain_code) = child(node, account)  # m / PQ_PURPOSE / COIN_TYPE / chain_id / role / account
account_seed = key
```

The `chain_code` of that node is not used.

`account` plays the role of the account index `i` of [ERC-2334](./eip-2334.md): the `account`-th validator, or the `account`-th builder, of the seed on a network. Each network and role has its own range of accounts, starting at `0`. A tool that derives both BLS and post-quantum keys for a validator from the same seed SHOULD use the same index for both.

### Seeds of the keys

The leanXMSS seed and the VRF seed of an account seed `account_seed` are:

```text
xmss_seed = HKDF-Expand(account_seed, XMSS_SEED_INFO, 32)
vrf_seed  = HKDF-Expand(account_seed, VRF_SEED_INFO, 32)
```

A builder has no VRF tree. A builder's tool MUST NOT require a VRF seed, and it MAY skip deriving it.

### Keystores

A keystore of these keys SHOULD encrypt the account seed, and SHOULD record the path from which it was derived. The path includes the network and the role. Both the leanXMSS seed and the VRF seed are expanded from it. One keystore therefore holds the keys of one account.

## Rationale

### Hardened HMAC-SHA512 derivation

[ERC-2333](./eip-2333.md) derives every child through a Lamport public key, and outputs a scalar modulo the order of BLS12-381. The Lamport step was a commitment for a post-quantum backup of BLS keys. Post-quantum keys need no such backup, and the reduction modulo the order of a curve has no meaning for a 32-octet seed. Each level of ERC-2333 also costs more than 500 SHA-256 evaluations, which matters on hardware wallets and in zero-knowledge proofs of key derivation.

The derivation of this standard is the hardened derivation of SLIP-0010 (`slip-0010.md` in the satoshilabs/slips repository at commit `a00312491693714d9bc1b6e4cb5b2e356e6c511e`), used for Ed25519 keys and already implemented by hardware wallets and libraries. Ed25519 keys and leanXMSS seeds are both arbitrary 32-octet strings: no key is rejected and no derivation is retried. Only the domain of the master node differs. Each level costs two SHA-512 evaluations of HMAC.

The distinct `MASTER_KEY_DOMAIN` makes the tree of this standard disjoint from every SLIP-0010 tree of the same seed, whatever the path.

### One account seed per account

Each registration binds one leanXMSS public key and one VRF root, both derived from one account seed. Deriving both seeds from one node lets one keystore hold both, with one secret. HKDF with distinct `info` strings keeps the two seeds independent. Builders, which have no VRF, only derive the leanXMSS seed.

### Separate networks

A leanXMSS key used on two networks signs different messages at the same leaves: the signing domain of each message includes its network. This allows forgeries (see [Reuse of leanXMSS leaves](#reuse-of-leanxmss-leaves)). Operators commonly use one mnemonic on a testnet and on mainnet, and start at `account = 0` on both. Without a network level, both networks would get the same keys. The `chain_id` level puts each network in its own subtree. The keys of one seed on two networks with different chain IDs are therefore always different, whatever their accounts. A tool given the wrong network derives keys that do not match the registration of the validator, which is detected, rather than keys that are reused.

The level is above the account seed. A keystore therefore holds the secret of one network only, and loading it on another network cannot reuse its keys there.

### Separate roles

A validator and a builder that shared a leanXMSS key would both sign at the same slots. The same leaves would then sign different messages, which allows forgeries, as on two networks. Without a `role` level, a validator tool and a builder tool that both start at `account = 0` would derive the same key from the same seed. The `role` level puts each role in its own subtree. A validator and a builder of the same seed therefore never share a key, whatever their accounts.

### Path

* `PQ_PURPOSE` is `5326`, the word "lean" typed on a phone keypad (L = 5, E = 3, A = 2, N = 6). The purpose names Lean Ethereum, whose post-quantum signature scheme is leanXMSS, in the way the purpose `12381` of [ERC-2334](./eip-2334.md) names the curve BLS12-381. The value itself carries no security: the distinct `MASTER_KEY_DOMAIN` already separates this tree from every other tree of the same seed. It only leaves room for other families of post-quantum keys under the same master node.
* `COIN_TYPE` keeps the `3600` of [ERC-2334](./eip-2334.md): the keys are consensus keys of the same chain.
* `chain_id` separates networks (see [Separate networks](#separate-networks)).
* `role` separates validators from builders (see [Separate roles](#separate-roles)). Reserved values leave room for future roles.
* The `use` level of [ERC-2334](./eip-2334.md), and the level below it, are dropped. ERC-2334 uses them only to place the withdrawal key at `use` `0` and the signing key at its `0`th child. Post-quantum withdrawal credentials are execution addresses, and the two seeds of one account are split by HKDF.

### Separate mnemonics

Reusing the mnemonic of the BLS keys is a convenience, not a requirement. Nothing in this standard links the post-quantum keys of a validator to its BLS keys, and a stake owner may derive them from a different mnemonic, with any free `account` of the same network and role.

## Backwards Compatibility

This standard defines a new tree, disjoint from the trees of [ERC-2333](./eip-2333.md) and of BIP-32 and SLIP-0010 for other curves. It changes no existing key. A mnemonic created for [ERC-2333](./eip-2333.md) can be reused as is.

## Test Cases

`seed` is the BIP-39 seed of the mnemonic and passphrase when they are given. All values are hexadecimal, except paths.

### Test Case 0

Mainnet, validator, account `0`.

```text
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
passphrase = "TREZOR"
seed = c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04
master_key = 677bd6e9a2326115c3ab6bba3b781135e055220703b4049b3a68f3b44e3bc6ce
master_chain_code = 608452b43eb5cffb4c40cad053235bd7daae1dcab03c53ccdfea69a7e92982ce
path = m/5326/3600/1/0/0
account_seed = 78897286a417216b2c8fed7023496767bff03e25ce194c3c8123ab1a93feaed1
xmss_seed = aa81fb7ad2abaadad451a643181480e0c96b3edbfd71a09aea5fe5032072227e
vrf_seed = e5048c4e07939596458c5b78ce63143c8ba44d228254ab5d8e8325349d740b42
```

### Test Case 1

Mainnet, validator, account `1`.

```text
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
passphrase = "TREZOR"
path = m/5326/3600/1/0/1
account_seed = 6f2f82f43e691d722ec3b2c3c6acd4e27e171089c32147e5b9287d18be9c34c1
xmss_seed = 635f163bd9e56ed4bfd6728a222848d9b165dc239f14addaa92f0831549555bb
vrf_seed = 8d3511f06d95a8e1a6ec04693bb5ad23c6315981472872529f70ef95795f528b
```

### Test Case 2

Mainnet, builder, account `0`. The network and the account index are the same as in Test Case 0, and the keys differ.

```text
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
passphrase = "TREZOR"
path = m/5326/3600/1/1/0
account_seed = c7e588290de2bacb01c12a2fdab2e5cb7d92d3eaa0ca7dd4964cc5dadc0004c6
xmss_seed = 00d635c0a0c0ff0790158dde24c629ccfdf0e91ee5d3d871fc902a470b68c203
```

### Test Case 3

Hoodi, validator, account `0`. The role and the account index are the same as in Test Case 0, and the keys differ.

```text
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
passphrase = "TREZOR"
path = m/5326/3600/560048/0/0
account_seed = 0c605f1757ec93579bd21b36fc405485831805b12c83f7192a6d8e2e2288f029
xmss_seed = 0e3230b57757ab5f11b934431ddf1e487ef36d66bbd334b00aec0e70f95345ea
vrf_seed = 170aed89e7a5927d5d51f4879f26c35f20fc09fdc4d921bae4e9decd336b8e53
```

### Test Case 4

Largest chain ID, validator, largest account.

```text
seed = 3141592653589793238462643383279502884197169399375105820974944592
master_key = 4c6871abf495324e1cc4cf7822d24dcfca7e268cd86fb81c79447a3bfe33d433
master_chain_code = 3f1a9d39e9ecb890cc8f41786055e60eef457d02d00c3f330379057556eb5965
path = m/5326/3600/2147483647/0/2147483647
account_seed = 467efb6bfc0ee03abf8895395464b3b44600de04dd19d1454ca105ddccc3d0c6
xmss_seed = 3379ba16de185155bdb07f291453a6bd7892c2ec2bd18ee4133d849a38b29ca6
vrf_seed = 44c79c2244df1d8e6b4b30393e223681ed1e6f60c8d74640a63dcd7841b49ca6
```

## Reference Implementation

```python
import hashlib
import hmac
import unicodedata

MASTER_KEY_DOMAIN = b"Ethereum PQ seed"
PQ_PURPOSE = 5326
COIN_TYPE = 3600
HARDENED_OFFSET = 2**31
ROLE_VALIDATOR = 0
ROLE_BUILDER = 1
XMSS_SEED_INFO = b"leanXMSS key"
VRF_SEED_INFO = b"VRF key"


def mnemonic_to_seed(mnemonic: str, passphrase: str = "") -> bytes:
    mnemonic = unicodedata.normalize("NFKD", mnemonic)
    passphrase = unicodedata.normalize("NFKD", passphrase)
    return hashlib.pbkdf2_hmac("sha512", mnemonic.encode(), ("mnemonic" + passphrase).encode(), 2048)


def derive_master_node(seed: bytes) -> tuple[bytes, bytes]:
    assert 16 <= len(seed) <= 64
    i = hmac.new(MASTER_KEY_DOMAIN, seed, hashlib.sha512).digest()
    return i[:32], i[32:]


def derive_child_node(key: bytes, chain_code: bytes, index: int) -> tuple[bytes, bytes]:
    assert 0 <= index < HARDENED_OFFSET
    data = b"\x00" + key + (index + HARDENED_OFFSET).to_bytes(4, "big")
    i = hmac.new(chain_code, data, hashlib.sha512).digest()
    return i[:32], i[32:]


def derive_account_seed(seed: bytes, chain_id: int, role: int, account: int) -> bytes:
    assert 1 <= chain_id < HARDENED_OFFSET
    assert role in (ROLE_VALIDATOR, ROLE_BUILDER)
    key, chain_code = derive_master_node(seed)
    for index in (PQ_PURPOSE, COIN_TYPE, chain_id, role, account):
        key, chain_code = derive_child_node(key, chain_code, index)
    return key


def hkdf_expand(prk: bytes, info: bytes, length: int) -> bytes:
    output, block, counter = b"", b"", 1
    while len(output) < length:
        block = hmac.new(prk, block + info + bytes([counter]), hashlib.sha256).digest()
        output += block
        counter += 1
    return output[:length]


def derive_xmss_seed(account_seed: bytes) -> bytes:
    return hkdf_expand(account_seed, XMSS_SEED_INFO, 32)


def derive_vrf_seed(account_seed: bytes) -> bytes:
    return hkdf_expand(account_seed, VRF_SEED_INFO, 32)
```

## Security Considerations

### Independence from BLS keys

The only input shared with [ERC-2333](./eip-2333.md) keys is the root seed. Recovering a BLS secret key, for example with a quantum computer, reveals nothing about the tree of this standard.

### Quantum security of the derivation

The derivation only uses HMAC-SHA512, HKDF with SHA-256, and Password-Based Key Derivation Function 2 (PBKDF2) with HMAC-SHA512 for the mnemonic. Its security is bounded by the entropy of the mnemonic. Each published leanXMSS signature reveals values computed from the seed. An adversary can therefore check a guessed mnemonic by running the derivation and comparing it to a signature. Grover's algorithm finds a mnemonic of `n` bits of entropy in about `2**(n/2)` such checks.

* A 24-word mnemonic carries 256 bits of entropy, and keeps about 128 bits of security against a quantum adversary.
* A 12-word mnemonic carries 128 bits of entropy, and keeps only about 64 bits of security. The 2048 iterations of PBKDF2 add about 11 bits to the cost of each check.

### Reuse of leanXMSS leaves

leanXMSS is stateful: a key that signs two different messages at the same leaf allows forgeries. The seed does not record which leaves a key has signed at. Restoring a key from its seed is safe, but signing with it requires the signing history of the key.

### Seed compromise

The root seed and the master node give access to every key of every account. Knowing an account seed reveals no other node of the tree.

## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).
