Skip to content

Conversation

karim-en
Copy link
Collaborator

No description provided.

&mut self,
input: Vec<OutPoint>,
output: Vec<TxOut>,
orchard_bundle: Option<Vec<u8>>,

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];

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>,
Copy link

@daira daira Oct 6, 2025

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?
Copy link

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.

Copy link
Collaborator Author

@karim-en karim-en Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daira, we can't create the zkproof on-chain over PCZT, it is very gas-intensive. We planned to generate it off-chain and then pass it and verify it.
cc @str4d

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.

3 participants