-
Notifications
You must be signed in to change notification settings - Fork 276
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
gui, psbt: Use SIGHASH_DEFAULT when signing PSBTs #850
base: master
Are you sure you want to change the base?
Conversation
SIGHASH_DEFAULT should be used to indicate SIGHASH_DEFAULT for taproot inputs, and SIGHASH_ALL for all other input types. This avoids adding an unnecessary byte to the end of all Taproot signatures added to PSBTs signed in the GUI.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Two bytes, isn't it? For the PSBT_IN_SIGHASH keytype |
No, that field is not added. This is referring to the actual signature that will show up in the scriptWitness, and as appears in |
utACK 3e97ff9 It would be useful for the You have to crawl all the way to // BASE/WITNESS_V0 signatures don't support explicit SIGHASH_DEFAULT, use SIGHASH_ALL instead.
const int hashtype = nHashType == SIGHASH_DEFAULT ? SIGHASH_ALL : nHashType; bitcoin/bitcoin@e94bb4e makes this problem go away though. Additional background:
|
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.
utACK 3e97ff9
I agree with @Sjors but is that not covered by doc at the /** Signature hash types/flags */
enum
definition (src/script/interpreter.h
)?
bitcoin/bitcoin@e94bb4e makes this problem go away though.
is that part of a PR?
@pablomartin4btc it's part of #31622. The description in |
SIGHASH_DEFAULT should be used to indicate SIGHASH_DEFAULT for taproot inputs, and SIGHASH_ALL for all other input types. This avoids adding an unnecessary byte to the end of all Taproot signatures added to PSBTs signed in the GUI.
See also bitcoin/bitcoin#22514