0014. QuantLayer Quantum: post-quantum cryptography module

Design document, published from the repository at docs/adr/0014-quantlayer-quantum.md.

  • Status: Accepted
  • Date: 2026-11-13

Context

QuantLayer needs NIST post-quantum signatures (FIPS 204 ML-DSA, FIPS 205 SLH-DSA) and key encapsulation (FIPS 203 ML-KEM). It also needs hybrid authorization with classical keys, key rotation, revocation and algorithm migration, with Rust and TypeScript interoperating. ADR-0007 deferred the choice of implementation. The rule is that QuantLayer never implements lattice or hash-based cryptography itself.

Decision

  1. Implementations (exact pins).
    • libcrux-ml-kem and libcrux-ml-dsa 0.0.11 (Cryspen). These have the strongest assurance available: hax/F* verification of the portable code, complete for ML-KEM and partial for ML-DSA. Only the portable path is built.
    • fips205 0.5.0 (IntegrityChain) for SLH-DSA SHA2-128s, 128f and 256s.
    • RustCrypto, pqcrypto/PQClean and aws-lc-rs were evaluated (QUANTLAYER_QUANTUM.md §1) and not chosen.
  2. Module. rust/quantlayer-pqc provides:
    • algorithm ids, codes and versioning;
    • seed-based key pairs;
    • hedged signing with the FIPS external "pure" interface and contexts;
    • ML-KEM with key checks;
    • sealed private keys (XChaCha20-Poly1305 under a KMS KEK, metadata as AAD);
    • hybrid Ed25519/ES256K + ML-DSA-65 (AND-composition, domain-separated);
    • KeyStore custody with explicit states (pending, active, retired, revoked, destroyed), plus rotation and migration with dual-signed transition records.
  3. Bindings. Node-API (rust/quantlayer-pqc-node, napi-rs), so secrets stay in Rust. The TypeScript package @quantlayer-protocol/pqc-engine defines the stable interfaces PQCKeyProvider, PQCSignatureProvider, PQCVerificationProvider, HybridAuthorizationProvider and PQCKeyManager, and mirrors the lifecycle into @quantlayer-protocol/crypto KeyRings. A WASM build is deferred until a wasm32 toolchain is available.
  4. Assurance by vectors and independent implementations.
    • 291 NIST ACVP cases from a pinned commit with a reproducible subset.
    • Differential tests against fips204/fips203.
    • Byte-identical interop with @noble/post-quantum from TypeScript.
  5. Defaults. ML-DSA-65 and ML-KEM-768 (NIST category 3). SLH-DSA is for long-lived roots, where its hash-only assumption justifies the slow signing.

Consequences

  • Building @quantlayer-protocol/pqc-engine requires cargo. CI installs Rust in the TypeScript job. The SDK does not re-export the native module, so browser and web builds need no Rust toolchain.
  • The module is not FIPS 140-3 validated. A validated provider can be put behind the same interfaces later.
  • Ethereum transactions and the BN254 ZK proofs remain classical. The module protects QuantLayer authorizations and key agreement, not the chain.
  • A library upgrade means changing the exact pins, rerunning all vector suites, reviewing advisories, and recording the change in this ADR.