1
0
mirror of https://github.com/bitcoin/bips.git synced 2024-11-19 09:50:06 +01:00

Allow outputs to be increased

This commit is contained in:
nicolas.dorier 2020-06-19 15:19:22 +09:00
parent bd97400743
commit 549107933c
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -271,10 +271,10 @@ The sender should check the payjoin proposal before signing it to prevent a mali
*** The amount that was substracted from the output's value is less or equal to <code>maxadditionalfeecontribution</code>. Let's call this amount <code>actual contribution</code>. *** The amount that was substracted from the output's value is less or equal to <code>maxadditionalfeecontribution</code>. Let's call this amount <code>actual contribution</code>.
*** Make sure the actual contribution is only paying fee: The <code>actual contribution</code> is less or equals to the difference of absolute fee between the payjoin proposal and the original PSBT. *** Make sure the actual contribution is only paying fee: The <code>actual contribution</code> is less or equals to the difference of absolute fee between the payjoin proposal and the original PSBT.
*** Make sure the actual contribution is only paying for fee incurred by additional inputs: <code>actual contribution</code> is less or equals to <code>originalPSBTFeeRate * vsize(sender_input_type) * (count(original_psbt_inputs) - count(payjoin_proposal_inputs))</code>. (see [[#fee-output|Fee output]] section) *** Make sure the actual contribution is only paying for fee incurred by additional inputs: <code>actual contribution</code> is less or equals to <code>originalPSBTFeeRate * vsize(sender_input_type) * (count(original_psbt_inputs) - count(payjoin_proposal_inputs))</code>. (see [[#fee-output|Fee output]] section)
** If the output is the payment output and payment output substitution is disabled. ** If the output is the payment output and payment output substitution is allowed.
*** Do not make any check *** Do not make any check
** Else ** Else
*** Make sure the output's value did not changed. *** Make sure the output's value did not decreased.
** Verify that all sender's outputs (ie, all outputs except the output actually paid to the receiver) from the original PSBT are in the proposal. ** Verify that all sender's outputs (ie, all outputs except the output actually paid to the receiver) from the original PSBT are in the proposal.
* Once the proposal is signed, if <code>minfeerate</code> was specified, check that the fee rate of the payjoin transaction is not less than this value. * Once the proposal is signed, if <code>minfeerate</code> was specified, check that the fee rate of the payjoin transaction is not less than this value.
@ -561,8 +561,8 @@ public async Task<PSBT> RequestPayjoin(
} }
else else
{ {
if (originalOutput.OriginalTxOut.Value != proposedPSBTOutput.Value) if (originalOutput.OriginalTxOut.Value > proposedPSBTOutput.Value)
throw new PayjoinSenderException("The receiver changed one of our outputs"); throw new PayjoinSenderException("The receiver decreased the value of one of the outputs");
} }
// We fill up information we had on the signed PSBT, so we can sign it. // We fill up information we had on the signed PSBT, so we can sign it.
foreach (var hdKey in output.SignedPSBTOutput.HDKeyPaths) foreach (var hdKey in output.SignedPSBTOutput.HDKeyPaths)