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

#1980 in Cryptography

Download history 13848/week @ 2024-11-01 12692/week @ 2024-11-08 15510/week @ 2024-11-15 12964/week @ 2024-11-22 13282/week @ 2024-11-29 14963/week @ 2024-12-06 12399/week @ 2024-12-13 5782/week @ 2024-12-20 4255/week @ 2024-12-27 12906/week @ 2025-01-03 16356/week @ 2025-01-10 13802/week @ 2025-01-17 14472/week @ 2025-01-24 17497/week @ 2025-01-31 18932/week @ 2025-02-07 7560/week @ 2025-02-14

61,194 downloads per month
Used in 42 crates (8 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.8–1.4MB
~30K SLoC