-
Notifications
You must be signed in to change notification settings - Fork 216
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 Schnorr adaptor signatures module #299
base: master
Are you sure you want to change the base?
Conversation
7d7518a
to
6e50daf
Compare
This commit adds the foundational configuration, building scripts, and an initial structure for the project.
This commit adds a nonce function that will be used by default for Schnorr adaptor signatures. This nonce function is similar to secp256k1_nonce_function_hardened with an extra argument for a compressed 33-byte adaptor point.
This commit adds the Schnorr adaptor signature APIs: - adaptor_presign Creates a pre-signature for a given message and adaptor point. - adaptor_extract Extracts the adaptor point from a pre-signature. - adaptor_adapt Adapts the pre-signature to produce a BIP-340 Schnorr signature. - adaptor_extract_sec Extracts the secret adaptor (discrete logarithm of adaptor point) from a pre-signature and the corresponding BIP-340 signature.
This commit adds test coverage, modifying the ci.yml file, Valgrind constant time tests for secret data, API tests, nonce function tests, and test vectors from the spec.
This commit adds an example that implements the Multi-hop Locks protocol using the Schnorr adaptor signature APIs
6e50daf
to
c2f2709
Compare
Hello ! I am really interested by using this with a rust binding for DLCs using Taproot. I guess such binding is not coming anytime soon even thought it was drafted for MuSig2 in BlockstreamResearch/rust-secp256k1-zkp#48. Not being a C++ dev I wonder what is missing for this work to be merged and if I can help in any way. Thank you all for the work done already! |
I have Rust wrappers for this module in my fork of rust-secp256k1-zkp: https://github.com/siv2r/rust-secp256k1-zkp/tree/schnorr-adaptor-bindings. You can use them, but I wouldn’t recommend them for production until they get reviewed by the rust-secp256k1-zkp maintainers. I plan to open a pull request there soon. |
Thank you for your time, this is really great thank you a lot for sharing 🙏 I will look forward for your PR in rust-secp256k1-zkp and will do my best to provide you early feedback on your fork 👍 |
Overview
This PR adds support for Schnorr Adaptor signatures. It is based on the PR #268 by @ZhePang, rebased and updated to address all pending review comments. Test coverage has been improved.
Schnorr Adaptor Signatures
This implementation follows the Python specification and includes test vectors from the specification. Additionally, it provides an example that demonstrates the Multi-Hop Locks protocol using this Schnorr adaptor module.