@@ -36,12 +36,15 @@ The initial version of the Lightning Network gossip protocol as defined in
36
36
channels, the ` channel_announcement ` message is used to advertise the channel to
37
37
the rest of the network. Nodes in the network use the content of this message to
38
38
prove that the channel is sufficiently bound to the Lightning Network context
39
- and that it is owned by the nodes advertising the channel. This proof and
40
- verification protocol is, however, not compatible with SegWit V1 (P2TR) outputs
41
- and so cannot be used to advertise the channels defined in the
42
- [ Simple Taproot Channel] [ simple-taproot-chans ] proposal. This document thus aims
43
- to define an updated gossip protocol that will allow nodes to both advertise and
44
- verify taproot channels. This part of the update affects the
39
+ by being provided enough information to prove that the script is a 2-of-2
40
+ multi-sig and that it is owned by the nodes advertising the channel. This
41
+ ownership proof is done by including signatures in the ` channel_announcement `
42
+ from both the node ID keys along with the bitcoin keys used in the P2WSH script.
43
+ This proof and verification protocol is, however, not compatible with SegWit V1
44
+ (P2TR) outputs and so cannot be used to advertise the channels defined in the
45
+ [ Simple Taproot Channel] [ simple-taproot-chans ] proposal. This document thus aims
46
+ to define an updated gossip protocol that will allow nodes to both advertise and
47
+ verify taproot channels. This part of the update affects the
45
48
` announcement_signatures ` and ` channel_announcement ` messages.
46
49
47
50
The opportunity is also taken to rework the ` node_announcement ` and
@@ -138,13 +141,13 @@ separate signatures in the `channel_announcement`. However, [BIP-340][bip-340]
138
141
signatures and the MuSig2 protocol allow us to now aggregate these four
139
142
signatures into a single one. Verifiers will then be able to aggregate the four
140
143
keys (` bitcoin_key_1 ` , ` bitcoin_key_2 ` , ` node_ID_1 ` and ` node_ID_2 ` ) using
141
- MuSig2 key aggregation and then they can do a single signature verification
144
+ MuSig2 key aggregation, and then they can do a single signature verification
142
145
check instead of four individual checks.
143
146
144
- ## Timestamp fields
147
+ ## Block-height fields
145
148
146
- In this document, the ` timestamp ` fields in messages are block heights instead
147
- of the UNIX timestamps used in the legacy gossip messages.
149
+ In the messages defined in this document, block heights are used as timestamps
150
+ instead of the UNIX timestamps used in the legacy set of gossip messages.
148
151
149
152
### Rate Limiting
150
153
@@ -165,7 +168,7 @@ provides an incentive for nodes not to spam the network with too many updates.
165
168
To also prevent nodes from building up too large of a burst-buffer with which
166
169
they can spam the network and to give a limit to how low the block height on a
167
170
` node_announcement_2 ` can be: nodes should not be allowed to use a block height
168
- smaller 1440 (~ a day worth of blocks) below the current block height.
171
+ smaller 2016 (~ one week worth of blocks) below the current block height.
169
172
170
173
### Simplifies Channel Announcement Queries
171
174
@@ -217,7 +220,7 @@ un-upgraded nodes will drop this message due to the fact that no legacy
217
220
nodes will also not be able to use a legacy ` node_announcement ` to propagate
218
221
their new ` node_announcement_2 ` message.
219
222
220
- ### Consideration & Suggestions
223
+ ### Considerations & Suggestions
221
224
222
225
While the network is in the upgrade phase, the following suggestions apply:
223
226
@@ -269,7 +272,8 @@ gossip messages.
269
272
270
273
A node can be assumed to understand the new gossip v2 messages if:
271
274
272
- - They advertise ` option_taproot_gossip ` in a legacy ` node_announcement ` message
275
+ - They advertise ` option_taproot_gossip ` in the ` init ` or
276
+ legacy ` node_announcement ` messages
273
277
OR
274
278
- They have broadcast one of the new gossip messages defined in this document.
275
279
@@ -306,7 +310,7 @@ These extensions only apply if the `option_taproot` channel type was set in the
306
310
1 . type: 0 (` announcement_node_pubnonce ` )
307
311
2 . data:
308
312
* [ ` 66*byte ` : ` public_nonce ` ]
309
- 3 . type: 1 (` announcement_bitcoin_pubnonce ` )
313
+ 3 . type: 2 (` announcement_bitcoin_pubnonce ` )
310
314
4 . data:
311
315
* [ ` 66*byte ` : ` public_nonce ` ]
312
316
@@ -356,10 +360,10 @@ allow the announcement of the channel to the rest of the network.
356
360
1 . type: 0 (` channel_id ` )
357
361
2 . data:
358
362
* [ ` channel_id ` :` channel_id ` ]
359
- 3 . type: 1 (` short_channel_id ` )
363
+ 3 . type: 2 (` short_channel_id ` )
360
364
4 . data:
361
365
* [ ` short_channel_id ` :` short_channel_id ` ]
362
- 5 . type: 2 (` partial_signature ` )
366
+ 5 . type: 4 (` partial_signature ` )
363
367
6 . data:
364
368
* [ ` partial_signature ` :` partial_signature ` ]
365
369
@@ -372,14 +376,12 @@ The requirements are similar to the ones defined for the legacy
372
376
A node:
373
377
- if the ` open_channel ` message has the ` announce_channel ` bit set AND a
374
378
` shutdown ` message has not been sent:
375
- - MUST send the ` announcement_signatures_2 ` message.
376
- - MUST NOT send ` announcement_signatures_2 ` messages until ` channel_ready `
379
+ - MUST send the ` announcement_signatures_2 ` message once ` channel_ready `
377
380
has been sent and received AND the funding transaction has at least six
378
381
confirmations.
379
- - MUST set the ` partial_signature ` field to the 32-byte ` s ` value of the
380
- partial signature calculated as described
381
- in [ Partial Signature Calculation] ( #partial-signature-calculation ) . The
382
- message to be signed is
382
+ - MUST set the ` partial_signature ` field to the 32-byte ` partial_sig ` value of
383
+ the partial signature calculated as described in [ Partial Signature
384
+ Calculation] ( #partial-signature-calculation ) . The message to be signed is
383
385
` MsgHash("channel_announcement", "announcement_sig", m) ` where ` m ` is the
384
386
serialisation of the ` channel_announcement_2 ` message excluding the
385
387
` announcement_sig ` field (see the
@@ -433,38 +435,39 @@ channel.
433
435
1 . type: 0 (` announcement_sig ` )
434
436
2 . data:
435
437
* [ ` bip340_sig ` :` bip340_sig ` ]
436
- 3 . type: 1 (` features ` )
438
+ 3 . type: 1 (` chain_hash ` )
437
439
4 . data:
438
- * [ ` ...*byte ` : ` features ` ]
439
- 5 . type: 2 (` chain_hash ` )
440
+ * [ ` chain_hash ` : ` chain_hash ` ]
441
+ 5 . type: 2 (` features ` )
440
442
6 . data:
441
- * [ ` chain_hash ` : ` chain_hash ` ]
442
- 7 . type: 3 (` short_channel_id ` )
443
+ * [ ` ...*byte ` : ` features ` ]
444
+ 7 . type: 4 (` short_channel_id ` )
443
445
8 . data:
444
446
* [ ` short_channel_id ` :` short_channel_id ` ]
445
- 9 . type: 4 (` node_id_1 ` )
447
+ 9 . type: 6 (` node_id_1 ` )
446
448
10 . data:
447
449
* [ ` point ` :` point ` ]
448
- 11 . type: 5 (` node_id_2 ` )
450
+ 11 . type: 8 (` node_id_2 ` )
449
451
12 . data:
450
452
* [ ` point ` :` point ` ]
451
- 13 . type: 6 (` bitcoin_key_1 ` )
453
+ 13 . type: 3 (` bitcoin_key_1 ` )
452
454
14 . data:
453
455
* [ ` point ` :` point ` ]
454
- 15 . type: 7 (` bitcoin_key_2 ` )
456
+ 15 . type: 5 (` bitcoin_key_2 ` )
455
457
16 . data:
456
458
* [ ` point ` :` point ` ]
459
+ 17 . type: 7 (` tap_tweak ` )
460
+ 18 . data:
461
+ * [ ` point ` :` point ` ]
457
462
458
463
### Requirements
459
464
460
465
The origin node:
461
466
462
- - MUST include types 0-7.
463
- - MUST set ` chain_hash ` to the 32-byte hash that uniquely identifies the chain
464
- that the channel was opened within:
465
- - for the _ Bitcoin blockchain_ :
466
- - MUST set ` chain_hash ` value (encoded in hex) equal
467
- to ` 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 ` .
467
+ - If the chain being referred to is not the Bitcoin blockchain:
468
+ - MUST set ` chain_hash ` to the 32-byte hash that uniquely identifies the chain
469
+ that the channel was opened within:
470
+ - otherwise, MUST not set ` chain_has ` as the _ Bitcoin blockchain_ is assumed.
468
471
- MUST set ` short_channel_id ` to refer to the confirmed funding transaction, as
469
472
specified in [ BOLT #2 ] ( 02-peer-protocol.md#the-channel_ready-message ) .
470
473
- Note: the corresponding output MUST be a P2TR, as described
@@ -483,15 +486,15 @@ The origin node:
483
486
484
487
The receiving node:
485
488
486
- - If types 0-7 are not present:
489
+ - If any even typed messages are not present:
487
490
- SHOULD send a ` warning ` .
488
491
- MAY close the connection.
489
492
- MUST ignore the message.
490
493
- MUST verify the integrity AND authenticity of the message by verifying the
491
494
` announcement_sig ` as per [ BIP 340] [ bip-340-verify ] .
492
495
- if there is an unknown even bit in the ` features ` field:
493
496
- MUST NOT attempt to route messages through the channel.
494
- - if the ` short_channel_id ` 's output does NOT correspond to a P2WSH (using
497
+ - if the ` short_channel_id ` 's output does NOT correspond to a P2TR (using
495
498
` bitcoin_key_1 ` and ` bitcoin_key_2 ` , as specified in
496
499
[ BOLT #3 ] ( 03-transactions.md#funding-transaction-output ) ) OR the output is
497
500
spent:
@@ -569,31 +572,31 @@ is now a block height and that the message is purely TLV based.
569
572
1 . type: 0 (` announcement_sig ` )
570
573
2 . data:
571
574
* [ ` bip340_sig ` :` bip340_sig ` ]
572
- 3 . type: 1 (` features ` )
575
+ 3 . type: 2 (` features ` )
573
576
4 . data:
574
577
* [ ` ...*byte ` : ` features ` ]
575
- 5 . type: 2 (` timestamp ` )
578
+ 5 . type: 4 (` block_height ` )
576
579
6 . data:
577
580
* [ ` u32 ` : ` block_height ` ]
578
- 7 . type: 3 (` node_ID ` )
581
+ 7 . type: 6 (` node_ID ` )
579
582
8 . data:
580
583
* [ ` point ` :` node_id ` ]
581
- 9 . type: 4 (` color ` )
584
+ 9 . type: 1 (` color ` )
582
585
10 . data:
583
586
* [ ` rgb_color ` :` rgb_color ` ]
584
- 11 . type: 5 (` alias ` )
587
+ 11 . type: 3 (` alias ` )
585
588
12 . data:
586
589
* [ ` ...*utf8 ` :` alias ` ]
587
- 13 . type: 6 (` ipv4_addrs ` )
590
+ 13 . type: 5 (` ipv4_addrs ` )
588
591
14 . data:
589
592
* [ ` ...*ipv4_addr ` : ` ipv4_addresses ` ]
590
593
15 . type: 7 (` ipv6_addrs ` )
591
594
16 . data:
592
595
* [ ` ...*ipv6_addr ` : ` ipv6_addresses ` ]
593
- 17 . type: 8 (` tor_v3_addrs ` )
596
+ 17 . type: 9 (` tor_v3_addrs ` )
594
597
18 . data:
595
598
* [ ` ...*tor_v3_addr ` : ` tor_v3_addresses ` ]
596
- 19 . type: 9 (` dns_hostname ` )
599
+ 19 . type: 11 (` dns_hostname ` )
597
600
20 . data:
598
601
* [ ` dns_hostname ` : ` dns_hostname ` ]
599
602
@@ -638,7 +641,6 @@ exceed 255 bytes.
638
641
639
642
The sender:
640
643
641
- - MUST set types 0-3 (inclusive)
642
644
- MUST set ` announcement_sig ` to a valid [ BIP340] [ bip-340 ] signature for the
643
645
` node_id ` key. The message to be signed is
644
646
` MsgHash("node_announcement_2", "announcement_sig", m) ` where ` m ` is the
@@ -648,7 +650,7 @@ The sender:
648
650
- MAY set ` color ` and ` alias ` to customise appearance in maps and graphs.
649
651
- If the node sets the ` alias ` :
650
652
- MUST use 32 utf8 characters or less.
651
- - MUST set ` timestamp ` to be greater than that of any previous
653
+ - MUST set ` block_height ` to be greater than that of any previous
652
654
` node_announcement_2 ` it has previously created.
653
655
- MUST set it to a block height less than the latest block's height but no
654
656
more than 1440 lower.
@@ -668,7 +670,7 @@ The sender:
668
670
669
671
The receiving node:
670
672
671
- - If any type between 0-3 (inclusive) are missing:
673
+ - If any type between even-typed values are missing:
672
674
- SHOULD send a ` warning ` .
673
675
- MAY close the connection.
674
676
- MUST ignore the message.
@@ -693,11 +695,11 @@ The receiving node:
693
695
- if ` port ` is equal to 0 for any ` ipv6_addr ` OR ` ipv4_addr ` OR ` hostname ` :
694
696
- SHOULD ignore that address.
695
697
- if ` node_id ` is NOT previously known from a ` channel_announcement ` OR
696
- ` channel_announcement_2 ` message, OR if ` timestamp ` is NOT greater than the
698
+ ` channel_announcement_2 ` message, OR if ` blockheight ` is NOT greater than the
697
699
last-received ` node_announcement_2 ` from this ` node_id ` :
698
700
- SHOULD ignore the message.
699
701
- otherwise:
700
- - if ` timestamp ` is greater than the last-received ` node_announcement_2 `
702
+ - if ` block_height ` is greater than the last-received ` node_announcement_2 `
701
703
from this ` node_id ` :
702
704
- SHOULD queue the message for rebroadcasting.
703
705
- MAY use ` rgb_color ` AND ` alias ` to reference nodes in interfaces.
@@ -746,28 +748,28 @@ the last HTLC in the route, are provided in the payment request
746
748
1 . type: 0 (` update_sig ` )
747
749
2 . data:
748
750
* [ ` bip340_sig ` :` bip340_sig ` ]
749
- 3 . type: 2 (` chain_hash ` )
751
+ 3 . type: 1 (` chain_hash ` )
750
752
4 . data:
751
753
* [ ` chain_hash ` :` chain_hash ` ]
752
- 5 . type: 2 (` timestamp ` )
754
+ 5 . type: 2 (` block_height ` )
753
755
6 . data:
754
756
* [ ` u32 ` : ` block_height ` ]
755
- 7 . type: 5 (` channel_flags ` )
757
+ 7 . type: 4 (` channel_flags ` )
756
758
8 . data:
757
759
* [ ` ...*byte ` , ` channel_flags ` ]
758
760
9 . type: 6 (` cltv_expiry_delta ` )
759
761
10 . data:
760
762
* [ ` tu32 ` , ` cltv_expiry_delta ` ]
761
- 11 . type: 7 (` htlc_min_msat ` )
763
+ 11 . type: 8 (` htlc_min_msat ` )
762
764
12 . data:
763
765
* [ ` tu64 ` , ` htlc_min_msat ` ]
764
766
13 . type: 10 (` htlc_max_msat ` )
765
767
14 . data:
766
768
* [ ` tu64 ` , ` htlc_max_msat ` ]
767
- 15 . type: 8 (` fee_base_msat ` )
769
+ 15 . type: 12 (` fee_base_msat ` )
768
770
16 . data:
769
771
* [ ` tu32 ` , ` fee_base_msat ` ]
770
- 17 . type: 9 (` fee_prop_millionths ` )
772
+ 17 . type: 14 (` fee_prop_millionths ` )
771
773
18 . data:
772
774
* [ ` tu32 ` , ` fee_prop_millionths ` ]
773
775
@@ -788,6 +790,10 @@ The `node_id` for the signature verification is taken from the corresponding
788
790
### Requirements
789
791
790
792
The origin node:
793
+ - If the chain being referred to is not the Bitcoin blockchain:
794
+ - MUST set ` chain_hash ` to the 32-byte hash that uniquely identifies the
795
+ chain that the channel was opened within:
796
+ - otherwise, MUST not set ` chain_hash ` as the _ Bitcoin blockchain_ is assumed.
791
797
- MUST NOT send ` channel_update_2 ` before ` channel_ready ` has been received.
792
798
- MUST NOT send ` channel_update_2 ` for legacy (non-taproot) channels.
793
799
- MAY create a ` channel_update_2 ` to communicate the channel parameters to the
@@ -823,10 +829,10 @@ The origin node:
823
829
settlement).
824
830
- MAY send a subsequent ` channel_update_2 ` with the ` disable ` bit set to 0
825
831
to re-enable the channel.
826
- - MUST set ` timestamp ` greater or equal to the block height that the channel's
827
- funding transaction was mined in AND to greater than any previously-sent
828
- ` channel_update_2 ` for this ` short_channel_id ` AND no less than 1440 blocks
829
- below the current best block height .
832
+ - MUST set ` block_height ` greater or equal to the block height that the
833
+ channel's funding transaction was mined in AND to greater than any
834
+ previously-sent ` channel_update_2 ` for this ` short_channel_id ` AND no less
835
+ than 1440 blocks below the current best block height .
830
836
- MUST set ` cltv_expiry_delta ` to the number of blocks it will subtract from
831
837
an incoming HTLC's ` cltv_expiry ` .
832
838
- MUST set ` htlc_minimum_msat ` to the minimum HTLC value (in millisatoshi)
@@ -855,21 +861,21 @@ The receiving node:
855
861
- if the specified ` chain_hash ` value is unknown (meaning it isn't active on
856
862
the specified chain):
857
863
- MUST ignore the channel update.
858
- - if the ` timestamp ` is equal to the last-received ` channel_update_2 ` for this
859
- ` short_channel_id ` AND ` node_id ` :
860
- - if the fields below ` timestamp ` differ:
864
+ - if the ` block_height ` is equal to the last-received ` channel_update_2 ` for
865
+ this ` short_channel_id ` AND ` node_id ` :
866
+ - if the fields below ` block_height ` differ:
861
867
- MAY blacklist this ` node_id ` .
862
868
- MAY forget all channels associated with it.
863
- - if the fields below ` timestamp ` are equal:
869
+ - if the fields below ` block_height ` are equal:
864
870
- SHOULD ignore this message
865
- - if ` timestamp ` is lower than that of the last-received
871
+ - if ` block_height ` is lower than that of the last-received
866
872
` channel_update_2 ` for this ` short_channel_id ` AND for ` node_id ` :
867
873
- SHOULD ignore the message.
868
874
- otherwise:
869
- - if the ` timestamp ` is a block height greater than the current best block
875
+ - if the ` block_height ` is a block height greater than the current best block
870
876
height:
871
877
- MAY discard the ` channel_update_2 ` .
872
- - if the ` timestamp ` block height is more than 1440 blocks less than the
878
+ - if the ` block_height ` block height is more than 1440 blocks less than the
873
879
current best block height:
874
880
- MAY discard the ` channel_update_2 ` .
875
881
- otherwise:
0 commit comments