@@ -1327,6 +1327,7 @@ for [`commitment_signed`](#commiting-updates-so-far-commitment_signed) with the
1327
1327
1328
1328
The sending node:
1329
1329
- MUST send zero HTLCs.
1330
+ - MUST remember the details of this funding transaction.
1330
1331
1331
1332
The receiving node:
1332
1333
- if the message has one or more HTLCs:
@@ -1341,6 +1342,10 @@ The receiving node:
1341
1342
1342
1343
The first commitment transaction has no HTLCs.
1343
1344
1345
+ Once peers are ready to exchange commitment signatures, they must remember
1346
+ the details of the funding transaction to allow resuming the signatures
1347
+ exchange if a disconnection happens.
1348
+
1344
1349
### Sharing funding signatures: ` tx_signatures `
1345
1350
1346
1351
After a valid ` commitment_signed ` has been received
@@ -2244,6 +2249,12 @@ messages are), they are independent of requirements here.
2244
2249
* [ ` 32*byte ` :` your_last_per_commitment_secret ` ]
2245
2250
* [ ` point ` :` my_current_per_commitment_point ` ]
2246
2251
2252
+ 1 . ` tlv_stream ` : ` channel_reestablish_tlvs `
2253
+ 2 . types:
2254
+ 1 . type: 0 (` next_funding ` )
2255
+ 2 . data:
2256
+ * [ ` sha256 ` :` next_funding_txid ` ]
2257
+
2247
2258
` next_commitment_number ` : A commitment number is a 48-bit
2248
2259
incrementing counter for each commitment transaction; counters
2249
2260
are independent for each peer in the channel and start at 0.
@@ -2300,18 +2311,21 @@ The sending node:
2300
2311
- MUST set ` your_last_per_commitment_secret ` to all zeroes
2301
2312
- otherwise:
2302
2313
- MUST set ` your_last_per_commitment_secret ` to the last ` per_commitment_secret ` it received
2314
+ - if it has sent ` commitment_signed ` for an interactive transaction construction but
2315
+ it has not received ` tx_signatures ` :
2316
+ - MUST set ` next_funding_txid ` to the txid of that interactive transaction.
2317
+ - otherwise:
2318
+ - MUST NOT set ` next_funding_txid ` .
2303
2319
2304
2320
A node:
2305
2321
- if ` next_commitment_number ` is 1 in both the ` channel_reestablish ` it
2306
2322
sent and received:
2307
2323
- MUST retransmit ` channel_ready ` .
2308
- - MUST retransmit ` tx_signatures ` if it is using channel establishment v2.
2309
2324
- otherwise:
2310
2325
- MUST NOT retransmit ` channel_ready ` , but MAY send ` channel_ready ` with
2311
2326
a different ` short_channel_id ` ` alias ` field.
2312
2327
- upon reconnection:
2313
2328
- MUST ignore any redundant ` channel_ready ` it receives.
2314
- - MUST ignore any redundant ` tx_signatures ` it receives.
2315
2329
- if ` next_commitment_number ` is equal to the commitment number of
2316
2330
the last ` commitment_signed ` message the receiving node has sent:
2317
2331
- MUST reuse the same commitment number for its next ` commitment_signed ` .
@@ -2361,6 +2375,20 @@ A node:
2361
2375
do not match the expected values):
2362
2376
- SHOULD send an ` error ` and fail the channel.
2363
2377
2378
+ A receiving node:
2379
+ - if ` next_funding_txid ` is set:
2380
+ - if ` next_funding_txid ` matches the latest interactive funding transaction:
2381
+ - if it has not received ` tx_signatures ` for that funding transaction:
2382
+ - MUST retransmit its ` commitment_signed ` for that funding transaction.
2383
+ - if it has already received ` commitment_signed ` and it should sign first,
2384
+ as specified in the [ ` tx_signatures ` requirements] ( #the-tx_signatures-message ) :
2385
+ - MUST send its ` tx_signatures ` for that funding transaction.
2386
+ - if it has already received ` tx_signatures ` for that funding transaction:
2387
+ - MUST send its ` tx_signatures ` for that funding transaction.
2388
+ - otherwise:
2389
+ - MUST send ` tx_abort ` to let the sending node know that they can forget
2390
+ this funding transaction.
2391
+
2364
2392
A node:
2365
2393
- MUST NOT assume that previously-transmitted messages were lost,
2366
2394
- if it has sent a previous ` commitment_signed ` message:
@@ -2452,6 +2480,11 @@ fall-behind detection. An implementation can offer both, however, and
2452
2480
fall back to the ` option_data_loss_protect ` behavior if
2453
2481
` option_static_remotekey ` is not negotiated.
2454
2482
2483
+ ` next_funding_txid ` allows peers to finalize the signing steps of an
2484
+ interactive transaction construction, or safely abort that transaction
2485
+ if it was not signed by one of the peers, who has thus already removed
2486
+ it from its state.
2487
+
2455
2488
# Authors
2456
2489
2457
2490
[ FIXME: Insert Author List ]
0 commit comments