A proof-of-concept OpenVM extension for post-quantum signature verification, starting with leanSig.
This repository provides:
- a custom OpenVM guest instruction for
leanSigverification - a transpiler extension for the custom opcode
- a guest-facing Rust library with native fallback verification
- a small real software verifier for a
leanSig-compatible Poseidon/XMSS instantiation, with deterministic test vectors - an execution-only OpenVM extension and test harness
Current limitation:
- the
pqsigopcode is wired for execution, but the proving-side AIR is still a placeholder - this is an integration PoC, not yet a sound proving extension for KoalaBear/Poseidon verification
- a full OpenVM proof of the software
leanSigverifier is not in CI yet: even tiny real Poseidon-based instantiations still blow through default runner budgets when interpreted through plain RV32 instructions
examples: runnable host-side demos for leaf and recursive-tree constructionextensions/pqsig/guest: guest instruction and request ABIextensions/pqsig/transpiler: RISC-V custom instruction to OpenVM opcode mappingguest-libs/pqsig: ergonomic verification API with nativeleanSigfallbackextensions/pqsig/circuit: execution extension and focused tests
The project is split into four layers:
- Request ABI and custom instruction plumbing.
- Verification APIs:
- single-signature verification
- batched verification
- detailed batch outcomes
- Aggregation leaf and recursive envelope construction:
- batch statements
- signer-set witnesses
- recursive aggregation envelopes and trees
- OpenVM execution harnesses for real guest execution and future proving work.
The current proving boundary is explicit:
- batched verification, signer-set commitment, leaf construction, and recursive envelope construction are real today
- the expensive part is proving those computations through plain RV32 execution rather than a dedicated PQ/KoalaBear/Poseidon chip
Host-side examples live in examples/.
Build a single aggregation leaf from a small batch:
cargo run -p openvm-pqsig-examples --bin batch_leafBuild a multi-level recursive aggregation tree:
cargo run -p openvm-pqsig-examples --bin recursive_treeThe PoC currently supports these leanSig instantiations:
SIGTargetSumLifetime18W1NoOffSIGTargetSumLifetime18W2NoOffSIGTargetSumLifetime18W4NoOffSIGTargetSumLifetime18W8NoOffSIGTargetSumLifetime20W1NoOffSIGTargetSumLifetime20W2NoOffSIGTargetSumLifetime20W4NoOffSIGTargetSumLifetime20W8NoOffSIGAbortingTargetSumLifetime6Dim46Base8
cargo fmt --all
cargo test --workspace --all-targetsThe openvm-pqsig library includes a real software verifier under the software feature.
- It is not a mock or placeholder.
- It verifies a deterministic XMSS/Poseidon signature generated from the same generic
leanSigconstruction family. - It is kept small enough to unit test reliably on ordinary CI runners.
- Its tiny batch path now rejects empty batches and can emit a real signer-set commitment via
verify_tiny_poseidon_batch_with_summary.
That batch summary is the strongest honest aggregation artifact in the repo right now:
- it verifies every raw signature in the batch
- it returns a stable signer count
- it returns a real Poseidon-based commitment to the sorted, deduplicated signer set
What is still missing is a proving-efficient path for larger leanSig instances inside OpenVM. The practical options are:
- build a real custom AIR/chip for the verifier path or a transpiler expansion into supported accelerated chips
- start with a simpler hash-based PQ scheme for the first fully proved aggregation pipeline, then grow back toward
leanSig
The current proving blocker is precise:
extensions/pqsig/circuit/src/lib.rsstill leaves bothVmCircuitExtension::extend_circuitandVmProverExtension::extend_proveras no-ops forPqSig- that means proofs of the tiny verifier or tiny batch verifier still run through plain RV32 execution instead of a dedicated KoalaBear/Poseidon chip
- a real run of the ignored tiny batch proof test retired about
5.1Binstructions across544segments, repeatedly hit the4,194,304trace-height ceiling and1.2B-cell segment cap, and was eventuallySIGKILLed during trace generation - the ignored proof tests in
extensions/pqsig/circuit/tests/proved_tiny_poseidon.rsmark that gap explicitly and stay out of CI until that proving path exists
The current recursive aggregation scaffolding is also real:
BatchVerificationStatementSignerSetWitnessBatchVerificationLeafRecursiveAggregationEnvelopeRecursiveAggregationTree
The strongest reference design so far is leanMultisig, which shows how to move from individual hash-based signature verification to recursive aggregation.
Two promising directions from current research:
- recursive aggregation trees that verify child proofs plus a partitioned signer set
- STARK/FRI packing between recursive layers to reduce verifier and witness size before recursion
More detailed notes live in docs/aggregation-notes.md.