-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add orchard binding_verification_key #2441
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we need to do two things before we can make progress on this PR:
- Fix the sapling value balance errors in Fix sapling binding signature errors #1939
- Work with a cryptographer to understand the Orchard value balance consensus rules, and how they are different from Sapling
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@oxarbitrage I moved this from draft to not-draft if that's ok with you |
Can we focus on state changes for this sprint? We can do this validation next sprint, or delay it until we have time. |
Oh sure yes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, some suggestions on the doc comments 📜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, some suggestions on the doc comments 📜
Does this no longer close #2103 also? |
Thank you for the question. I removed more code than i should in one of the rebases, the validation code was here so i will readd. With this addition this PR will close both tickets as initially intended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 6 unresolved discussions (waiting on @dconnolly and @teor2345)
zebra-chain/src/orchard/shielded_data.rs, line 61 at r4 (raw file):
Previously, dconnolly (Deirdre Connolly) wrote…
/// Getting the binding signature validating key from the Action description /// value commitments and the balancing value implicitly checks that the /// balancing value is consistent with the value transferred in the /// Action descriptions, but also proves that the signer knew the /// randomness used for the Action value commitments, which /// prevents replays of Action descriptions that perform an output. /// In Orchard, all Action descriptions have a spend authorization signature, /// therefore the proof of knowledge of the value commitment randomness /// is less important, but stills provides defense in depth, and reduces the /// differences between Orchard and Sapling.
Done.
zebra-chain/src/orchard/shielded_data.rs, line 65 at r4 (raw file):
Previously, dconnolly (Deirdre Connolly) wrote…
/// The net value of Orchard spends minus outputs in a transaction /// is called the balancing value, measured in zatoshi as a signed integer /// cv_balance.
Done.
zebra-chain/src/orchard/shielded_data.rs, line 69 at r4 (raw file):
Previously, dconnolly (Deirdre Connolly) wrote…
/// Consistency of cv_balance with the value commitments in Action /// descriptions is enforced by the binding signature.
Done.
zebra-chain/src/orchard/shielded_data.rs, line 73 at r4 (raw file):
Previously, dconnolly (Deirdre Connolly) wrote…
/// Instead of generating a key pair at random, we generate it as a function /// of the value commitments in the Action descriptions of the transaction, and /// the balancing value.
Done.
zebra-chain/src/orchard/shielded_data.rs, line 82 at r4 (raw file):
Previously, dconnolly (Deirdre Connolly) wrote…
Looks good 👍
Done.
zebra-consensus/src/transaction.rs, line 544 at r1 (raw file):
Previously, teor2345 (teor) wrote…
Please add TODO comments about the missing Orchard checks, with a ticket number for each check.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Motivation
Binding verification key must be implemented.
Closes #2102
Closes #2103
Specifications
https://zips.z.cash/protocol/protocol.pdf#orchardbalance
Solution
Implement simular to sapling. This is a draft.
Review
I will like @dconnolly to take an initial view. I made some comments where i have some doubts.
Reviewer Checklist
Follow Up Work
This change is