achow101
commented at 9:16 pm on January 6, 2025:
member
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
gui, psbt: Use SIGHASH_DEFAULT when signing PSBTs
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.
3e97ff9c5e
DrahtBot
commented at 9:16 pm on January 6, 2025:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See 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.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#832 (Improve user dialog when signing multisig psbts by mjdietzx)
#bitcoin/bitcoin/31622 (psbt: add non-default sighash types to PSBTs and unify sighash type match checking by achow101)
#bitcoin/bitcoin/29675 (wallet: Be able to receive and spend inputs involving MuSig2 aggregate keys by achow101)
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.
laanwj added the label
Wallet
on Jan 7, 2025
luke-jr
commented at 1:53 pm on January 8, 2025:
member
This avoids adding an unnecessary byte to the end of all Taproot signatures added to PSBTs signed in the GUI.
Two bytes, isn’t it? For the PSBT_IN_SIGHASH keytype
achow101
commented at 4:39 pm on January 8, 2025:
member
This avoids adding an unnecessary byte to the end of all Taproot signatures added to PSBTs signed in the GUI.
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 PSBT_IN_TAPROOT_*_SIG fields beforehand.
Sjors
commented at 11:05 am on January 16, 2025:
member
utACK3e97ff9c5eaa3160426ba112930b047404c54c9e
It would be useful for the FillPSBT doc in wallet.h to explain that passing SIGHASH_DEFAULT will use SIGHASH_ALL for pre-taproot inputs.
You have to crawl all the way to MutableTransactionSignatureCreator::CreateSig to find this out:
0// BASE/WITNESS_V0 signatures don't support explicit SIGHASH_DEFAULT, use SIGHASH_ALL instead.
1constint hashtype = nHashType == SIGHASH_DEFAULT ?SIGHASH_ALL : nHashType;
A Taproot signature is a 64-byte Schnorr signature, as defined in BIP340, with the sighash byte appended in the usual Bitcoin fashion. This sighash byte is optional. If omitted, the resulting signatures are 64 bytes, and a SIGHASH_DEFAULT mode is implied.
pablomartin4btc
commented at 7:37 pm on January 16, 2025:
contributor
utACK3e97ff9c5eaa3160426ba112930b047404c54c9e
I agree with @Sjors but is that not covered by doc at the /** Signature hash types/flags */enum definition (src/script/interpreter.h)?
The description in interpreter.h is ambiguous. It says “Taproot only”. It also says “equivalent to SIGHASH_ALL”, but doesn’t say that it gets converted (and obviously a constant can’t guarantee that actually happens).
Theschorpioen approved
DrahtBot added the label
CI failed
on Jan 26, 2025
DrahtBot removed the label
CI failed
on Jan 31, 2025
hebasto renamed this:
gui, psbt: Use SIGHASH_DEFAULT when signing PSBTs
psbt: Use SIGHASH_DEFAULT when signing PSBTs
on Feb 2, 2025
hebasto approved
hebasto
commented at 9:48 am on February 2, 2025:
member
ACK3e97ff9c5eaa3160426ba112930b047404c54c9e, I have reviewed the code and it looks OK.
This is a metadata mirror of the GitHub repository
bitcoin-core/gui.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-12-18 09:20 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me