-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Schnorr is not compatible with BIP340 #1365
Comments
I don't think that's the case? Passing secp256k1/src/modules/schnorrsig/tests_impl.h Lines 110 to 114 in acf5c55
|
@landabaso do your tests say otherwise? |
I see the linked issue now. I think there is some confusion.
Both are BIP340 compliant (emphasis mine):
Using random nonces is recommended and obviously better, but libsecp256k1 has no access to high-quality randomness; it's up to the caller to provide it. |
Thanks for clarifying this! Your behavior is perfectly fine. The topicstarter just wanted to replicate libsecp behavior, so I guess we can point to use 32 0x00 bytes and be done. |
I was about to say that this should be documented, but it turns out that it is documented: secp256k1/include/secp256k1_schnorrsig.h Lines 113 to 117 in 0fa84f8
|
I believe this has been mentioned in comment #757 (comment), but nevertheless decided to open an issue for visibility.
BIP340 https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki#default-signing clearly says
auxRand
should always be used even if it's all-zero. It also provides exact algorithm to calculate nonce from it.Right now, libsecp256k1, when auxRand was not passed, uses its own nonce generation algorithm.
It would be good to make the library follow specification.
The text was updated successfully, but these errors were encountered: