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

Murisi/multisig reordering #1794

Closed
wants to merge 13 commits into from
Closed

Murisi/multisig reordering #1794

wants to merge 13 commits into from

Conversation

murisi
Copy link
Contributor

@murisi murisi commented Aug 8, 2023

Describe your changes

Making the multisignature changes more compatible with hardware wallet signing. The core issue is that the final transaction building API settled upon needs to allow consumers to 1) build transactions 2) generate test vector 3) filter out sensitive sections 4) sign the transaction and 5) broadcast the transaction in that order. Some notes on the above ordering:

  • Steps (3) and (4) may optionally happen on a hardware wallet which is able to parse only a Borsh serialized Tx object
  • Step (2) must happen before step (3) because signing test vectors need to contain sensitive data to be useful
  • Step (3) must happen before step (4) otherwise signatures over filtered out data will be rejected by protocol

The following changes have been made in order to achieve the above goal:

  • Code reordered so that the following order is observed: build, generate test vector, filter, sign, broadcast
  • The TxBuilder API has been merged into the Tx API and the build function has been removed
    • This way presigned prefiltered Txs will now be available to consumers.
  • The add_gas_payer and add_signing_keys functions have been mutated into sign_wrapper and sign_raw.
  • The builder API is now based on mutable references instead of ownership, in order to reduce the amount of moving

Indicate on which release or other PRs this topic is based on

Based on #1765 .

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@murisi murisi force-pushed the murisi/multisig-reordering branch 2 times, most recently from 279e8cf to 60a1583 Compare August 9, 2023 05:44
@murisi murisi force-pushed the murisi/multisig-reordering branch from 60a1583 to 39c0983 Compare August 9, 2023 06:34
@murisi murisi force-pushed the murisi/multisig-reordering branch 3 times, most recently from 5470e0d to a08faee Compare August 9, 2023 13:11
@murisi murisi marked this pull request as ready for review August 9, 2023 14:18
core/src/proto/types.rs Outdated Show resolved Hide resolved
@murisi murisi mentioned this pull request Aug 9, 2023
2 tasks
core/src/proto/types.rs Outdated Show resolved Hide resolved
core/src/proto/types.rs Outdated Show resolved Hide resolved
Copy link
Member

@tzemanovic tzemanovic left a comment

Choose a reason for hiding this comment

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

I left couple smaller comments, besides that LGTM

@tzemanovic
Copy link
Member

the cli params in tests/src/integration/masp.rs need to be updated for multisig (can run faster with #1768)

@murisi murisi closed this Aug 11, 2023
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