Skip to content

Commit d72e275

Browse files
committed
[MoveOnly] Move optional parameters at the beginning
1 parent 801cc71 commit d72e275

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

bip-0078.mediawiki

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,35 @@ The payjoin proposal MAY:
119119
The payjoin proposal MUST NOT:
120120
* Shuffle the order of inputs or outputs, the additional outputs or additional inputs must be inserted at a random index.
121121
122+
===Optional parameters===
123+
124+
When the payjoin sender posts the original PSBT to the receiver, he can optionally specify the following HTTP query string parameters:
125+
126+
* <code>v=</code>, the version number of the payjoin protocol that the sender is using. The current version is <code>1</code>.
127+
128+
This can be used in the future so the receiver can reject a payjoin if the sender is using a version which is not supported via an error HTTP 400, <code>version-unsupported</code>.
129+
If not specified, the receiver will assume the sender is <code>v=1</code>.
130+
131+
If the receiver does not support the version of the sender, they should send an error with the list of supported versions:
132+
<pre>
133+
{
134+
"errorCode": "version-unsupported",
135+
"supported" : [ 2, 3, 4 ],
136+
"message": "The version is not supported anymore"
137+
}
138+
</pre>
139+
140+
* <code>additionalfeeoutputindex=</code>, if the sender is willing to pay for increased fee, this indicate output can have its value substracted to pay for it.
141+
142+
If the <code>additionalfeeoutputindex</code> is out of bounds or pointing to the payment output meant for the receiver, the receiver should ignore the parameter.
143+
144+
* <code>maxadditionalfeecontribution=</code>, if the sender is willing to pay for increased fee, an integer defining the maximum amount in satoshis that the sender is willing to contribute towards fees for the additional inputs. <code>maxadditionalfeecontribution</code> must be ignored if set to less than zero.
145+
146+
Note that both <code>maxadditionalfeecontribution=</code> and <code>additionalfeeoutputindex=</code> must be specified and valid for the receiver to be allowed to decrease an output belonging to the sender.
147+
This fee contribution can't be used to pay for anything else than additional input's weight.
148+
149+
* <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.
150+
122151
===Receiver's well known errors===
123152

124153
If for some reason the receiver is unable to create a payjoin proposal, it will reply with a HTTP code different than 200.
@@ -202,35 +231,6 @@ It also allows the receiver to pay the fee for batching adding his own outputs.
202231
On top of those check, it is recommended, but not required for the sender to check that:
203232
* If the sender is making a payjoin with a change (ie, not in the [[#spare-change|spare change]] case), make sure the receiver is paying for any batched output.
204233
205-
===Optional parameters===
206-
207-
When the payjoin sender posts the original PSBT to the receiver, he can optionally specify the following HTTP query string parameters:
208-
209-
* <code>v=</code>, the version number of the payjoin protocol that the sender is using. The current version is <code>1</code>.
210-
211-
This can be used in the future so the receiver can reject a payjoin if the sender is using a version which is not supported via an error HTTP 400, <code>version-unsupported</code>.
212-
If not specified, the receiver will assume the sender is <code>v=1</code>.
213-
214-
If the receiver does not support the version of the sender, they should send an error with the list of supported versions:
215-
<pre>
216-
{
217-
"errorCode": "version-unsupported",
218-
"supported" : [ 2, 3, 4 ],
219-
"message": "The version is not supported anymore"
220-
}
221-
</pre>
222-
223-
* <code>additionalfeeoutputindex=</code>, if the sender is willing to pay for increased fee, this indicate output can have its value substracted to pay for it.
224-
225-
If the <code>additionalfeeoutputindex</code> is out of bounds or pointing to the payment output meant for the receiver, the receiver should ignore the parameter.
226-
227-
* <code>maxadditionalfeecontribution=</code>, if the sender is willing to pay for increased fee, an integer defining the maximum amount in satoshis that the sender is willing to contribute towards fees for the additional inputs. <code>maxadditionalfeecontribution</code> must be ignored if set to less than zero.
228-
229-
Note that both <code>maxadditionalfeecontribution=</code> and <code>additionalfeeoutputindex=</code> must be specified and valid for the receiver to be allowed to decrease an output belonging to the sender.
230-
This fee contribution can't be used to pay for anything else than additional input's weight.
231-
232-
* <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.
233-
234234
==Rationale==
235235

236236
There is several consequences of our proposal:

0 commit comments

Comments
 (0)