From e4267374fb4642051976ea046ce0aebfb22d36f8 Mon Sep 17 00:00:00 2001 From: Dan Gould Date: Tue, 20 Dec 2022 13:00:13 -0500 Subject: [PATCH] Keep input utxo data through input finalization The reference sender implementation and \`payjoin proposal\` test vectors are adjusted accordingly. According to the psbt Input Finalizer spec "All other data except the UTXO and unknown fields in the input key-value map should be cleared from the PSBT. The UTXO should be kept to allow Transaction Extractors to verify the final network serialized transaction." I ran into a problem where an LND acting as sender FinalizePsbt gRPC fails when sender utxo information is missing. I see no good reason to remove utxo information from the PSBT. --- bip-0078.mediawiki | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bip-0078.mediawiki b/bip-0078.mediawiki index 1893f0e7a2..78835bec90 100644 --- a/bip-0078.mediawiki +++ b/bip-0078.mediawiki @@ -263,7 +263,6 @@ The sender should check the payjoin proposal before signing it to prevent a mali ** If it is one of the sender's input *** Verify that input's sequence is unchanged. *** Verify the PSBT input is not finalized -*** Verify that non_witness_utxo and witness_utxo are not specified. ** If it is one of the receiver's input *** Verify the PSBT input is finalized *** Verify that non_witness_utxo or witness_utxo are filled in. @@ -497,9 +496,6 @@ public async Task RequestPayjoin( // Verify the PSBT input is not finalized if (proposedPSBTInput.IsFinalized()) throw new PayjoinSenderException("The receiver finalized one of our inputs"); - // Verify that non_witness_utxo and witness_utxo are not specified. - if (proposedPSBTInput.NonWitnessUtxo != null || proposedPSBTInput.WitnessUtxo != null) - throw new PayjoinSenderException("The receiver added non_witness_utxo or witness_utxo to one of our inputs"); sequences.Add(proposedTxIn.Sequence); // Fill up the info from the original PSBT input so we can sign and get fees. @@ -659,7 +655,7 @@ A successful exchange with:
cHNidP8BAHMCAAAAAY8nutGgJdyYGXWiBEb45Hoe9lWGbkxh/6bNiOJdCDuDAAAAAAD+////AtyVuAUAAAAAF6kUHehJ8GnSdBUOOv6ujXLrWmsJRDCHgIQeAAAAAAAXqRR3QJbbz0hnQ8IvQ0fptGn+votneofTAAAAAAEBIKgb1wUAAAAAF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