-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Sighash taproot keyspend bug fix #1941
Merged
Roasbeef
merged 3 commits into
btcsuite:master
from
Roasbeef:sighash-taproot-keyspend-bug-fix
Jan 25, 2023
Merged
Sighash taproot keyspend bug fix #1941
Roasbeef
merged 3 commits into
btcsuite:master
from
Roasbeef:sighash-taproot-keyspend-bug-fix
Jan 25, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 4002408802
💛 - Coveralls |
guggero
approved these changes
Jan 24, 2023
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.
Nice find!
Looks good, just one comment about adding PayToTaprootScript
to txscript
, as there are several occurrences of it in other code (lnd, taro) and even two different approaches in the unit tests here.
Crypt-iQ
approved these changes
Jan 24, 2023
sputn1ck
approved these changes
Jan 24, 2023
In this commit, we fix a bug in RawTxInTaprootSignature that would cause the function to not properly apply the sighash flag for non-default sighash signatures. The logic would end up applying `0x00` as a mask, which will always be `0x00` on the other end. The RawTxInTapscriptSignature function was correct, though it had the ordering switched as it applies the sighash if the type doesn't equal default.
…ignature In this commit, we add tests for the public functions used to generate keyspend and tapscript signatures. Without the prior commit, these tests will fail as the keyspend function won't properly add the sighash bytes for things that aren't sighash default.
Roasbeef
force-pushed
the
sighash-taproot-keyspend-bug-fix
branch
from
January 25, 2023 02:47
ec7b2af
to
d6efaa7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, we fix a bug in RawTxInTaprootSignature that would cause
the function to not properly apply the sighash flag for non-default
sighash signatures. The logic would end up applying
0x00
as a mask,which will always be
0x00
on the other end.The RawTxInTapscriptSignature function was correct, though it had the
ordering switched as it applies the sighash if the type doesn't equal
default.
The second commit adds tests that fail w/o the first commit. Without
the first commit, the test fails for the keyspend sigs as they're always
64 bytes, since the sighash wasn't added for non-default types.