A standards-compliant Zero-Knowledge Proof (ZKP) library for Cardano smart contracts, implemented in Aiken. This library enables efficient on-chain verification while maintaining robust security guarantees.
The Aiken ZKP Standards Library takes a pragmatic approach to implementing zero-knowledge proof systems on Cardano. We distinguish between committed features (current targets) and aspirational features (planned for future development).
This implementation is designed for Plutus v3, leveraging its built-in BLS12-381 curve functions to ensure efficient and secure verification of ZKPs. It emphasizes clarity and maintainability, making it suitable for educational/demonstrative purposes without sacrificing security.
All three verifiers are functional, covered by unit and property-based tests, and build cleanly (aiken check / aiken build, 64/64 tests passing). Known input-validation issues are tracked as open issues and pinned by known_issue_* tests. Each is verification-only: proof generation, circuit compilation, and (for Groth16/PLONK) trusted setup are assumed to happen off-chain, using external tooling this library does not provide. Full architecture, security arguments, and known limitations for each are written up in zkp/docs/.
Status: Complete (verifier)
The Groth16 implementation (zkp/lib/groth) is largely based on Modulo-P's ak-381, with some ideas taken from tarassh's implementation, and operates on native BLS12-381 pairing builtins throughout. It's tested against externally-generated proof/verification-key fixtures, both accepting valid proofs and rejecting a tampered one. Implementation report.
- Generic Groth16 proof verifier system
- Onchain verification tests
Wishlist:
- Integration examples with circom and SnarkJS
- Integration into a merkelized validator
Status: Optimizing
The Plonk implementation (zkp/lib/plonk) is loosely based on perturbing's plutus-plonk-example, with several optimizations and restructuring done around point compression to improve performance and clarity, a batched KZG opening, and a Keccak-256 Fiat–Shamir transcript matching the SnarkJS convention. It's tested against an externally-generated proof/verification-key fixture, including rejection of tampered proofs and mismatched public inputs. Implementation report.
At current measurements, a full verification call is the most expensive of the three verifiers in this library (§7 of the implementation report) and leaves the least headroom against Cardano's per-transaction execution budget — hence "Optimizing" rather than "Complete."
- Generic Plonk proof verifier system
- Onchain verification tests
Wishlist:
- Optimize further to fit within Plutus resource limits
- Integration examples with circom and SnarkJS
- Integration into a merkelized validator
Status: Complete (verifier and reference prover)
The Bulletproofs implementation (zkp/lib/bullet) is the only one of the three with no trusted setup, so this library implements and tests both a verifier and a reference prover directly, with no external fixtures required. Implementation report.
- Generic Bulletproofs range-proof verifier and reference prover
- Onchain verification tests, including boundary values and tamper rejection
Wishlist:
- Recursive inner-product-argument (IPA) compression, for
O(log n)rather thanO(n)proof size - Integration into a merkelized validator
- Affine point operations - conversion to/from native types (
zkp/lib/common/blst_affine.ak) - Field arithmetic utilities (
zkp/lib/common/common.ak) — largely superseded by native BLS12-381 builtins inside the three verifiers above; see the implementation reports for where and why. The verifiers use only its BLS12-381 constants and three small helpers (tested inzkp/lib/tests/common_tests.ak); the rest is legacy code with known defects (#20)
- Marlin: Preprocessing zkSNARKs with Universal and Updatable SRS
- Plonky2: Advanced recursive proof composition
- Leverages PlutusV3's BLS12-381 curve builtin functions
- Focuses on efficient verification
- Maintains strong security guarantees
- See the per-protocol implementation reports in
zkp/docs/for details
- Aiken development environment
- Familiarity with ZKP systems
- Understanding of Cardano smart contracts
We welcome contributions! Please see our Contributing Guide for:
- Development guidelines
- Submission process
- Testing requirements