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

#1972 in Data structures

Download history 5498/week @ 2023-12-14 4508/week @ 2023-12-21 4249/week @ 2023-12-28 8379/week @ 2024-01-04 11346/week @ 2024-01-11 13473/week @ 2024-01-18 13482/week @ 2024-01-25 10325/week @ 2024-02-01 12163/week @ 2024-02-08 12665/week @ 2024-02-15 12408/week @ 2024-02-22 10747/week @ 2024-02-29 9642/week @ 2024-03-07 13146/week @ 2024-03-14 11754/week @ 2024-03-21 9252/week @ 2024-03-28

45,333 downloads per month
Used in 38 crates (9 directly)

MIT/Apache

155KB
3.5K SLoC

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


lib.rs:

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.

Dependencies

~0.9–1.6MB
~33K SLoC