Skip to content
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

ZSA assets swap #116

Open
wants to merge 19 commits into
base: zsa1
Choose a base branch
from
Open

ZSA assets swap #116

wants to merge 19 commits into from

Conversation

ConstanceBeguier
Copy link

@ConstanceBeguier ConstanceBeguier commented Oct 10, 2024

This PR introduces the ability to create ActionGroup and SwapBundle for performing asset swaps.

This PR modifies the Builder:

  • A new split_notes element has been added, which contains reference split notes. These notes can be used when creating actions from spend and output notes.
  • A new build_action_group function allows the creation of an ActionGroup from a Builder. Like when creating a Bundle, the ActionGroup will initially be without proof and signatures. You will need to call create_proof and apply_signatures to add them.

This PR creates a new SwapBundle structure. A SwapBundle is created from a list of ActionGroups. During this creation, the following operations are performed

  • The evaluation of the value balance of the SwapBundle (by summing the value balances of each ActionGroup).
  • The evaluation of the binding signature key bsk of the SwapBundle (by summing the bsk of each ActionGroup).
  • The binding signature of the SwapBundle which is equal to the signature of the SwapBundle SIGHASH with the binding signature key bsk.

@ConstanceBeguier ConstanceBeguier changed the title [WIP] ZSA assets swap ZSA assets swap Oct 18, 2024
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.

1 participant