Skip to content

Conversation

@landabaso
Copy link
Member

@landabaso landabaso commented Nov 23, 2025

This PR adds support for sortedmulti() descriptors in standard contexts:

  • sh(sortedmulti(...))
  • wsh(sortedmulti(...))
  • sh(wsh(sortedmulti(...)))

The implementation includes parsing and validation of sortedmulti(M, keys...), treated as a script expression.

Tests

  • Added complete integration test suite covering:

    • sh(sortedmulti)

    • wsh(sortedmulti)

    • sh(wsh(sortedmulti))

    • Positive flows: fund → PSBT → sign → finalize → broadcast

    • Negative cases:

      • M > N
      • More than 20 keys
      • P2SH exceeding script-size limits
  • Added fixture coverage for sortedmulti in SegWit and nested contexts.

  • Updated integration commands to include sortedmulti tests.

Note on Key Count Limit (Temporary)

Although sortedmulti support up to 20 keys, actual multisig scripts created through bitcoinjs-lib are temporarily limited to 16 keys until this PR is merged.

Version bump

This PR also bumps the package version to 2.3.5 to publish the new functionality.

Fixes #44

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.

sortedmulti

3 participants