Status: implemented (FEAT-07). Decision record: ADR-0014.
Benchmarks: BENCHMARKS.md. Code: rust/quantlayer-pqc (module), rust/quantlayer-pqc-node
(Node-API bindings), packages/pqc-engine (TypeScript).
Ethereum is not made quantum-safe by this module. Ordinary Ethereum transactions are authorised by secp256k1 ECDSA. A cryptographically relevant quantum computer could derive the private key of any account whose public key is exposed, i.e. any account that has ever sent a transaction. QuantLayer Quantum protects QuantLayer-level authorizations, credentials and key agreement. It changes nothing about how the chain validates transactions. §9 lists everything that is still classical.
1. Implementation selection
No lattice or hash-based cryptography is implemented by QuantLayer. Every primitive comes from a maintained, independently developed library, pinned exactly:
| Standard | Parameter sets | Library (version) | Assurance |
|---|---|---|---|
| FIPS 203 ML-KEM | 512, 768 (default), 1024 | libcrux-ml-kem 0.0.11 (Cryspen) | Portable and AVX2 code formally verified (hax → F*: panic freedom, functional correctness against a spec). The NEON code is not covered by the proofs. QuantLayer builds the portable path only (no simd128/simd256 features). |
| FIPS 204 ML-DSA | 44, 65 (default), 87 | libcrux-ml-dsa 0.0.11 (Cryspen) | Partially verified: field arithmetic, NTT and serialization. Portable path only. |
| FIPS 205 SLH-DSA | SHA2-128s, SHA2-128f, SHA2-256s | fips205 0.5.0 (IntegrityChain) | Pure Rust, ACVP-tested by its authors, documented constant-time design (control flow depends only on public data), and seeds wiped on drop. No known independent audit. |
Alternatives considered (November 2026):
- RustCrypto
ml-dsa0.1.2 /ml-kem0.3.4. Widely used, but explicitly unaudited;ml-dsahad three 2026 advisories during its release-candidate phase (e.g. CVE-2026-24850, repeated hint indices accepted). It was kept out of the core in favour of libcrux's verification work. - RustCrypto
slh-dsa. The 0.1.0 release no longer builds against the currentsignaturepre-releases, and 0.2 is still a release candidate. pqcrypto(PQClean). PQClean is archived and the crates are flagged unmaintained (RUSTSEC-2026-0164).aws-lc-rs. Has a FIPS-validated ML-KEM, but ML-DSA sits behind an unstable flag, there is no SLH-DSA, and it needs a C/CMake toolchain. It remains a candidate for a FIPS 140-3 deployment profile.
Independent cross-checks run in the test suite:
- Within Rust: differential tests against IntegrityChain
fips204/fips203check keys, deterministic signatures, ciphertexts and shared secrets byte for byte. - Against TypeScript:
@noble/post-quantum0.7.1 produces identical deterministic signatures and ciphertexts, verifies across implementations in both directions, and passes the same NIST keyGen vectors.
2. Algorithm identification and versioning
| Id | Code | Kind | NIST cat. | Public key | Stored seed | Expanded SK | Signature / ciphertext |
|---|---|---|---|---|---|---|---|
ML-DSA-44 | 0x11 | signature | 2 | 1312 | 32 (ξ) | 2560 | 2420 |
ML-DSA-65 | 0x12 | signature | 3 | 1952 | 32 | 4032 | 3309 |
ML-DSA-87 | 0x13 | signature | 5 | 2592 | 32 | 4896 | 4627 |
SLH-DSA-SHA2-128s | 0x21 | signature | 1 | 32 | 48 (3n) | 64 | 7856 |
SLH-DSA-SHA2-128f | 0x22 | signature | 1 | 32 | 48 | 64 | 17088 |
SLH-DSA-SHA2-256s | 0x23 | signature | 5 | 64 | 96 | 128 | 29792 |
ML-KEM-512 | 0x31 | kem | 1 | 800 | 64 (d‖z) | 1632 | 768 |
ML-KEM-768 | 0x32 | kem | 3 | 1184 | 64 | 2400 | 1088 |
ML-KEM-1024 | 0x33 | kem | 5 | 1568 | 64 | 3168 | 1568 |
- Ids and codes. Ids equal the protocol registry in
@quantlayer-protocol/crypto, which is append-only; codes are stable bytes used in QuantLayer's binary formats. The suite isquantlayer.pqc.v1(SUITE_VERSION = 1). Every QuantLayer format carries a version byte: protected keysQLPQKEY1, hybrid signaturesVH 0x01, and transition statementsQUANTLAYER-PQC-TRANSITION-V1. - Fingerprints.
SHA3-256("QUANTLAYER-PQC-FP-V1\0" ‖ code ‖ publicKey). Binding the code means one key encoding can't be read under another parameter set. - Private keys. A private key is its FIPS key-generation seed. The expanded encoding is derived from it in memory, which is the smallest and most portable form.
3. Interfaces (@quantlayer-protocol/pqc-engine)
| Interface | Responsibility | Implementation |
|---|---|---|
PQCKeyProvider | generate, activate, publicKey, exportProtected, importProtected. Secrets never returned. | createNativePqcProvider() |
PQCSignatureProvider | sign(keyId, message, context?): hedged, FIPS 204/205 external "pure" interface | same |
PQCVerificationProvider | stateless verify({algorithm, publicKey, message, context, signature}), fails closed (false) | same, plus a @quantlayer-protocol/crypto SignatureVerifier adapter |
HybridAuthorizationProvider | authorize (classical signer + ML-DSA-65) and verify (both halves required) | createHybridAuthorizationProvider() |
PQCKeyManager | create, rotate, migrate, revoke, destroy, keyRing, custody, verifyTransition | createPqcKeyManager() |
PQCKemProvider | ML-KEM encapsulate / decapsulate | createNativePqcProvider() |
The Rust crate exposes the same functionality: KeyPair, sign, kem,
protect, hybrid and keystore::KeyStore. Through the
p.signatureVerifier adapter, any QuantLayer component that uses
composeSignatureVerifiers (identity, credentials) verifies ML-DSA and
SLH-DSA signatures over signingInput(...) payloads with an empty FIPS
context.
4. Key lifecycle (explicit states)
activate rotate / migrate (next version → active)
pending ───────────▶ active ─────────────────────────▶ retired
│ │ │
└──── revoke ───────┴──────────── revoke ──────────────┴──▶ revoked (secret wiped)
any state ──────────────────── destroy ──────────────────────▶ destroyed (secret wiped, terminal)| State | Sign | Verify | Decapsulate | Export (sealed) | Notes |
|---|---|---|---|---|---|
pending | no | no | no | yes | Freshly generated or imported |
active | yes | yes | yes | yes | At most one per key id |
retired | no | yes | yes | yes | Keeps old signatures and ciphertexts usable |
revoked | no | no | no | no | Compromise or withdrawal; reason recorded |
destroyed | no | no | no | no | End of retention; public metadata kept |
The states are enforced where the secret lives (Rust KeyStore).
PQCKeyManager mirrors every transition into the published @quantlayer-protocol/crypto
KeyRing (pending, active, retired, revoked). That ring is the same
model used for classical keys, so canSignWith and canVerifyWith behave
identically everywhere. destroyed is custody-only: the published ring keeps
a destroyed version's last public status. If create fails validation, for
example on a key-agreement purpose for a signature key, the generated secret
is destroyed immediately.
5. Private-key protection
- At rest. The seed is sealed with XChaCha20-Poly1305 (the
chacha20poly1305crate) under a 256-bit KEK held in a KMS or HSM:"QLPQKEY1" ‖ 0x01 ‖ code ‖ len ‖ keyId ‖ version ‖ fingerprint ‖ nonce(24) ‖ ct ‖ tag. Everything before the nonce is associated data, so changing the algorithm, id, version or public key fails authentication. Nonces are 192-bit random values. Unsealing re-derives the key and checks the fingerprint, and the expected label is checked before anything is stored. Every failure returns the samePROTECTED_KEY_INVALID, so errors can't act as an oracle. - In memory.
- Seeds and expanded keys live in
Zeroizingbuffers insideKeyStore, wiped on revoke, destroy and drop. - Libcrux ML-DSA signing keys are wiped after use; fips205 wipes its own.
Debugnever prints secrets.- No API returns a private key; the only exception is sealed export.
- Seeds and expanded keys live in
- Limits.
- libcrux's ML-KEM key-pair value and the libraries' stack temporaries are not wiped; there is no safe API for that.
- KEKs, shared secrets and messages cross into JavaScript as
Buffers, and V8 may copy them. QuantLayer overwrites the buffers it owns, but it can't guarantee erasure in a garbage-collected heap. - The key store is in memory: persistence is the sealed blobs, and keys must be re-imported after a restart.
6. Hybrid classical + ML-DSA authorization
input = "QUANTLAYER-HYBRID-V1" ‖ 0x00 ‖ len(scheme) ‖ scheme ‖ len(ctx) ‖ ctx ‖ message
classical = Ed25519.Sign(input) (RFC 8032; strict verification)
| ECDSA-secp256k1-SHA256.Sign(input) (low-S, 64-byte r‖s)
pq = ML-DSA-65.Sign(input, ctx = "QUANTLAYER-HYBRID-V1")
signature = "VH" ‖ 0x01 ‖ code ‖ u16 BE len(classical) ‖ classical ‖ pq (3,379 B for Ed25519)- Composition (AND). A hybrid signature verifies only if both halves verify over the same input. It stays unforgeable as long as at least one component is unforgeable: Ed25519/ECDSA against classical attackers and ML-DSA-65 against quantum ones.
- Binding. The scheme id is inside the signed input, and the ML-DSA half
uses a dedicated FIPS context. Neither half verifies as a standalone QuantLayer
signature on the message, which signs
"QUANTLAYER-SIG-V1:…", and a signature can't be relabelled under the other scheme. Tests check these cases, including high-S ECDSA rejection. - Who holds which key. The classical half comes from the caller's signer
(a wallet or KMS); QuantLayer never holds that private key. The ML-DSA half comes
from QuantLayer custody.
authorizeverifies the result and fails closed if the classical signer misbehaves. - What this is not. This is QuantLayer's own construction, modelled on the IETF
LAMPS composite ML-DSA work but not conformant to it.
ES256Khere means raw ECDSA over SHA-256 (for KMS keys). It is not an Ethereum wallet signature (personal_sign/ EIP-712), and it doesn't make Ethereum accounts quantum-safe.
7. Rotation, revocation and algorithm migration
- Rotation. Version n+1 is generated (same algorithm) and becomes
active; version n becomesretired. - Migration. A rotation to another parameter set of the same kind: for example ML-DSA-44 → ML-DSA-87, ML-DSA → SLH-DSA (lattice → hash-based), or ML-KEM-512 → ML-KEM-1024. Signature ↔ KEM migrations are rejected.
- Transition records. For signature keys, both the outgoing and the
incoming key sign the canonical statement
QUANTLAYER-PQC-TRANSITION-V1\nkey=…\nfrom=v:alg:fingerprint\nto=v:alg:fingerprint\n, under the contextQUANTLAYER-PQC-TRANSITION-V1. Verifiers can then follow the chain: the old key authorised its successor, and the new key is possessed.verifyTransitionchecks both signatures and that the statement matches the published keys. - Revocation. Allowed from
pending,activeorretired. It requires a reason, wipes the secret, and is published in theKeyRing. Revoked versions no longer verify. - Caveat. A transition record proves the old key consented. If the old key was compromised before the migration, the attacker could have produced that consent. Compromise-driven re-keying must therefore be authorised out of band, through identity recovery or governance, not by the old key alone.
8. Test vectors and interoperability
| Suite | Where | Cases | What |
|---|---|---|---|
| NIST ACVP (FIPS 203/204/205) | rust/quantlayer-pqc/tests/acvp (subset of usnistgov/ACVP-Server @ 975de31, source SHA-256 pinned, subset.py) | 291 | ML-DSA keyGen/sigGen/sigVer (external pure and internal, deterministic and hedged); ML-KEM keyGen/encaps/decaps (incl. invalid ciphertexts)/ek and dk checks; SLH-DSA keyGen/sigGen/sigVer |
| ACVP through the TS bindings | packages/pqc-engine/src/acvp.test.ts | keyGen, sigVer, ek-check | Same vectors, via Node-API; noble re-derives the keyGen results |
| Differential (Rust) | rust/quantlayer-pqc/tests/differential.rs | 48 | libcrux vs fips204/fips203 byte for byte |
| Interop vectors | rust/quantlayer-pqc/tests/vectors/interop-v1.json | 9 + 2 | Seed → key → fingerprint, deterministic signatures, KEM outputs, hybrid signatures. Checked by Rust, the TS bindings, noble, and an independent TS re-implementation of the hybrid encoding |
To regenerate the interop vectors, run
QUANTLAYER_UPDATE_VECTORS=1 cargo test -p quantlayer-pqc --test interop.
9. Security properties, assumptions and limitations
Properties (when the assumptions hold).
- ML-DSA (FIPS 204). Strong unforgeability under chosen-message attack.
This rests on the hardness of Module-LWE and Module-SIS (and the
SelfTargetMSIS variant), with SHAKE modelled as a random oracle, in the
quantum random-oracle model. Signing is hedged (fresh 32-byte
rnd), as FIPS 204 recommends against fault and side-channel attacks. - SLH-DSA (FIPS 205). Existential unforgeability resting only on
properties of the hash function (SHA-256 for these sets), which is the most
conservative assumption available. Signing is hedged with
opt_rand. - ML-KEM (FIPS 203). IND-CCA2 under Module-LWE via the Fujisaki–Okamoto
transform.
- Decapsulation. It uses implicit rejection: a malformed ciphertext of the right length yields an unrelated pseudo-random secret, never an error. Callers must authenticate what they derive from it, for example with an AEAD key confirmation.
- Key checks. Encapsulation keys are modulus-checked (FIPS 203 §7.2) before use.
- Security categories. These are NIST's: category 1 means at least as hard as AES-128 key search, category 3 AES-192, category 5 AES-256. The defaults (ML-DSA-65, ML-KEM-768) are category 3.
- Hybrid. Unforgeable if either component is.
- Key protection. Confidentiality and integrity of sealed keys under XChaCha20-Poly1305, with the KEK secret.
Assumptions.
- Hardness and hash security. The lattice problems above are hard for quantum adversaries, and SHA-2/SHA-3/SHAKE behave as assumed.
- Implementations. libcrux and fips205 implement the standards correctly
and in constant time on the platforms used.
- Evidence: formal verification where noted, 291 NIST vectors, differential and cross-language agreement.
- What it doesn't prove: none of this establishes the absence of side channels on a specific CPU.
- Randomness. The OS CSPRNG (
getrandom) is sound. - KEK custody. KEKs are managed by a KMS/HSM and never stored with the sealed blobs.
- Process integrity. Anyone with code execution or a memory dump of the process can read active keys.
Limitations.
- Not FIPS 140-3 validated. Passing ACVP vectors is not CMVP validation;
none of the selected libraries is a validated module. Regulated
deployments need a validated provider (e.g. an
aws-lc-rsFIPS profile or a PQC-capable HSM) behind the same interfaces. - Audit status. libcrux ML-DSA verification is partial; fips205 has no known independent audit; QuantLayer's composition code (protection, hybrid, lifecycle) is unaudited.
- No browser/WASM build yet. Only Node-API is available. The local
toolchain had no
wasm32target;quantlayer-crypto-wasmis the placeholder. Native addons must be built per platform (pnpm --filter @quantlayer-protocol/pqc-engine buildneeds cargo). - Synchronous calls. SLH-DSA "s" signing takes about a second
(BENCHMARKS.md) and blocks the Node event loop; use worker threads or
SLH-DSA-SHA2-128f. - Still classical elsewhere in QuantLayer.
- Ethereum transactions and EIP-712 wallet ownership proofs (secp256k1).
- Ed25519/ES256K identity keys that have not migrated.
- The ZK proofs (UltraHonk/KZG over BN254, FEAT-06), whose soundness falls to a quantum adversary.
did:quantlayerderivation (SHA-256, fine).- X25519 where used without ML-KEM.
- Data already encrypted or signed classically ("harvest now, decrypt later"); this module does not protect it retroactively.
- No on-chain post-quantum verification. ML-DSA verification is not implemented in Solidity; it would cost several million gas.
- Verification of revoked keys. Revoked versions are deliberately unusable, so signatures made before revocation can't be checked against them. Timestamped evidence (e.g. on-chain anchoring) is needed where that matters.
10. Operations
| Task | Command |
|---|---|
| Rust tests (incl. NIST) | cd rust && cargo test --locked |
| Build the TS bindings | pnpm --filter @quantlayer-protocol/pqc-engine build (runs cargo build --release) |
| TS tests (interop, ACVP) | pnpm --filter @quantlayer-protocol/pqc-engine test |
| Benchmarks | QUANTLAYER_BENCH=1 pnpm --filter @quantlayer-protocol/pqc-engine exec vitest run src/bench.test.ts |
| Refresh the ACVP subset | download the pinned files, then python3 rust/quantlayer-pqc/tests/acvp/subset.py <dir> |
| Regenerate interop vectors | QUANTLAYER_UPDATE_VECTORS=1 cargo test -p quantlayer-pqc --test interop |
| Upgrade a library | bump the exact pin, rerun every suite above, review the upstream changelog and advisories, record it in ADR-0014 |