4 releases (2 breaking)

0.4.0 Nov 7, 2023
0.3.0 Oct 26, 2023
0.2.1 Aug 1, 2023
0.2.0 Jul 28, 2023

#1922 in Cryptography

Download history 10756/week @ 2024-12-17 3824/week @ 2024-12-24 7140/week @ 2024-12-31 14188/week @ 2025-01-07 15373/week @ 2025-01-14 15087/week @ 2025-01-21 14814/week @ 2025-01-28 17895/week @ 2025-02-04 19110/week @ 2025-02-11 18385/week @ 2025-02-18 16534/week @ 2025-02-25 16626/week @ 2025-03-04 16039/week @ 2025-03-11 15005/week @ 2025-03-18 16730/week @ 2025-03-25 12822/week @ 2025-04-01

63,493 downloads per month
Used in 42 crates (8 directly)

MIT/Apache

155KB
3.5K SLoC

bellpepper is a crate for building zk-SNARK circuits. It provides circuit traits and and primitive structures, as well as basic gadget implementations such as booleans and number abstractions.

Example circuit

Say we want to write a circuit that proves we know the preimage to some hash computed using SHA-256d (calling SHA-256 twice). The preimage must have a fixed length known in advance (because the circuit parameters will depend on it), but can otherwise have any value. We take the following strategy:

  • Witness each bit of the preimage.
  • Compute hash = SHA-256d(preimage) inside the circuit.
  • Expose hash as a public input using multiscalar packing.

This crate exposes the main traits and core structures of the bellpepper library.

Dependencies

~0.8–1.4MB
~29K SLoC