Skip to content

Add Musig2 Support for FFM - #421

Draft
liamgilligan wants to merge 1 commit into
bitcoinj:masterfrom
liamgilligan:add-musig-headers
Draft

Add Musig2 Support for FFM#421
liamgilligan wants to merge 1 commit into
bitcoinj:masterfrom
liamgilligan:add-musig-headers

Conversation

@liamgilligan

@liamgilligan liamgilligan commented Jun 4, 2026

Copy link
Copy Markdown
Member

Basic musig signing capabilities implemented and tested using the BIP-327 test vectors.

Things needed before merge:

  • Add support for tweaks
  • Remove test helper functions from SecpForeign
  • Improve test coverage
  • Decide on API
  • Break into more atomic commits
  • Add more thorough documentation

@liamgilligan

Copy link
Copy Markdown
Member Author

Added in all the BIP-327 test vectors. It is certainly possible there is a much better way of parsing the .jsons than what I am currently doing. My main priority for this most recent push was simply having the tests run all the test vectors. I may clean them up soon.

@liamgilligan

Copy link
Copy Markdown
Member Author

I was able to use JsonNodes to significantly cleanup the code, removing around ~10 unnecessary records.

@msgilligan

msgilligan commented Jun 13, 2026

Copy link
Copy Markdown
Member

The failing tests are most likely because the Ubuntu 24.04 GItHub Actions runners are using libsecp256k1 v0.2.0.

4a91bb3 updates to Ubuntu 26.04 (which has libsecp v0.7.0) and should fix the broken tests.

@liamgilligan

Copy link
Copy Markdown
Member Author

Began cleaning up API by creating interfaces and impls for new return types. There needs to be someway to handle libsec's opaque data structures (namely musig_keyagg_cache and secp256k1_musig_secnonce) in a clean way -- if we must avoid recreating these opaque structures as they are subject to change (namely the magic byte prefix, IIRC) and will introduce difficulties in making the API implementation agnostic.

@msgilligan

Copy link
Copy Markdown
Member

First glance at rebase looks good! Thanks!

@msgilligan msgilligan changed the title Add Musig Support for FFM Add Musig2 Support for FFM Aug 8, 2026
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.

2 participants