ERC-8519 Quantum-resistant validator keystore (Post-Quantum Validator and Builder Keystore)
Draft · Accounts & wallets · created 2026-11-25
A JSON keystore standard that encrypts, with a password, the account seed used to generate an Ethereum validator's or builder's quantum-resistant signing key (leanXMSS) and VRF tree. It preserves the ERC-2335 format and uses AES-256.
Why it is needed
In post-quantum consensus, a single validator uses two secrets, a leanXMSS signing key and a VRF tree, both derived from a single account seed defined by ERC-8517. The existing ERC-2335 only encrypts a single BLS12-381 private key with AES-128, so it cannot handle this structure. Without a standard keystore, each wallet, signer, and key management tool would encrypt seeds its own way, making it hard to move the same key between tools or to achieve compatibility across different implementations. Furthermore, AES-128's security strength drops to about 64 bits against a quantum attacker using Grover's algorithm, which is not enough for validator keys that must protect stake over the long term.
What to implement
def encode_password(password: str) -> bytes:: Normalize the password string with NFKD, strip control characters, then encode it to bytes.def decryption_key(password: bytes, kdf: dict) -> bytes:: Combine the password with the kdf module settings (scrypt or pbkdf2) to produce a 64-byte decryption key.def decrypt(keystore: dict, password: str) -> bytes:: Verify the checksum using the keystore and password, then decrypt the account seed with AES-256-CTR.
In depth
Secret: account seed
The secret that the keystore encrypts and stores is a single 32-byte (32-octet) account seed as defined by ERC-8517. From this seed, the leanXMSS signing key seed, and for validators the VRF tree seed, are derived in the way ERC-8517 specifies.
Decryption key: dklen 64 bytes
The kdf module uses scrypt or pbkdf2 as in ERC-2335, but dklen must be 64. As a result the decryption key is 64 bytes, twice the length of ERC-2335's 32-byte decryption key.
Changed location of password verification
The DK_slice used for the checksum computation was decryption_key[16:32] in ERC-2335, but in this standard it is decryption_key[32:64], the latter half of the 64-byte decryption key. pre_image = DK_slice | cipher_message is hashed with SHA-256 and compared against the stored checksum.
Secret decryption: AES-256-CTR
The cipher is counter-mode AES-256 (aes-256-ctr, RFC 3686), and the key is decryption_key[0:32], the first half of the 64-byte decryption key. params contains only iv.
scheme, pubkey, path fields
Only one scheme, "leanxmss", is currently defined, and tools MUST reject keystores with an unknown scheme. pubkey stores the 32-byte public key generated from the leanXMSS seed in plaintext as a hex string. path records the ERC-8517 path (e.g. m/5326/3600/1/0/0), and is an empty string if the path is unknown.
Public key verification and storage restrictions on load
After decrypting the keystore and deriving the leanXMSS seed, the signer MUST verify that the public key recomputed from it matches pubkey, and reject the keystore if it differs. It is RECOMMENDED to perform this decryption and verification before using pubkey to create a registration. The account seed or derived seeds MUST NOT be written to storage unencrypted below the keystore's own level of encryption, and may only be kept in memory during signing.
Signing state is managed outside the keystore
The keystore itself contains no signing state and is not modified after creation. The signer separately records which leanXMSS leaves have already been used for signing. A keystore restored from backup or imported MUST NOT be used for signing unless it is accompanied by signing history, such as the previous signer's signing-protection data, and the same keystore MUST NOT be loaded by two signers at the same time.
Version 5, still at Draft stage
The version field is fixed at 5. Version 3 is Web3 Secret Storage and version 4 is ERC-2335; tools that only read version 4 will reject this standard's keystores rather than misreading them as non-BLS keys. This ERC is currently at Draft status, an early proposal whose specifics may still change or stall.
Things to watch out for
- leanXMSS leaf reuse: Copying an ERC-2335 keystore is safe (a BLS key can sign any number of times), but a leanXMSS key becomes forgeable if the same leaf signs two different messages. Since the keystore does not record which leaf was used, restoring from backup or loading by a second signer risks re-signing with an already-used leaf.
- Password strength: The cipher and KDF protect the account seed only as well as the password's strength. Passwords with less than 128 bits of entropy are the weakest point against both classical and quantum attackers, and the test vectors' KDF parameters are minimums.
- Plaintext public material: pubkey and path are not encrypted. They reveal which validator the keystore belongs to and whether it was derived from a mnemonic, but reveal nothing about the account seed itself.
- Unverified public material: An attacker who can modify the keystore can change pubkey without knowing the password. A tool that registers a key from this field alone, without decrypting the keystore, may end up registering a key it does not control. This standard's load-time verification step only detects tampering after the keystore has been decrypted.