Skip to content

Commit a2a085c

Browse files
committed
Add disableoutputsubstitution= optional parameter
1 parent 63aa576 commit a2a085c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bip-0078.mediawiki

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ This fee contribution can't be used to pay for anything else than additional inp
147147

148148
* <code>minfeerate=</code>, a decimal in satoshi per vbyte that the sender can use to constraint the receiver to not drop the minimum fee rate too much.
149149
150+
* <code>disableoutputsubstitution=</code>, a boolean indicating if the sender forbids the receiver to modify his own output, see [[#output-substitution|payment output substitution]]. (default to <code>false</code>)
151+
150152
===Receiver's well known errors===
151153

152154
If for some reason the receiver is unable to create a payjoin proposal, it will reply with a HTTP code different than 200.
@@ -271,7 +273,7 @@ The sender should check the payjoin proposal before signing it to prevent a mali
271273
The sender must be careful to only sign the inputs that were present in the original PSBT and nothing else.
272274

273275
Note:
274-
* The sender must allow the receiver to add/remove or modify his own outputs
276+
* The sender must allow the receiver to add/remove or modify his own outputs (Except is explicitely disabled via the optional parameter <code>disableoutputsubstitution=</code>)
275277
* The sender should allow the receiver to not add any input. Useful for the receiver to change the paymout output scriptPubKey type.
276278
* If no input have been added, the sender's wallet implementation should accept the payjoin proposal, but not mark the transaction as an actual payjoin in the user interface.
277279
@@ -421,7 +423,8 @@ public async Task<PSBT> RequestPayjoin(
421423
var ourOutputs = new Queue<(TxOut OriginalTxOut, PSBTOutput SignedPSBTOutput)>();
422424
for (int i = 0; i < originalGlobalTx.Outputs.Count; i++)
423425
{
424-
if (signedPSBT.Outputs[i].ScriptPubKey != bip21.Address.ScriptPubKey)
426+
if (optionalParameters.DisableOutputSubstitution ||
427+
signedPSBT.Outputs[i].ScriptPubKey != bip21.Address.ScriptPubKey)
425428
ourOutputs.Enqueue((originalGlobalTx.Outputs[i], signedPSBT.Outputs[i]));
426429
}
427430
endpoint = ApplyOptionalParameters(endpoint, optionalParameters);

0 commit comments

Comments
 (0)