-
Notifications
You must be signed in to change notification settings - Fork 255
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
Implementation for ZIP-222 Transparent Zcash Extensions #286
Conversation
Codecov Report
@@ Coverage Diff @@
## master #286 +/- ##
==========================================
- Coverage 68.17% 66.89% -1.28%
==========================================
Files 59 62 +3
Lines 5963 6435 +472
==========================================
+ Hits 4065 4305 +240
- Misses 1898 2130 +232
Continue to review full report at Codecov.
|
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.
Looking good overall!
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
…able. Fix demo test compilation errors.
This adds a `Future` variant for both BranchId and NetworkUpgrade.
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: str4d <thestr4d@gmail.com>
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.
utACK
} | ||
|
||
#[derive(Debug, PartialEq)] | ||
pub enum Error<E> { |
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 may be possible now to move this to zcash_extensions.
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.
utACK with comments.
// The witness is expected to commit to the precommitment internally? | ||
// (Or make it part of the sighash?) | ||
// - TODO: Check whether transparent inputs committing to script_pubkey was | ||
// only so that hardware wallets "knew" what address was being spent from. |
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.
I believe so. @str4d?
(In any case this TODO should be resolved.)
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.
@str4d what are your thoughts here? It seems like the information that a hardware wallet would need to display to the user in order for that user to be able to confidently sign a TZE transaction would vary by TZE; is there actually anything "general" that we can do here?
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.
I think the "general" thing we do is what we are currently doing: require the entire TZE precondition to be part of the signed transaction digest. Any future address format linked to TZEs would be inherently linked to a particular precondition, and thus derivable from it.
The "Need to enable witness to commit to the amount" is already "solved", because each TZE has access to the prevout
before calling Builder::add_tze_input
, so they can cache the needed properties there. Alternatively, we could explicitly pass the prevout back to them when calling tze_in.builder
.
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.
I think expecting the TZE to cache what it needs is the proper thing to do here. That makes it so that there's a single path by which the implementers can achieve their goal, which is a good thing.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This implements the core data structures and transaction builder function for TZEs.
ZIP: zcash/zips#248