zcash / librustzcash

Rust-language assets for Zcash
Other
324 stars 242 forks source link

Handling of change memos imposes artificial constraints #1440

Open daira opened 3 days ago

daira commented 3 days ago

In #1257, I needed to use an ignore_change_memo flag that is set for the second transaction in a ZIP 320 pair, in order to avoid incorrectly creating shielded change in that transaction when a change memo is given.

@str4d wrote at https://github.com/zcash/librustzcash/pull/1257/files#r1655535475 :

This feels weird to me, and I think it's because the Proposal::multi_step constructor takes a single change strategy for all steps, and the change memo is stored in the change strategy. This doesn't allow for encoding which step should have the change memo if there are multiple change outputs (or whether the memo should be added to all change outputs).