--- eip: 8803 title: Post-Quantum Encryption to an Account description: Encrypting data to an account under an ML-KEM public key with a self describing payload author: Quantova Inc (@quantova-inc) discussions-to: https://ethereum-magicians.org/t/erc-8803-post-quantum-encryption-to-an-account/30623 status: Draft type: Standards Track category: ERC created: 2026-12-05 --- ## Abstract This ERC defines how to encrypt data to an account so that only the account holder can read it, under a post quantum key encapsulation. An account publishes an ML-KEM public key, a sender encapsulates a shared secret to that key and encrypts the data under that secret with an authenticated cipher, and the result is a self describing payload of a scheme byte, the encapsulation and the ciphertext. The encoding names the ML-KEM parameter set in one byte, so one format covers the parameter sets and any key encapsulation a later version adds. This is the post quantum counterpart of the elliptic curve encryption in [ERC-5630](./eip-5630.md). ## Motivation Encrypting data to an account lets a sender deliver a sealed bid, a private message, a decryption key or a confidential record that only the recipient can open, with the recipient named by a public key rather than by a shared channel. [ERC-5630](./eip-5630.md) standardises this for Ethereum over the x25519 elliptic curve exchange. An elliptic curve exchange gives no protection against an adversary that records the ciphertext today and decrypts it once a quantum computer exists, which is the harvest now and decrypt later attack, and it is the most urgent quantum risk for confidentiality because the data is captured before the quantum computer arrives. The signature work for Ethereum is advancing, but confidentiality has no post quantum standard, so a sender that wants to encrypt to an account has no quantum secure way to do it. ML-KEM, the module lattice key encapsulation standard in FIPS 203, is the answer, and this ERC gives it a standard account facing encoding. ## Specification The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. ### Scheme registry A scheme is named by a single byte. The byte selects the ML-KEM parameter set, the fixed public key size and the fixed encapsulation size. The shared secret is 32 bytes for every parameter set. | Scheme byte | Scheme | Public key | Encapsulation | | - | - | - | - | | `0x21` | ML-KEM-512 | 800 | 768 | | `0x22` | ML-KEM-768 | 1184 | 1088 | | `0x23` | ML-KEM-1024 | 1568 | 1568 | ### Encryption key An account publishes an encryption credential, which is the byte string `scheme ++ publicKey`, where the scheme is a registered scheme byte and the public key is the fixed public key size for that scheme. An account that implements this ERC exposes the credential through the following interface, so that a sender reads it before encrypting. ```solidity interface IPostQuantumEncryption { /// @notice The scheme byte and the ML-KEM public key to encapsulate to. function encryptionCredential() external view returns (bytes1 scheme, bytes memory publicKey); } ``` ### Payload A sender encrypts to an account as follows. 1. Read `scheme` and `publicKey` from the account encryption credential. 2. Encapsulate to `publicKey` under ML-KEM for the parameter set named by `scheme`, which yields a fixed size encapsulation and a 32 byte shared secret. 3. Encrypt the data under the shared secret with AES-256-GCM, with a 12 byte nonce and no additional authenticated data, which yields a ciphertext and a 16 byte tag. The payload is the byte string `scheme ++ encapsulation ++ nonce ++ ciphertext ++ tag`. The scheme is the scheme byte, the encapsulation is the fixed encapsulation size for that scheme, the nonce is 12 bytes, the tag is 16 bytes, and the ciphertext is the remaining bytes. A reader MUST reject a payload whose scheme byte is unregistered or whose length is less than the sum of the fixed sizes. ### Decryption The account holder decrypts a payload by decapsulating the encapsulation under the ML-KEM private key for the scheme to recover the 32 byte shared secret, then decrypting the ciphertext and verifying the tag under that secret with AES-256-GCM and the nonce. A reader MUST treat a failed tag as a rejected payload and MUST NOT use its plaintext. ## Rationale ### Why ML-KEM and a key encapsulation ML-KEM is the one key encapsulation NIST has finalised, as FIPS 203, and a key encapsulation is the right shape for encrypting to a named recipient because the sender encapsulates a fresh secret to the recipient public key without a round trip. The shared secret keys a symmetric cipher for the data, which is the same hybrid of a public key step and a symmetric step that ERC-5630 uses, with the public key step made quantum secure. ### Why a scheme byte and AES-256-GCM The scheme byte makes the payload self describing, so a reader dispatches on the named parameter set rather than on a length, which is the crypto agility a long lived encoding needs. The shared secret is 32 bytes for every ML-KEM parameter set, so one symmetric cipher covers them all, and AES-256-GCM is a widely implemented authenticated cipher whose key is exactly 32 bytes, so no key derivation step is required and the format stays small. ### Why an on account key Publishing the encryption key on the account, rather than deriving it from the signing key, lets an account hold an encryption key of a different family and parameter set from its signature, and lets a sender read the key the same way it reads any account value. An account MAY hold the encryption credential of this ERC alongside a post quantum signature credential. ## Backwards Compatibility This ERC adds an encoding and an interface and changes no existing behaviour. It is the post quantum counterpart of [ERC-5630](./eip-5630.md), and an application MAY offer both, reading the elliptic curve key for a classical recipient and the ML-KEM key for a post quantum recipient. A payload of this ERC is distinguished from an ERC-5630 payload by its scheme byte and its length. ## Reference Implementation A reference encrypts to an account by reading the credential, encapsulating under ML-KEM and sealing the data with AES-256-GCM, and a reference decrypts by decapsulating and opening the seal. The reference and the test vectors for each parameter set are published with this proposal, and the vectors are cross checked against an independent implementation of ML-KEM. ## Security Considerations The confidentiality of a payload rests on ML-KEM for the key step and on AES-256-GCM for the data step, and ML-KEM is a NIST standardised post quantum key encapsulation, so a payload captured today is not readable by a future quantum adversary when the account key is a registered scheme. A sender MUST use a fresh random nonce for each payload under a given shared secret, and because the shared secret is fresh per encapsulation a single random nonce per payload satisfies this. Encryption to a published key gives confidentiality, not authenticity, so a recipient MUST NOT infer who sent a payload from the payload alone, and an application that needs the sender authenticated MUST carry a signature inside the plaintext. An account that rotates its encryption credential MUST expect payloads encrypted to the previous key until senders read the new credential, so a rotation SHOULD retain the previous private key for a window. ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md).