Skip to content

Generate artifacts

Use this guide when you need reproducible artifact paths for tests, demos, CI jobs, release bundles, or downstream integrations.

From noir-examples/basic:

Terminal window
cargo run --release --bin provekit-cli -- prepare
cargo run --release --bin provekit-cli -- prove
cargo run --release --bin provekit-cli -- verify

This writes:

FileCreated byConsumed by
basic.pkpprepareprove
basic.pkvprepareverify, show-inputs, generate-gnark-inputs
proof.npproveverify, show-inputs, generate-gnark-inputs
target/basic.jsonNoir compilation during prepareProveKit internals and inspection workflows
  1. Enter the Noir package and create an output directory.

    Terminal window
    cd noir-examples/basic
    mkdir -p artifacts
  2. Prepare key material.

    Terminal window
    cargo run --release --bin provekit-cli -- prepare . \
    --pkp ./artifacts/basic.pkp \
    --pkv ./artifacts/basic.pkv
  3. Generate a proof.

    Terminal window
    cargo run --release --bin provekit-cli -- prove \
    --prover ./artifacts/basic.pkp \
    --input ./Prover.toml \
    --out ./artifacts/proof.np
  4. Verify the proof.

    Terminal window
    cargo run --release --bin provekit-cli -- verify \
    --verifier ./artifacts/basic.pkv \
    --proof ./artifacts/proof.np

prepare defaults to skyscraper. The CLI also accepts sha256, keccak, blake3, and poseidon2 via --hash:

Terminal window
cargo run --release --bin provekit-cli -- prepare . --hash blake3

The hash is part of the artifact’s identity. Regenerate the prover key, verifier key, and every proof after changing it.

Decode public inputs as part of integration testing:

Terminal window
cargo run --release --bin provekit-cli -- show-inputs --hex \
./artifacts/basic.pkv \
./artifacts/proof.np

Review the output with the application owner. Verification proves the proof is valid for the verifier key, your application still owns the decision about whether those inputs authorize the requested action.

After the proof verifies, export inputs for the Go/gnark recursive verifier:

Terminal window
cargo run --release --bin provekit-cli -- generate-gnark-inputs \
./artifacts/basic.pkv \
./artifacts/proof.np \
--params ./artifacts/params_for_recursive_verifier \
--r1cs ./artifacts/r1cs.json

The command reads the verifier key and proof, then writes the recursive parameters and an R1CS JSON. Keep those outputs paired with the exact basic.pkv and proof.np that produced them.

A release-producing CI job should persist at least:

commit: <git sha>
rust-toolchain: <contents of rust-toolchain.toml>
lockfile: Cargo.lock
compiler: noir
prepare_hash: skyscraper
commands:
- cargo run --release --bin provekit-cli -- prepare ...
- cargo run --release --bin provekit-cli -- prove ...
- cargo run --release --bin provekit-cli -- verify ...
artifacts:
- artifacts/basic.pkp <checksum>
- artifacts/basic.pkv <checksum>
- artifacts/proof.np <checksum>
Terminal window
rm -rf artifacts target basic.pkp basic.pkv proof.np params_for_recursive_verifier r1cs.json