Skip to content

Commit b570f22

Browse files
committed
fixup! interactive-tx: Add dual-funding flow, using the interactive tx protocol
Suggested-By: Antoine Riard @ariard
1 parent fceb18a commit b570f22

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

02-peer-protocol.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ The receiving node:
221221
- `prevtx` is not a valid transaction
222222
- `prevtx_vout` is greater or equal to the number of outputs on `prevtx`
223223
- the `prevtx_out` input of `prevtx` is not an `OP_0` to `OP_16`
224-
followed by a single push
224+
followed by a single push of 2 to 40 bytes
225225
- the `serial_id` is already included in the transaction
226226
- the `serial_id` has the wrong parity
227227
- if has received 4096 `tx_add_input` messages during this negotiation
@@ -276,7 +276,8 @@ The receiving node:
276276
- the `serial_id` is already included in the transaction
277277
- the `serial_id` has the wrong parity
278278
- it has received 4096 `tx_add_output` messages during this negotiation
279-
- the `sats` amount is less than or equal to the `dust_limit`
279+
- the `sats` amount is less than the `dust_limit`
280+
- the `sats` amount is greater than 21,0000,0000 (`MAX_MONEY`)
280281

281282

282283
#### Rationale
@@ -346,6 +347,7 @@ The receiving node:
346347
- the *initiator*'s fees do not cover the `common` fields
347348
- there are more than 252 inputs
348349
- there are more than 252 outputs
350+
- the estimated weight of the tx is greater than 400,000 (`MAX_STANDARD_TX_WEIGHT`)
349351

350352
#### Rationale
351353
To signal the conclusion of exchange of transaction inputs and outputs.
@@ -382,12 +384,18 @@ the byte size of the input and output counts on the transaction to one (1).
382384

383385
#### Requirements
384386
The sending node:
387+
- if it has the lowest total satoshis contributed, as defined
388+
by total `tx_add_input` values:
389+
- MUST transmit their `tx_signatures` before the peer
385390
- MUST order the `witness_stack`s by the `serial_id` of the input they
386391
correspond to
387392
- number of `witness_stack`s MUST equal the number of inputs they added
388393

389394
The receiving node:
390395
- MUST fail the negotiation if:
396+
- if they have not sent a `tx_signatures` message and they are the
397+
peer with the lowest total satoshis contributed, as defined by
398+
`tx_add_input` values
391399
- the message contains an empty `witness_stack`
392400
- the number of `witness_stack`s does not equal the number of inputs
393401
added by the sending node
@@ -400,6 +408,10 @@ The receiving node:
400408

401409

402410
#### Rationale
411+
The counterparty with the lowest total of inputs amounts must transmit its
412+
`tx_signatures` first. This gives in a strict ordering of transmission
413+
for any multiparty tx collaboration.
414+
403415
`witness` is the data for a witness element in a witness stack.
404416
Witness elements should *not* include their length.
405417

@@ -844,7 +856,6 @@ The protocol is also expanded to include a mechanism for initiating RBF.
844856
----| |<-(b)--- ack_rbf ------------| |
845857
| | | |
846858
| |--(7)--- funding_locked ----->| |
847-
n-
848859
| |<-(8)--- funding_locked ------| |
849860
+-------+ +-------+
850861

@@ -1139,7 +1150,9 @@ The sender:
11391150
- MUST NOT have sent or received a `funding_locked` message
11401151

11411152
The recipient:
1142-
- MUST either fail the negotiation or transmit a `tx_add_input` message
1153+
- MUST either fail the negotiation or transmit a `tx_add_input` message,
1154+
restarting the interactive tx collaboration protocol, and proceeding
1155+
the same as with `accept_channel2`.
11431156

11441157
#### Rationale
11451158
`funding_satoshis` is the amount of satoshis that this peer will

0 commit comments

Comments
 (0)