Skip to content

Commit

Permalink
Support taproot PSBTs
Browse files Browse the repository at this point in the history
    Sometimes taproot signers leave around taproot signing artifacts.
    Part of the spec is to remove unnecessary psbt data for counterparties,
    so this ensures removal of taproot variety unnecessary data too.
  • Loading branch information
DanGould committed Dec 18, 2023
1 parent d23ed51 commit 55a7913
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions payjoin/src/receive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ impl ProvisionalProposal {
self.payjoin_psbt.inputs[i].witness_utxo = None;
self.payjoin_psbt.inputs[i].final_script_sig = None;
self.payjoin_psbt.inputs[i].final_script_witness = None;
self.payjoin_psbt.inputs[i].tap_key_sig = None;
}
Ok(PayjoinProposal {
payjoin_psbt: self.payjoin_psbt,
Expand Down
7 changes: 7 additions & 0 deletions payjoin/src/send/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,18 @@ fn clear_unneeded_fields(psbt: &mut Psbt) {
psbt.unknown_mut().clear();
for input in psbt.inputs_mut() {
input.bip32_derivation.clear();
input.tap_internal_key.clear();
input.tap_key_origins.clear();
input.tap_key_sig.clear();
input.tap_merkle_root.clear();
input.tap_script_sigs.clear();
input.proprietary.clear();
input.unknown.clear();
}
for output in psbt.outputs_mut() {
output.bip32_derivation.clear();
output.tap_internal_key.clear();
output.tap_key_origins.clear();
output.proprietary.clear();
output.unknown.clear();
}
Expand Down

0 comments on commit 55a7913

Please sign in to comment.