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

Add high-level helpers for using Musig2 with Taproot #110

Closed
wants to merge 7 commits into from

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Jan 12, 2024

When using Musig2 for a taproot key path, we can provide simpler helper functions to collaboratively build a shared signature for the spending transaction.

This hides all of the low-level details of how the musig2 algorithm works, by exposing a subset of what can be done that is sufficient for spending taproot inputs.

@sstone
Copy link
Member

sstone commented Jan 17, 2024

This should be "rebased" on top of #107, which implements a musig2 API that is different than the current prototype on master and is based on ACINQ/secp256k1-kmp#93 which implements a low-level musig2 API that tracks what will be added to https://github.com/bitcoin-core/secp256k1/ and should not change much now.

@t-bast
Copy link
Member Author

t-bast commented Jan 17, 2024

Nice, I'll do that!

When using Musig2 for a taproot key path, we can provide simpler helper
functions to collaboratively build a shared signature for the spending
transaction.

This hides all of the low-level details of how the musig2 algorithm
works, by exposing a subset of what can be done that is sufficient for
spending taproot inputs.
This is WIP as the low-level API isn't convenient and probably needs
to be reworked.
@t-bast
Copy link
Member Author

t-bast commented Jan 18, 2024

This should be "rebased" on top of #107, which implements a musig2 API that is different than the current prototype on master and is based on ACINQ/secp256k1-kmp#93 which implements a low-level musig2 API that tracks what will be added to https://github.com/bitcoin-core/secp256k1/ and should not change much now.

I started the rebase, but the exposed functions are quite inconvenient to work with, I suspect that #107 can be greatly improved. I'll review it thoroughly once the libsecp256k1 version is stable enough.

@sstone
Copy link
Member

sstone commented Jan 18, 2024

I started the rebase, but the exposed functions are quite inconvenient to work with, I suspect that #107 can be greatly improved. I'll review it thoroughly once the libsecp256k1 version is stable enough.

secp256k1-kmp is "dumb" and exposes secp256k1's API as directly as possible, if it's difficult to work with we may want to open issues upstream. In any case I'd rather keep secp256k1-kmp as simple as possible (from an integration p.o.v) and if needed provide better abstractions in this library instead.

@t-bast
Copy link
Member Author

t-bast commented Jan 18, 2024

I agree that secp256k1-kmp should directly wrap secp256k1 without adding helper functions. But bitcoin-kmp should definitely add those helper functions to hide the secp256k1 API whenever possible!

@sstone
Copy link
Member

sstone commented Jan 18, 2024

Sorry I thought you meant ACINQ/secp256k1-kmp#93. I agree that #107 is pretty basic but it made building our new swap-in protocol simpler (because it's easier to see how musig2 is used).

@t-bast t-bast closed this Jan 25, 2024
@t-bast t-bast deleted the musig2-abstractions branch January 25, 2024 14:15
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