-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: add tweakHash
and extraEntropy
optional params to signSchnorr()
#6
feat: add tweakHash
and extraEntropy
optional params to signSchnorr()
#6
Conversation
Q: |
|
Another option is to add the
|
src/ecpair.d.ts
Outdated
verifySchnorr(hash: Buffer, signature: Buffer): boolean; | ||
signSchnorr(hash: Buffer): Buffer; | ||
verifySchnorr(hash: Buffer, signature: Buffer, tweak?: Buffer): boolean; | ||
signSchnorr(hash: Buffer, extraEntropy?: Buffer, teak?: Buffer): Buffer; |
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.
Tweak?
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.
Fixed typo.
The question to ask is "will the interface users need to pass in data?"
Since we will be signing tweaked with various things based on the hashing of scripts done outside ECPair keeping it as a parameter to the method rather than an instantiation parameter seems wiser. |
Please let me know if there is something I should change to this PR. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I actually think Option 2 is a good approach for the cc: @tiero, @brandonblack |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Okok makes sense. So would go with option 2 as well. Also what if verifying with pubkey only happens in validareSignatureOfInput and we ask optional tweak pubkey there as parameter? (Or also this we cant change?) |
I think I'm in favor of a tweak function interface rather than adding the argument to
|
👍 |
Will be done in a different PR. |
Related to: bitcoinjs/bitcoinjs-lib#1742 (comment)
Taproot requires that the Schnorr Signature is produced from the tweaked private key (corresponding to the Output Key)
Changes:
tweakHash
optional parameter tosignSchnorr()
extraEntropy
optional parameter tosignSchnorr()