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

Use DPC with non-trivial predicate #4

Open
sam-steffen opened this issue Dec 18, 2020 · 1 comment
Open

Use DPC with non-trivial predicate #4

sam-steffen opened this issue Dec 18, 2020 · 1 comment

Comments

@sam-steffen
Copy link

How can I use DPC to instantiate the very simple "conserve" predicate required to encode the basic user-defined asset from the reference paper [1]?

I could not figure out how to do this. The current implementation hardcodes an "always accept" predicate and it's unclear how to instantiate the "conserve" predicate: the sum of inputs should equal the sum of outputs.

[1] https://eprint.iacr.org/2018/962

@sam-steffen
Copy link
Author

My current plan seems much more complicated than expected; am I on the right track?

Step 1: Create R1CS
It seems like I'd have to implement the ConstraintSynthesizer trait generating a R1CS for the predicate. But, how can I represent the "conserve" predicate as a R1CS? I know there are reductions from arithmetic circuits to R1CS [2] but don't know a standalone tool which automates this (I could not figure out how to do this in libsnark).

Step 2: Integrate predicate
The "always accept" predicate EmptyPredicateCircuit is hard-coded in the plain_dpc module (even outside the tests). Hence, I'd have to refactor the code to allow a different predicate.

[2] https://eprint.iacr.org/2013/507.pdf

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