3 stable releases

new 3.3.0 Nov 19, 2024
3.2.1 Nov 7, 2024

#1975 in Cryptography

Download history 206/week @ 2024-11-04 20/week @ 2024-11-11 166/week @ 2024-11-18

392 downloads per month

MIT/Apache

57KB
1K SLoC

SP1 Verifier

This crate provides verifiers for SP1 Groth16 and Plonk zero-knowledge proofs. These proofs are expected to be generated using the SP1 SDK.

Features

Groth16 and Plonk proof verification are supported in no-std environments. Verification in the SP1 ZKVM context is patched, in order to make use of the bn254 precompiles.

Pre-generated verification keys

Verification keys for Groth16 and Plonk are stored in the bn254-vk directory. These vkeys are used to verify all SP1 proofs.

These vkeys are the same as those found locally in ~/.sp1/circuits/<circuit_name>/<version>/<circuit_name>_vk.bin, and should be automatically updated after every release.

Tests

Run tests with the following command:

cargo test --package sp1-verifier

These tests verify the proofs in the test_binaries directory. These test binaries were generated from the fibonacci groth16 and plonk examples. You can reproduce these proofs from the examples by running cargo run --bin groth16_bn254 and cargo run --bin plonk_bn254 from the examples/fibonacci directory.

Acknowledgements

Adapted from @Bisht13's gnark-bn254-verifier crate.

Dependencies

~2–2.7MB
~59K SLoC