You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -70,8 +70,8 @@ must broadcast the funding transaction to the Bitcoin network. After
70
70
the `funding_signed` message is sent/received, both sides should wait
71
71
for the funding transaction to enter the blockchain and reach the
72
72
specified depth (number of confirmations). After both sides have sent
73
-
the `funding_locked` message, the channel is established and can begin
74
-
normal operation. The `funding_locked` message includes information
73
+
the `channel_ready` message, the channel is established and can begin
74
+
normal operation. The `channel_ready` message includes information
75
75
that will be used to construct channel authentication proofs.
76
76
77
77
@@ -82,8 +82,8 @@ that will be used to construct channel authentication proofs.
82
82
| A |--(3)-- funding_created --->| B |
83
83
| |<-(4)-- funding_signed -----| |
84
84
| | | |
85
-
| |--(5)--- funding_locked ---->| |
86
-
| |<-(6)--- funding_locked -----| |
85
+
| |--(5)--- channel_ready ---->| |
86
+
| |<-(6)--- channel_ready -----| |
87
87
+-------+ +-------+
88
88
89
89
- where node A is 'funder' and node B is 'fundee'
@@ -207,12 +207,16 @@ definitions they reuse even feature bits, but they are not an
207
207
arbitrary combination (they represent the persistent features which
208
208
affect the channel operation).
209
209
210
-
The currently defined types are:
210
+
The currently defined basic types are:
211
211
- no features (no bits set)
212
212
-`option_static_remotekey` (bit 12)
213
213
-`option_anchor_outputs` and `option_static_remotekey` (bits 20 and 12)
214
214
-`option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12)
215
215
216
+
Each basic type has the following variations allowed:
217
+
-`option_scid_alias` (bit 46)
218
+
-`option_zeroconf` (bit 50)
219
+
216
220
#### Requirements
217
221
218
222
The sending node:
@@ -239,6 +243,8 @@ The sending node:
239
243
- MUST set it to a defined type representing the type it wants.
240
244
- MUST use the smallest bitmap possible to represent the channel type.
241
245
- SHOULD NOT set it to a type containing a feature which was not negotiated.
246
+
- if `announce_channel` is `true` (not `0`):
247
+
- MUST NOT send `channel_type` with the `option_scid_alias` bit set.
242
248
243
249
The sending node SHOULD:
244
250
- set `to_self_delay` sufficient to ensure the sender can irreversibly spend a commitment transaction output, in case of misbehavior by the receiver.
@@ -276,7 +282,9 @@ are not valid secp256k1 pubkeys in compressed format.
276
282
- the funder's amount for the initial commitment transaction is not sufficient for full [fee payment](03-transactions.md#fee-payment).
277
283
- both `to_local` and `to_remote` amounts for the initial commitment transaction are less than or equal to `channel_reserve_satoshis` (see [BOLT 3](03-transactions.md#commitment-transaction-outputs)).
278
284
-`funding_satoshis` is greater than or equal to 2^24 and the receiver does not support `option_support_large_channel`.
279
-
- It supports `channel_type`, `channel_type` was set, and the `type` is not suitable.
285
+
- It supports `channel_type` and `channel_type` was set:
286
+
- if `type` is not suitable.
287
+
- if `type` includes `option_zeroconf` and it does not trust the sender to open an unconfirmed channel.
280
288
281
289
The receiving node MUST NOT:
282
290
- consider funds received, using `push_msat`, to be received until the funding transaction has reached sufficient depth.
@@ -344,8 +352,10 @@ The `temporary_channel_id` MUST be the same as the `temporary_channel_id` in
344
352
the `open_channel` message.
345
353
346
354
The sender:
347
-
- SHOULD set `minimum_depth` to a number of blocks it considers reasonable to
348
-
avoid double-spending of the funding transaction.
355
+
- if `channel_type` includes `option_zeroconf`:
356
+
- MUST set `minimum_depth` to zero.
357
+
- otherwise:
358
+
- SHOULD set `minimum_depth` to a number of blocks it considers reasonable to avoid double-spending of the funding transaction.
349
359
- MUST set `channel_reserve_satoshis` greater than or equal to `dust_limit_satoshis` from the `open_channel` message.
350
360
- MUST set `dust_limit_satoshis` less than or equal to `channel_reserve_satoshis` from the `open_channel` message.
351
361
- if `option_channel_type` was negotiated:
@@ -463,31 +473,67 @@ use `option_static_remotekey`, `option_anchor_outputs` or
463
473
`option_static_remotekey`, and the superior one is favored if more than one
464
474
is negotiated.
465
475
466
-
### The `funding_locked` Message
476
+
### The `channel_ready` Message
477
+
478
+
This message (which used to be called `funding_locked`) indicates that the funding transaction has sufficient confirms for channel use. Once both nodes have sent this, the channel enters normal operating mode.
467
479
468
-
This message indicates that the funding transaction has reached the `minimum_depth` asked for in `accept_channel`. Once both nodes have sent this, the channel enters normal operating mode.
480
+
Note that the opener is free to send this message at any time (since it presumably trusts itself), but the
481
+
accepter would usually wait until the funding has reached the `minimum_depth` asked for in `accept_channel`.
469
482
470
-
1. type: 36 (`funding_locked`)
483
+
1. type: 36 (`channel_ready`)
471
484
2. data:
472
485
*[`channel_id`:`channel_id`]
473
-
*[`point`:`next_per_commitment_point`]
486
+
*[`point`:`second_per_commitment_point`]
487
+
*[`channel_ready_tlvs`:`tlvs`]
488
+
489
+
1.`tlv_stream`: `channel_ready_tlvs`
490
+
2. types:
491
+
1. type: 1 (`short_channel_id`)
492
+
2. data:
493
+
*[`short_channel_id`:`alias`]
474
494
475
495
#### Requirements
476
496
477
-
The sender MUST:
478
-
- NOT send `funding_locked` unless outpoint of given by `funding_txid` and
497
+
The sender:
498
+
-MUST NOT send `channel_ready` unless outpoint of given by `funding_txid` and
479
499
`funding_output_index` in the `funding_created` message pays exactly `funding_satoshis` to the scriptpubkey specified in [BOLT #3](03-transactions.md#funding-transaction-output).
480
-
- wait until the funding transaction has reached `minimum_depth` before
481
-
sending this message.
482
-
- set `next_per_commitment_point` to the per-commitment point to be used
483
-
for the following commitment transaction, derived as specified in
500
+
- if it is not the node opening the channel:
501
+
- SHOULD wait until the funding transaction has reached `minimum_depth` before
502
+
sending this message.
503
+
- MUST set `second_per_commitment_point` to the per-commitment point to be used
504
+
for commitment transaction #1, derived as specified in
- if the `announce_channel` bit was set in `open_channel`:
512
+
- SHOULD initially set `alias` to value not related to the real `short_channel_id`.
513
+
- otherwise:
514
+
- MUST set `alias` to a value not related to the real `short_channel_id`.
515
+
- MUST NOT send the same `alias` for multiple peers or use an alias which
516
+
collides with a `short_channel_id` of a channel on the same node.
517
+
- MUST always recognize the `alias` as a `short_channel_id` for incoming HTLCs to this channel.
518
+
- if `channel_type` has `option_scid_alias` set:
519
+
- MUST NOT allow incoming HTLCs to this channel using the real `short_channel_id`
520
+
- MAY send multiple `channel_ready` messages to the same peer with different `alias` values.
521
+
- otherwise:
522
+
- MUST wait until the funding transaction has reached `minimum_depth` before sending this message.
523
+
524
+
525
+
The sender:
485
526
486
527
A non-funding node (fundee):
487
528
- SHOULD forget the channel if it does not see the correct funding
488
-
transaction after a timeout of 2016 blocks.
529
+
transaction after a timeout of 2016 blocks.
489
530
490
-
From the point of waiting for `funding_locked` onward, either node MAY
531
+
The receiver:
532
+
- MAY use any of the `alias` it received, in BOLT 11 `r` fields.
533
+
- if `channel_type` has `option_scid_alias` set:
534
+
- MUST NOT use the real `short_channel_id` in BOLT 11 `r` fields.
535
+
536
+
From the point of waiting for `channel_ready` onward, either node MAY
491
537
send an `error` and fail the channel if it does not receive a required response from the
492
538
other node after a reasonable timeout.
493
539
@@ -503,6 +549,16 @@ to broadcast the commitment transaction to get his funds back and open a new
503
549
channel. To avoid this, the funder should ensure the funding transaction
504
550
confirms in the next 2016 blocks.
505
551
552
+
The `alias` here is both required for routing (since there real
553
+
short_channel_id is unknown until confirmation), and useful to provide
554
+
one or more aliases, even once there is a real `short_channel_id` for
555
+
a public channel.
556
+
557
+
While a node can send multiple `alias`, it must remember all of the
558
+
ones it has sent so it can use them should they be requested by
559
+
incoming HTLCs. The recipient only need remember one, for use in
560
+
`r` route hints in BOLT 11 invoices.
561
+
506
562
## Channel Close
507
563
508
564
Nodes can negotiate a mutual close of the connection, which unlike a
@@ -543,7 +599,7 @@ along with the `scriptpubkey` it wants to be paid to.
543
599
A sending node:
544
600
- if it hasn't sent a `funding_created` (if it is a funder) or a `funding_signed` (if it is a fundee):
545
601
- MUST NOT send a `shutdown`
546
-
- MAY send a `shutdown` before a `funding_locked`, i.e. before the funding transaction has reached `minimum_depth`.
602
+
- MAY send a `shutdown` before a `channel_ready`, i.e. before the funding transaction has reached `minimum_depth`.
547
603
- if there are updates pending on the receiving node's commitment transaction:
548
604
- MUST NOT send a `shutdown`.
549
605
- MUST NOT send multiple `shutdown` messages.
@@ -566,7 +622,7 @@ A receiving node:
566
622
- SHOULD send an `error` and fail the channel.
567
623
- if the `scriptpubkey` is not in one of the above forms:
568
624
- SHOULD send a `warning`.
569
-
- if it hasn't sent a `funding_locked` yet:
625
+
- if it hasn't sent a `channel_ready` yet:
570
626
- MAY reply to a `shutdown` message with a `shutdown`
571
627
- once there are no outstanding updates on the peer, UNLESS it has already sent a `shutdown`:
572
628
- MUST reply to a `shutdown` message with a `shutdown`
@@ -716,7 +772,7 @@ the closing transaction will likely never reach miners.
716
772
717
773
## Normal Operation
718
774
719
-
Once both nodes have exchanged `funding_locked` (and optionally [`announcement_signatures`](07-routing-gossip.md#the-announcement_signatures-message)), the channel can be used to make payments via Hashed Time Locked Contracts.
775
+
Once both nodes have exchanged `channel_ready` (and optionally [`announcement_signatures`](07-routing-gossip.md#the-announcement_signatures-message)), the channel can be used to make payments via Hashed Time Locked Contracts.
720
776
721
777
Changes are sent in batches: one or more `update_` messages are sent before a
722
778
`commitment_signed` message, as in the following diagram:
@@ -1370,11 +1426,12 @@ The sending node:
1370
1426
A node:
1371
1427
- if `next_commitment_number` is 1 in both the `channel_reestablish` it
1372
1428
sent and received:
1373
-
- MUST retransmit `funding_locked`.
1429
+
- MUST retransmit `channel_ready`.
1374
1430
- otherwise:
1375
-
- MUST NOT retransmit `funding_locked`.
1431
+
- MUST NOT retransmit `channel_ready`, but MAY send `channel_ready` with
1432
+
a different `short_channel_id``alias` field.
1376
1433
- upon reconnection:
1377
-
- MUST ignore any redundant `funding_locked` it receives.
1434
+
- MUST ignore any redundant `channel_ready` it receives.
1378
1435
- if `next_commitment_number` is equal to the commitment number of
1379
1436
the last `commitment_signed` message the receiving node has sent:
1380
1437
- MUST reuse the same commitment number for its next `commitment_signed`.
@@ -1442,7 +1499,7 @@ atomic: if it doesn't complete, it starts again. The only exception
1442
1499
is if the `funding_signed` message is sent but not received. In
1443
1500
this case, the funder will forget the channel, and presumably open
1444
1501
a new one upon reconnection; meanwhile, the other node will eventually forget
1445
-
the original channel, due to never receiving `funding_locked` or seeing
1502
+
the original channel, due to never receiving `channel_ready` or seeing
1446
1503
the funding transaction on-chain.
1447
1504
1448
1505
There's no acknowledgment for `error`, so if a reconnect occurs it's
@@ -1478,7 +1535,7 @@ commitment number 0 is created during opening.
1478
1535
`commitment_signed` for commitment number 1 is send and then
1479
1536
the revocation for commitment number 0 is received.
1480
1537
1481
-
`funding_locked` is implicitly acknowledged by the start of normal
1538
+
`channel_ready` is implicitly acknowledged by the start of normal
1482
1539
operation, which is known to have begun after a `commitment_signed` has been
1483
1540
received — hence, the test for a `next_commitment_number` greater
Copy file name to clipboardExpand all lines: 09-features.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,9 @@ The Context column decodes as follows:
42
42
| 22/23 |`option_anchors_zero_fee_htlc_tx`| Anchor commitment type with zero fee HTLC transactions | IN |`option_static_remotekey`|[BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful]|
43
43
| 26/27 |`option_shutdown_anysegwit`| Future segwit versions allowed in `shutdown`| IN ||[BOLT #2][bolt02-shutdown]|
44
44
| 44/45 |`option_channel_type`| Node supports the `channel_type` field in open/accept | IN ||[BOLT #2](02-peer-protocol.md#the-open_channel-message)|
45
+
| 46/47 |`option_scid_alias`| Supply channel aliases for routing | IN ||[BOLT #2][bolt02-channel-ready]|
45
46
| 48/49 | `option_payment_metadata` | Payment metadata in tlv record | 9 | | [BOLT #11](11-payment-encoding.md#tagged-fields)
0 commit comments