Skip to content

Examples catalog

The noir-examples/ directory contains circuits that exercise ProveKit’s compiler and proving pipeline. Some are minimal demos; others are real-world primitives used to benchmark and validate the system end-to-end.

Each example is a self-contained Noir package. To run any of them:

Terminal window
cd noir-examples/<name>
cargo run --release --bin provekit-cli -- prepare
cargo run --release --bin provekit-cli -- prove
cargo run --release --bin provekit-cli -- verify

Circuits demonstrating the hash functions ProveKit can prove over.

ExampleWhat it demonstrates
basicPoseidon2 BN254 preimage proof, the canonical “hello world” circuit.
basic-2, basic-3, basic-4Progressive Poseidon variations for compiler testing.
poseidon2Direct Poseidon2 hashing primitive in isolation.
many_poseidonsStress test with many Poseidon hash calls in one circuit.
poseidon-roundsSingle-round Poseidon decomposition, useful for understanding round structure.
sha256, noir_sha256, noir-native-sha256SHA-256 variants compiled through Noir’s black-box and native paths.
partial_sha256SHA-256 with a partial preimage, common for incremental hashing patterns.

Circuits exercising scalar multiplication, signature schemes, and curve arithmetic.

ExampleWhat it demonstrates
babyjubjubBaby Jubjub curve operations, the standard curve for in-circuit ECC over BN254.
eddsa_poseidon2EdDSA signature verification using Poseidon2 for hashing.
embedded_curve_msmMulti-scalar multiplication on the embedded curve via Noir’s intrinsic.
native_msmMSM expressed without the embedded-curve intrinsic, heavier circuit, useful for comparisons.
msm_conditionalConditional MSM, pick scalars or points at runtime inside the circuit.
msm_conditional_nestedNested conditional MSM, demonstrating composition.
p256_stdP-256 (secp256r1) signature verification over the standard curve.
p256_bigcurveP-256 with bigcurve representation, relevant when proving WebAuthn or hardware-attestation signatures.

Circuits demonstrating real-world identity workflows.

ExampleWhat it demonstrates
noir-passportPassport-style credential verification, the foundation for selective disclosure.
noir-passport-examplesVariations of the passport flow used for testing different selective-disclosure patterns.
noir-passport-monolithicSingle-circuit version of the passport workflow, useful for understanding the full constraint cost.
oprfOblivious Pseudorandom Function, a primitive used in private set intersection and de-anonymization defenses.

Small circuits that ProveKit uses internally for testing and benchmarking.

ExampleWhat it demonstrates
powerModular exponentiation inside a circuit.
rangechecksRange constraints, the building block for bounded arithmetic.
noir-r1cs-test-programsA suite of programs used by the R1CS compiler’s own test harness.

Larger circuits modeled after real applications.

ExampleWhat it demonstrates
zkchaseA small game-like circuit demonstrating state transitions and rule enforcement.
ExampleWhat it demonstrates
csp-benchmarksConstraint system performance benchmarks. Use these as a baseline when measuring circuit cost.

Every example follows the same layout:

noir-examples/basic/
├── Nargo.toml # Noir package metadata + dependencies
├── Prover.toml # Witness inputs (private + public)
└── src/
└── main.nr # Circuit definition

The Prover.toml is the only file you typically edit to change what’s being proven, the circuit is fixed; the inputs vary per proof. To inspect what a verified proof actually exposes:

Terminal window
cargo run --release --bin provekit-cli -- show-inputs --hex \
<example>.pkv \
proof.np

Pull requests adding new example circuits are welcome. Keep them minimal, focused on one primitive, and accompanied by a Prover.toml that produces a verifiable proof out of the box.