zcash / halo2

The Halo2 zero-knowledge proving system
https://zcash.github.io/halo2/
Other
716 stars 487 forks source link

Separate `simple_example` into "simple circuit" and "simple gadget" #727

Open str4d opened 1 year ago

str4d commented 1 year ago

https://zcash.github.io/halo2/user/simple-example.html renders https://github.com/zcash/halo2/blob/main/halo2_proofs/examples/simple-example.rs in the book to guide people in how to use halo2_proofs. However, it is really two examples in one:

We should split these into two separate examples in the book, and use existing gadgets for the latter. Note that this will require a separate example under halo2_gadgets, as we don't have access to that library of gadgets inside halo2_proofs.

str4d commented 1 year ago

Hmm, it might actually be better to write a separate "simple example", because halo2_gadgets does not (currently) have gadgets for arbitrary integer addition (only ECC math). So it would probably be better to write a separate example using one of the existing gadgets (e.g. Poseidon, or some of the ECC gadget).