Skip to content

Commit 27ffef4

Browse files
committed
dual-fund: add require_confirmed_inputs to RBF messages
Make `require_confirmed_inputs` explicit for RBF regnegotiation. Requested-By: @t-bast
1 parent 024df99 commit 27ffef4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

02-peer-protocol.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ completed.
451451
1. type: 0 (`funding_output_contribution`)
452452
2. data:
453453
* [`s64`:`satoshis`]
454+
1. type: 2 (`require_confirmed_inputs`)
454455

455456
#### Requirements
456457

@@ -459,13 +460,17 @@ The sender:
459460
of the previously constructed transaction, rounded down.
460461
- If it contributes to the transaction's funding output:
461462
- MUST set `funding_output_contribution`
463+
- If it requires the receiving node to only use confirmed inputs:
464+
- MUST set `require_confirmed_inputs`
462465

463466
The recipient:
464467
- MUST respond either with `tx_abort` or with `tx_ack_rbf`
465468
- MUST respond with `tx_abort` if:
466469
- the `feerate` is not greater than or equal to 25/24 times `feerate`
467470
of the last successfully constructed transaction
468471
- MAY send `tx_abort` for any reason
472+
- MUST fail the negotiation if:
473+
- `require_confirmed_inputs` is set but it cannot provide confirmed inputs
469474

470475
#### Rationale
471476

@@ -492,21 +497,27 @@ not contributing to the funding output.
492497
* [`channel_id`:`channel_id`]
493498
* [`tx_ack_rbf_tlvs`:`tlvs`]
494499

500+
495501
1. `tlv_stream`: `tx_ack_rbf_tlvs`
496502
2. types:
497503
1. type: 0 (`funding_output_contribution`)
498504
2. data:
499505
* [`s64`:`satoshis`]
506+
1. type: 2 (`require_confirmed_inputs`)
500507

501508
#### Requirements
502509

503510
The sender:
504511
- If it contributes to the transaction's funding output:
505512
- MUST set `funding_output_contribution`
513+
- If it requires the receiving node to only use confirmed inputs:
514+
- MUST set `require_confirmed_inputs`
506515

507516
The recipient:
508517
- MUST respond with `tx_abort` or with a `tx_add_input` message,
509518
restarting the interactive tx collaboration protocol.
519+
- MUST fail the negotiation if:
520+
- `require_confirmed_inputs` is set but it cannot provide confirmed inputs
510521

511522
#### Rationale
512523

@@ -1286,7 +1297,8 @@ protocol, with the following additional caveats.
12861297
##### Requirements
12871298

12881299
The sending node:
1289-
- if the receiver set `require_confirmed_inputs` in `open_channel2` or `accept_channel2`:
1300+
- if the receiver set `require_confirmed_inputs` in `open_channel2`,
1301+
`accept_channel2`, `tx_init_rbf` or `tx_ack_rbf`:
12901302
- MUST NOT send a `tx_add_input` that contains an unconfirmed input
12911303

12921304
#### The `tx_add_output` Message
@@ -1318,7 +1330,8 @@ Upon receipt of consecutive `tx_complete`s, the receiving node:
13181330
successfully negotiated transaction's fees
13191331
- the transaction does not share at least one input with
13201332
each previous funding transaction
1321-
- if it has sent `require_confirmed_inputs` in `open_channel2` or `accept_channel2`:
1333+
- if it has sent `require_confirmed_inputs` in `open_channel2`,
1334+
`accept_channel2`, `tx_init_rbf` or `tx_ack_rbf`:
13221335
- MUST fail the negotiation if:
13231336
- one of the inputs added by the other peer is unconfirmed
13241337

0 commit comments

Comments
 (0)