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

#5 in #preimage

Download history 19480/week @ 2025-12-02 19041/week @ 2025-12-09 20038/week @ 2025-12-16 9989/week @ 2025-12-23 10895/week @ 2025-12-30 21486/week @ 2026-01-06 22176/week @ 2026-01-13 22120/week @ 2026-01-20 23445/week @ 2026-01-27 29628/week @ 2026-02-03 22676/week @ 2026-02-10 23543/week @ 2026-02-17 26878/week @ 2026-02-24 34038/week @ 2026-03-03 35711/week @ 2026-03-10 28593/week @ 2026-03-17

129,139 downloads per month
Used in 52 crates (9 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.7–1.4MB
~27K SLoC