Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add a simple membership circuit example #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tdelabro
Copy link

@tdelabro tdelabro commented Jul 22, 2024

Description

Add a e2e example of a circuit being setup, proven and verified.
It has the advantage to use UInt8 as public input and therefore to showcase how to pass them as input to the verifier (btw, is there no pre-defined methods and traits to do this?)

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@tdelabro tdelabro requested a review from a team as a code owner July 22, 2024 08:36
@tdelabro tdelabro requested review from z-tech, Pratyush and weikengchen and removed request for a team July 22, 2024 08:36
@weikengchen
Copy link
Member

There is a high chance that this would not be added... you can see that groth16 used to have examples, but they are mostly removed (due to the cost of maintenance at that time). The mimc test (https://github.com/arkworks-rs/groth16/blob/master/tests/mimc.rs) should serve as a good reference though.

After that removal, if one wants to find circuit examples, since they are not specific to groth16 but also work for other proof systems in this organization such as gemini and marlin, they are usually found in r1cs-std.

@tdelabro
Copy link
Author

I can understand the burden of maintaining those examples, and it may be sensible to have examples using types like UInt8 live in the r1cs-std.

This being said, the examples in r1cs-std are not enough. There are tests, but no examples. They are limited in their scope and don't showcase a full e2e (setup, prove, verify) flow.

Also, it took me ages to discover that using UInt8 as public input involves passing 8 bools as arguments to the verifier. It's not showcased in any test, nor documented (afaik).

Do you want me to move my example to r1cs-std instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants