-
Notifications
You must be signed in to change notification settings - Fork 0
feat: shielded TX support #6
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
base: zcash_support
Are you sure you want to change the base?
Conversation
&mut self, | ||
input: Vec<OutPoint>, | ||
output: Vec<TxOut>, | ||
orchard_bundle: Option<Vec<u8>>, |
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.
And for what reasons might we need orchard_bundle in active UTXO management? I suggest removing it from here.
actual_received_amounts.len() <= 1, | ||
"only one user output is allowed." | ||
); | ||
let actual_received_amount = actual_received_amounts[0]; |
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.
Next come the checks of the amount the user will receive. In shielded transactions we don’t know this amount and don’t know how much was spent on gas.
input: Vec<OutPoint>, | ||
output: Vec<TxOut>, | ||
max_gas_fee: Option<U128>, | ||
orchard_bundle_bytes: Option<String>, |
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.
The naming of this is confusing. It's a String containing the hex bytes of the Orchard section of the transaction. This should probably be documented I think (if it's what you intend). We normally use "bundle" to refer to the in-memory OrchardBundle
structure — which is why at first I posted a comment about memory safety, misunderstanding it a hex encoding of that structure.
// let value = "<Amount of the output>"; | ||
|
||
// TODO: verify orchard bundle | ||
// How to verify orchard bundle value and recipient? |
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.
You can't verify that just based on the bytes of the Orchard section of the transaction. You need to have the data that was encrypted and encoded to produce those bytes. That is available in the PCZT. I think @str4d will need to explain this.
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.
No description provided.