provably post-quantum

Get Started

post-quantum signature verification on solana in 5 steps

01
Install the JS library
npm install @oryxonchain/lean-pqc --registry=https://npm.pkg.github.com
02
Generate a post-quantum keypair
import { lamport, winternitz } from '@oryxonchain/lean-pqc' // lamport: 256-bit classical, 128-bit quantum security const sk = lamport.generatePrivateKey() const pk = lamport.derivePublicKey(sk) // or wots+ for 3.8x smaller sigs (2,144 vs 8,192 bytes) const wSk = winternitz.generatePrivateKey() const wPk = winternitz.derivePublicKey(wSk)
03
Sign and verify
const msg = new TextEncoder().encode('withdraw 10 SOL') const sig = lamport.sign(sk, msg) lamport.verify(pk, sig, msg) // true // serialize for on-chain submission const sigBytes = lamport.serializeSignature(sig) // 8,192 bytes
04
The on-chain pattern
A Solana program holds funds in a PDA. Withdrawals require a valid post-quantum signature verified on-chain via Keccak-256 hash chains. No protocol changes needed. Each signature element is hashed and compared against stored public key elements. ~25,600 CU for full Lamport verification, well within Solana's 1.4M compute budget.
This is poko-compatible. Solana's poko model lets any transaction specify which signature verification program to use. Lean PQC verifiers can serve as standalone poko programs.
05
Build the Lean library
# requires lean 4.36.0 git clone https://github.com/oryxonchain/lean-pqc cd lean-pqc lake update lake build
First build fetches lean-svm (~10 min on the compiler/verify modules). Subsequent builds are incremental. 39 theorems kernel-checked, 22 build-time tests, zero sorry.