Conversation
b9e9112 to
f4fdf5c
Compare
src/swap_bundle.rs
Outdated
| .iter() | ||
| .fold( | ||
| self.action_group | ||
| .prepare_for_action_group(&mut rng, action_group_digest), |
There was a problem hiding this comment.
Why do we get action_group_digest as parameter? Unlike sighash it is available via self, isn't it? This should be more fool-proof
There was a problem hiding this comment.
It is exactly similar to the prepare function for Bundle.
It is inside the prepare_for_action_group function that you save the digest into self.
There was a problem hiding this comment.
Yeah, yeah, I see where this design is coming from. It's just that in case of tx sighash it makes more sense because you don't have it inside the bundle
Anyway, given our conversations regarding signing sighash for action groups too unders some circumstances (e.g. when ther is only single action group inside tx) - it starts to be relevant for action group too
All set of keys (user1, user2, matcher, reference) must be different.
This PR contains a set of additions/changes that allow ZSA Swaps to be implemented in librustzcash: - Adds Swap BundleType and Flag - Adds AuthorizedWithProof trait that defines proof() method for both Authorized and ActionGroupAuthorized - Adds utility methods e.g. from_parts() for SwapBundle, is_empty() in Builder - Changes visibility of some methods e.g. dummy() for testing in librustzcash - Removes ActionGroup structure
# Conflicts: # src/builder.rs # src/pczt/tx_extractor.rs
9d7d5fb to
874f255
Compare
This PR introduces the ability to create
ActionGroupandSwapBundlefor performing asset swaps.This PR modifies the
Builder:reference_noteselement has been added, which contains reference split notes. These notes can be used when creating actions.build_action_groupfunction allows the creation of anActionGroupfrom aBuilder. Like when creating aBundle, theActionGroupwill initially be without proof and signatures. You will need to callcreate_proofandapply_signaturesto add them.This PR creates a new
SwapBundlestructure. ASwapBundleis created from a list ofActionGroups. During this creation, the following operations are performedSwapBundle(by summing the value balances of eachActionGroup).bskof theSwapBundle(by summing thebskof eachActionGroup).SwapBundlewhich is equal to the signature of the SwapBundle SIGHASH with the binding signature keybsk.TODO
ZIP