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

Circuit: Update value_commit_orchard to take into account asset #50

Merged
merged 8 commits into from
Apr 21, 2023

Conversation

ConstanceBeguier
Copy link

In the circuit, we update value_commit_orchard to take into account asset.
Previously, value_commit_orchard returns cv_net = [v_net] ValueCommitV + [rcv] ValueCommitR..
Now, value_commit_orchard returns cv_net = [v_net] asset + [rcv] ValueCommitR.
ValueCommitV and ValueCommitR are constants
v_net is equal to sign * magnitude where sign is in {-1, 1} and magnitude is an unsigned integer on 64 bits.

To evaluate [v_net] asset where v_net = sign * magnitude, we perform the following steps

  1. verify that magnitude is on 64 bits
  2. evaluate commitment=[magnitude]asset with the variable-base long-scalar multiplication
  3. evaluate result=[sign]commitment with the new mul_sign gate

@what-the-diff
Copy link

what-the-diff bot commented Mar 21, 2023

PR Summary

  • Remove ScalarFixedShort from the circuit - This component was removed from the code
  • Add asset to value_commit_orchard gadget - Enhance the gadget with a new asset feature
  • Update proof size and tests - Modify test cases and proof size accordingly
  • Introduce new file value_commit_orchard.rs - Create a file for ValueCommit^Orchard implementation
  • Implement ValueCommit^Orchard circuit - Implement a circuit based on a specific section from the Zcash protocol
  • Add tests for correctness - Write test cases to verify accurate implementation

@ConstanceBeguier ConstanceBeguier force-pushed the circuit_cv_net_with_asset_v2 branch from 1c9b9fc to 68497b5 Compare April 19, 2023 13:13
@ConstanceBeguier ConstanceBeguier merged commit 563b4e5 into zsa1 Apr 21, 2023
@ConstanceBeguier ConstanceBeguier deleted the circuit_cv_net_with_asset_v2 branch April 21, 2023 12:35
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