13 releases (stable)

new 4.1.2 Feb 28, 2025
4.1.1 Feb 11, 2025
4.0.1 Jan 17, 2025
3.4.0 Nov 29, 2024

#1164 in Cryptography

Download history 82/week @ 2024-11-01 141/week @ 2024-11-08 144/week @ 2024-11-15 39/week @ 2024-11-22 289/week @ 2024-11-29 154/week @ 2024-12-06 22/week @ 2024-12-13 130/week @ 2024-12-20 33/week @ 2024-12-27 786/week @ 2025-01-03 1045/week @ 2025-01-10 1074/week @ 2025-01-17 678/week @ 2025-01-24 1109/week @ 2025-01-31 1098/week @ 2025-02-07 475/week @ 2025-02-14

3,516 downloads per month
Used in 3 crates (via charms-client)

MIT/Apache

68KB
1.5K 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 generate a groth16/plonk proof and verify it.

Acknowledgements

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

Dependencies

~2.1–4MB
~81K SLoC