-
Notifications
You must be signed in to change notification settings - Fork 329
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
BIP 371 noncompliance: Taproot fields remain after adding PSBT_IN_FINAL_SCRIPTWITNESS
in finalize_psbt
#1243
Comments
I did verify the faulty behavior as you described - fields in a Psbt taproot input, such as |
… constructed We currently allow removing `partial_sigs` from a finalized `Psbt`, which is relevant to non-taproot inputs, however taproot related fields were left in place despite the recommendation of BIP371 to remove them once the `final_script_witness` is constructed. This may cause confusion for parsers that encounter extra taproot metadata in an already satisfied input. Fix this by introducing a new memeber to SignOptions `remove_taproot_extras`, which when true will remove extra taproot related data from a `Psbt` upon successful finalization. This change makes removal of all taproot extras the default. fixes bitcoindevkit#1243
…cted We currently allow removing `partial_sigs` from a finalized `Psbt`, which is relevant to non-taproot inputs, however taproot related `Psbt` fields were left in place despite the recommendation of BIP371 to remove them once the `final_script_witness` is constructed. This can cause confusion for parsers that encounter extra taproot metadata in an already satisfied input. Fix this by introducing a new memeber to SignOptions `remove_taproot_extras`, which when true will remove extra taproot related data from a `Psbt` upon successful finalization. This change makes removal of all taproot extras the default but configurable. fixes bitcoindevkit#1243
We currently allow removing `partial_sigs` from a finalized `Psbt`, which is relevant to non-taproot inputs, however taproot related `Psbt` fields were left in place despite the recommendation of BIP371 to remove them once the `final_script_witness` is constructed. This can cause confusion for parsers that encounter extra taproot metadata in an already satisfied input. Fix this by introducing a new member to SignOptions `remove_taproot_extras`, which when true will remove extra taproot related data from a `Psbt` upon successful finalization. This change makes removal of all taproot extras the default but configurable. fixes bitcoindevkit#1243
We currently allow removing `partial_sigs` from a finalized `Psbt`, which is relevant to non-taproot inputs, however taproot related `Psbt` fields were left in place despite the recommendation of BIP371 to remove them once the `final_script_witness` is constructed. This can cause confusion for parsers that encounter extra taproot metadata in an already satisfied input. Fix this by introducing a new member to SignOptions `remove_taproot_extras`, which when true will remove extra taproot related data from a `Psbt` upon successful finalization. This change makes removal of all taproot extras the default but configurable. fixes bitcoindevkit#1243
Thanks for tackling this @evanlinjin |
It was mostly @ValuedMammal! I only reviewed and merged 😅 |
Describe the bug
Finalizers should remove
PSBT_IN_TAP_*
andPSBT_OUT_TAP_BIP32_DERIVATION
afterPSBT_IN_FINAL_SCRIPTWITNESS
is constructed according to BIP 371 specTo Reproduce
Fund a psbt with a taproot input. Call
wallet.sign
on it. SeePSBT_IN_TAP_KEY_SIG
present on output.Expected behavior
Fund a psbt with a taproot input. Call
wallet.sign
on it. SeePSBT_IN_TAP_KEY_SIG
not present.Build environment
Additional context
I ran into this problem trying to take payjoin BDK-output Original PSBTs and process them at the receiver with
walletprocesspsbt
on bitcoind, and bitcoind failed to skip the inputs that it encountered having PSBT_IN_TAP_KEY_SIG belonging to the sender. Typically it'd just skip them.I believe the issue could be fixed by calling
clear()
on the aforementioned fields herebdk/crates/bdk/src/wallet/mod.rs
Lines 1883 to 1887 in b13505c
The text was updated successfully, but these errors were encountered: