Skip to content

feat/multisig support - #65

Merged
raphjaph merged 4 commits into
rust-bitcoin:masterfrom
aagbotemi:feat/multisig-support
Jul 28, 2026
Merged

feat/multisig support#65
raphjaph merged 4 commits into
rust-bitcoin:masterfrom
aagbotemi:feat/multisig-support

Conversation

@aagbotemi

@aagbotemi aagbotemi commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Add multisig support to BIP-322 message signing and verification.

Changes

  • Update sign_simple_encoded and sign_full_encoded to accept wif_private_keys: &[impl AsRef<str>] and witness_script_hex: Option<&str> instead of a single WIF key
  • Add create_message_signature_p2wsh for P2WSH multisig witness construction
  • Add create_message_signature_p2sh_multisig for P2SH multisig script_sig construction
  • Add verify_full_p2wsh for P2WSH and P2SH-P2WSH multisig verification.
  • Add verify_full_p2sh_multisig for legacy P2SH multisig script_sig verification
  • Add parse_multisig to decode m-of-n parameters and public keys
  • Add NoPrivateKeys error variants

Closes #25

@aagbotemi
aagbotemi force-pushed the feat/multisig-support branch from a5e12aa to f509db6 Compare July 7, 2026 11:26
@aagbotemi
aagbotemi force-pushed the feat/multisig-support branch 2 times, most recently from ef2aa60 to e6fc863 Compare July 18, 2026 01:10

@raphjaph raphjaph left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, just a couple of nits

Comment thread src/lib.rs Outdated
&[P2WSH_2OF2_PRIVATE_KEY_1, WIF_PRIVATE_KEY],
Some(P2WSH_2OF2_WITNESS_SCRIPT),
)
.is_err());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe assert the exact error type since we have them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, fixed it

Comment thread src/util.rs Outdated

#[allow(clippy::result_large_err)]
pub fn parse_multisig(script: &bitcoin::Script) -> Result<(usize, Vec<PublicKey>)> {
use bitcoin::script::Instruction;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Put all import statements either at top of file or in src/lib.rs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 1657fa8

@raphjaph

raphjaph commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

I just merged #79 to update the MSRV to 1.74, following what rust-bitcoin has. If you @aagbotemi update this branch the CI should pass. I'll also try and have a look at your other PRs during this week. @johnzilla will also look at yours

@aagbotemi
aagbotemi force-pushed the feat/multisig-support branch from e6fc863 to 1657fa8 Compare July 27, 2026 06:28
@aagbotemi

Copy link
Copy Markdown
Contributor Author

I just merged #79 to update the MSRV to 1.74, following what rust-bitcoin has. If you @aagbotemi update this branch the CI should pass.

Thank you for the review, and I've updated the PR.

I'll also try and have a look at your other PRs during this week. @johnzilla will also look at yours

I'll be looking forward to it.

@raphjaph raphjaph left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@raphjaph
raphjaph merged commit e8accbe into rust-bitcoin:master Jul 28, 2026
13 checks passed
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.

Implement multi-sig support

2 participants