Docs
| part | what it is | status |
|---|---|---|
| Falcon-512 | FIPS 206, lattice-based, ~666 B sigs | e2e verified |
| ML-DSA-65 | FIPS 204, lattice-based, 3,309 B sigs | full pipeline |
| SPHINCS+ | FIPS 205, hash-based stateless, 17,088 B sigs | full pipeline |
| Lamport | Hash-based one-time, 8,192 B sigs | proved |
| WOTS+ w=16 | Hash-based one-time, 2,144 B sigs | proved |
| Pokos | Pluggable verifier interface | budget proof |
| Multisig | N-of-M threshold, all 5 schemes | round-trip tested |
| PqcVault | PQ-gated vault on lean-svm | verified model |
| JS Library | Off-chain Lamport + WOTS+ | cross-verified |
Falcon-512
FIPS 206, lattice-based, NIST Level I. Signatures are ~666 bytes, the smallest of the three NIST standards. Verification computes c = HashToPoint(salt || msg) via SHAKE-256 rejection sampling, then s0 = c - s1*h in Z_q[x]/(x^512+1), and checks ||(s0, s1)||^2 <= beta^2.
Polynomial dimension invariants (q_mod_2n, poly_zero_size, poly_add_size, poly_sub_size, poly_neg_size).
Full end-to-end verification against a real signature from the Python reference implementation (tprest/falcon.py). The Lean verifier runs hashToPoint + schoolbook poly mul + norm check at #eval time and produces the same result. norm^2 = 28,746,991 <= 34,034,726.
The verifier works. Schoolbook multiplication is O(n^2); an NTT implementation would match the reference's performance.
ML-DSA-65
FIPS 204, formerly CRYSTALS-Dilithium. Lattice-based, NIST Level 3. Signatures are 3,309 bytes. Verification expands matrix A from seed rho via SHAKE-128, computes challenge c via SampleInBall, then w'_approx = A*z - c*t1*2^d, applies UseHint, and recomputes c_tilde.
q is prime (native_decide). Polynomial dimension invariants. Parameter constraints (beta < gamma1, tau <= n). Signature exceeds single Solana TX limit.
Full 8-step verification. ExpandA (SHAKE-128). SampleInBall. UseHint with HighBits/LowBits decomposition (Algorithms 35-38). Encoding/decoding for 1,952-byte public keys and 3,309-byte signatures. Wired into the multisig verifier.
Not yet tested against a NIST reference signature. The pipeline is complete but needs a KAT to confirm.
SPHINCS+-SHA2-128f
FIPS 205, hash-based, stateless, NIST Level 1. Signatures are 17,088 bytes. The conservative choice: security relies only on SHA-256 preimage resistance. Verification walks a hypertree of 22 layers, each containing WOTS+ chains + Merkle auth paths, rooted in a FORS tree.
Parameter decomposition, FORS leaf counts, public key compactness (32 bytes), verification fits Solana's CU budget.
SHA-256 (FIPS 180-4). Tweakable hash Th(pk.seed, ADRS, msg). 32-byte ADRS with all type constants. WOTS+ chains. FORS tree roots. Merkle auth paths. Full d-layer hypertree traversal. Root comparison.
Not yet tested against a reference signature. SHA-256 needs NIST test vectors.
Lamport
Hash-based one-time signatures. Security relies solely on Keccak-256 preimage resistance. Signatures are 8,192 bytes. Keys must not be reused.
verify_sign_correct: verify(sign(msg)) = true for all messages and keys. verify_element_correct. sign_length. derivePublicKey length invariants.
Round-trip at #eval. 11 Keccak-256 NIST vectors. Cross-verified against JS outputs.
WOTS+ w=16
3.8x smaller signatures than Lamport (2,144 vs 8,192 bytes). Same quantum security. Keys must not be reused.
verify_sign_correct. hashIter_compose: hash^m(hash^n(x)) = hash^(n+m)(x). derivePublicKey_length. sign_length.
Round-trip at #eval. Cross-verified against JS outputs.
Pokos
Solana's poko model lets a transaction specify which signature verification program to use. Each scheme can serve as a standalone verifier. The module provides a universal Scheme enum, metadata, CU estimates, and a kernel-checked proof that all 5 schemes fit Solana's 1.4M CU budget.
Multisig
N-of-M threshold where each signer uses a different PQC scheme. Implements Toly's cold storage recommendation: "rely on a multisig with 3 different PQC schemes, rotate each one as they harden."
no_sigs_no_approval. threshold_zero_always_met. Dispatch theorems. verify_deterministic.
2-of-2 round-trip (Lamport + WOTS+). 1-of-2 rejected. Wrong message rejected.
PqcVault
PQ-gated vault on lean-svm. Verifies 256 Lamport elements via Keccak-256 hash chains before allowing transfer.
pqcVault_transfer_conserves_lamports: total lamports preserved. Kernel-checked.
Verified model. Cannot deploy until lean-svm adds sol_keccak256 (issue #17).
Hash Functions
Four hash implementations, all pure Lean 4 with zero dependencies:
Keccak-256 (FIPS 202): 11 NIST test vectors. Used by Lamport, WOTS+, and the sol_keccak256 syscall model.
SHAKE-256 (FIPS 202 XOF): 2 NIST vectors. Used by Falcon hashToPoint.
SHAKE-128 (FIPS 202 XOF): Used by ML-DSA ExpandA.
SHA-256 (FIPS 180-4): Used by SPHINCS+ tweakable hash. Needs NIST test vectors.
JavaScript Library
Off-chain key generation, signing, verification, and serialization for Lamport and WOTS+.
28 tests: 8 round-trip + 20 cross-verification proving JS outputs match Lean #eval reference values for identical seeds.