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

Better distinction between "gadget" and "variable" types #36

Open
dtebbs opened this issue Nov 1, 2021 · 0 comments
Open

Better distinction between "gadget" and "variable" types #36

dtebbs opened this issue Nov 1, 2021 · 0 comments

Comments

@dtebbs
Copy link
Contributor

dtebbs commented Nov 1, 2021

Objects such as G1_variable or r1cs_gg_ppzksnark_verification_key_variable are simply containers of logical groups of pb_variables and pb_linear_combinations. However, many of them still inherit from gadget (which in turn implies that they generate conditions), simply in order to maintain a reference to the protoboard.

These "variable" objects could inherit gadgets privately, since they only use the base class internally to access this->pb. Alternatively (preferably) we may wish to define a new interface for such objects, whereby they only have set (or generate_r1cs_witness) methods.

Potentially, we could also slim-down the variable objects by passing in the pb reference rather than redundantly storing it with every "variable" instance. e.g. the verification key variables hold the pb ref, as do each of their G1_variable and G2_variable members. (Note, a similar argument about the pb ref could also be made for regular gadgets).

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

No branches or pull requests

1 participant