-
Notifications
You must be signed in to change notification settings - Fork 198
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
k256: Taproot Schnorr (BIP 340) #554
Conversation
Implements Taproot-flavored Schnorr signatures as described in: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki Work-In-Progress implementation: BROKEN, DO NOT USE
k256/src/schnorr.rs
Outdated
// TODO(nickray): maybe store (FieldElement, NonScalar), avoiding the unwraps. | ||
// However, this | ||
// a) contradicts tarcieri's philosophy of storing "bag of bytes" | ||
// b) makes the Debug, Eq, PartialEq, PartialOrd, Ord impls tricky, | ||
// as FieldElement + NonZeroScalar don't implement them, so we'd have to | ||
// either modify upstream or implement in terms of the calculated `to_bytes`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to store the parsed components of the signature alongside bytes
.
To simplify some of the questions you can remove the PartialOrd
and Ord
derives. I'm not sure they're useful for anything.
A handwritten Debug
would probably make sense, either displaying the byte serialization or the parsed components of the signature.
Will go ahead and merge this. There are a few things I think can be addressed in a followup PR, most notably implementing the |
Implements Taproot-flavored Schnorr signatures as described in: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki Co-authored-by: Tony Arcieri <bascule@gmail.com> Co-authored-by: Nicolas Stalder <nstalder@jumpcrypto.com>
Implements Taproot-flavored Schnorr signatures as described in:
https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
Based on #482, rebased onto master branch.