rust-bitcoin / rust-secp256k1

Rust language bindings for Bitcoin secp256k1 library.
Creative Commons Zero v1.0 Universal
341 stars 262 forks source link

Add Musig2 module #716

Open jlest01 opened 2 months ago

jlest01 commented 2 months ago

This PR adds a musig module based on https://github.com/bitcoin-core/secp256k1/pull/1479. The structure is based on @sanket1729's https://github.com/BlockstreamResearch/rust-secp256k1-zkp/pull/48, but I removed the code related to adaptor signatures.

There is an example file in examples/musig.rs and can be run with cargo run --example musig --features "rand std". The ffi functions were added to secp256k1-sys/src/lib.rs and the API level functions to the new src/musig.rs file.

tcharding commented 1 month ago

This is a 10 thousand line diff, is something commited that shouldn't be?

apoelstra commented 1 month ago

It updates the vendored library to bring in the upstream MuSig PR.

jlest01 commented 1 month ago

It updates the vendored library to bring in the upstream MuSig PR.

Yes. For now, only the last three commits matter for review purposes. The others will be discarded when the upstream MuSig PR is merged.

tcharding commented 1 month ago

Cool, thanks. To clarify this is going to wait till upstream merges before being considered for merge, right? What sort of review are you chasing?

Kixunil commented 1 month ago

@tcharding I will definitely not ack this until it's upstream is released. However I appreciate the experiment/demo.

jlest01 commented 1 month ago

To clarify this is going to wait till upstream merges before being considered for merge, right? What sort of review are you chasing?

Yes, the idea is to wait for the upstream PR to be merged. Regarding the review, I mean that the last three commits are the ones that are intended to be merged.