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

Refactor Proof APIs to take Public and Private input as separate structs #3563

Closed
7 tasks done
cronokirby opened this issue Jan 3, 2024 · 0 comments · Fixed by #3595
Closed
7 tasks done

Refactor Proof APIs to take Public and Private input as separate structs #3563

cronokirby opened this issue Jan 3, 2024 · 0 comments · Fixed by #3595
Assignees
Labels
A-zkproofs Area: Design and implementation of ZK-SNARKs for Penumbra

Comments

@cronokirby
Copy link
Contributor

cronokirby commented Jan 3, 2024

See the ConvertProof introduced in #3556 as an example of doing this. The idea is that each proof will have a related struct for the public inputs and private inputs to the circuit. We should also make the fields of the Circuit struct private, only allowing creating circuits via the DummyWitness trait.

Some advantages of this:

  • It makes it clearer what the public and private inputs are.
  • It removes duplication of parameters between proving and verifying.
  • It makes the functions have fewer parameters, whereas now they have a lot, to the point that clippy complains.
  • It makes writing a Rust version of the circuit satisfaction code easier.

Circuits that need to be changed:

  • Spend
  • Output
  • DelegatorVote
  • UndelegateClaim
  • Swap
  • SwapClaim
  • NullifierDerivation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-zkproofs Area: Design and implementation of ZK-SNARKs for Penumbra
Projects
Archived in project
Status: Testnet 63: Rhea (Web Wallet)
Development

Successfully merging a pull request may close this issue.

2 participants