@@ -254,16 +254,14 @@ While the network is in the upgrade phase, the following suggestions apply:
254
254
255
255
The following convenient types are defined:
256
256
257
- * `bip340_sig `: a 64-byte bitcoin Elliptic Curve Schnorr signature as
257
+ * `bip340sig `: a 64-byte bitcoin Elliptic Curve Schnorr signature as
258
258
per [BIP-340][bip-340].
259
259
* `partial_signature`: a 32-byte partial MuSig2 signature as defined
260
260
in [BIP-MuSig2][bip-musig2].
261
261
* `public_nonce`: a 66-byte public nonce as defined in [BIP-MuSig2][bip-musig2].
262
262
* `utf8`: a byte as part of a UTF-8 string. A writer MUST ensure an array of
263
263
these is a valid UTF-8 string, a reader MAY reject any messages containing an
264
264
array of these which is not a valid UTF-8 string.
265
- * `boolean_tlv`: a zero length TLV record. If the TLV is present then true is
266
- implied, otherwise false is implied.
267
265
268
266
### Feature Bits
269
267
@@ -350,7 +348,7 @@ The recipient:
350
348
- SHOULD ignore the message.
351
349
- Otherwise:
352
350
- MUST store the nonces so that they can be used for the partial signature
353
- construction required for constructing the `announcement_signatures `
351
+ construction required for constructing the `announcement_signatures_2 `
354
352
message.
355
353
- If it has not yet done so, SHOULD respond with its own `channel_ready`
356
354
message with the nonce fields set.
@@ -390,7 +388,7 @@ A node:
390
388
- MUST set the `partial_signature` field to the 32-byte `partial_sig` value
391
389
of the partial signature calculated as described in [Partial Signature
392
390
Calculation](#partial-signature-calculation). The message to be signed is
393
- `MsgHash("channel_announcement", "announcement_sig ", m)` where `m` is the
391
+ `MsgHash("channel_announcement", "signature ", m)` where `m` is the
394
392
serialisation of the `channel_announcement_2` message tlv stream (see the
395
393
[`MsgHash`](#signature-message-construction) definition).
396
394
- otherwise:
@@ -442,7 +440,7 @@ channel.
442
440
443
441
1. type: 267 (`channel_announcement_2`)
444
442
2. data:
445
- * [`bip340_sig `:`announcement_signature `]
443
+ * [`bip340sig `:`signature `]
446
444
* [`channel_announcement_2_tlvs`:`tlvs`]
447
445
448
446
1. `tlv_stream`: `channel_announcement_2_tlvs`
@@ -494,9 +492,9 @@ Unlike the legacy `node_announcement` message, this message makes use of a
494
492
BIP340 signature instead of an ECDSA one. This will allow nodes to be backed
495
493
by multiple keys since MuSig2 can be used to construct the single signature.
496
494
497
- 1. type 269
495
+ 1. type: 269 (`node_announcement_2`)
498
496
2. data:
499
- * [`bip340_sig `:`announcement_sig `]
497
+ * [`bip340sig `:`signature `]
500
498
* [`node_announcement_2_tlvs`:`tlvs`]
501
499
502
500
1. `tlv_stream`: `node_announcement_2_tlvs`
@@ -560,8 +558,8 @@ The following subtypes are defined:
560
558
561
559
#### Message Field Descriptions
562
560
563
- - `bip340_sig ` is the [BIP340][bip-340] signature for the `node_id` key. The
564
- message to be signed is `MsgHash("node_announcement_2", "bip340_sig ", m)`
561
+ - `signature ` is the [BIP340][bip-340] signature for the `node_id` key. The
562
+ message to be signed is `MsgHash("node_announcement_2", "signature ", m)`
565
563
where `m` is the serialised TLV stream (see the
566
564
[`MsgHash`](#signature-message-construction) definition).
567
565
- `features` is a bit vector with bits set according to [BOLT #9](09-features.md#assigned-features-flags)
@@ -594,11 +592,11 @@ ok to send both? if so - what if the info inside them differs?
594
592
The sender:
595
593
596
594
- MUST set TLV fields 0, 2 and 4.
597
- - MUST set `announcement_sig ` to a valid [BIP340][bip-340] signature for the
595
+ - MUST set `signature ` to a valid [BIP340][bip-340] signature for the
598
596
`node_id` key. The message to be signed is
599
- `MsgHash("node_announcement_2", "announcement_sig ", m)` where `m` is the
597
+ `MsgHash("node_announcement_2", "signature ", m)` where `m` is the
600
598
serialisation of the `node_announcement_2` message excluding the
601
- `announcement_sig ` field (see the
599
+ `signature ` field (see the
602
600
[`MsgHash`](#signature-message-construction) definition).
603
601
- MAY set `color` and `alias` to customise appearance in maps and graphs.
604
602
- If the node sets the `alias`:
@@ -635,7 +633,7 @@ The receiver:
635
633
- SHOULD send a `warning`.
636
634
- MAY close the connection.
637
635
- MUST NOT process the message further.
638
- - if `announcement_sig ` is NOT a valid [BIP340][bip-340] signature (using
636
+ - if `signature ` is NOT a valid [BIP340][bip-340] signature (using
639
637
`node_id` over the message):
640
638
- SHOULD send a `warning`.
641
639
- MAY close the connection.
@@ -692,9 +690,9 @@ value for `amount_msat` and the minimal value for `cltv_expiry`, to be used for
692
690
the last HTLC in the route, are provided in the payment request
693
691
694
692
(see [BOLT #11][[bolt-11-tagged-fields]]).
695
- 1. type 271
693
+ 1. type: 271 (`channel_update_2`)
696
694
2. data:
697
- * [`bip340_sig `:`bip340_sig `]
695
+ * [`bip340sig `:`signature `]
698
696
* [`channel_update_2_tlvs`:`tlvs`]
699
697
700
698
1. `tlv_stream`: `channel_update_2_tlvs`
@@ -711,9 +709,7 @@ the last HTLC in the route, are provided in the payment request
711
709
1. type: 6 (`disable_flags`)
712
710
2. data:
713
711
* [`byte`:`disable_flags`]
714
- 1. type: 8 (`direction`)
715
- 2. data:
716
- * [`boolean_tlv`:`direction`]
712
+ 1. type: 8 (`second_peer`)
717
713
1. type: 10 (`cltv_expiry_delta`)
718
714
2. data:
719
715
* [`u16`:`cltv_expiry_delta`]
@@ -731,17 +727,21 @@ the last HTLC in the route, are provided in the payment request
731
727
* [`u32`:`fee_proportional_millionths`]
732
728
733
729
734
- The `disable_flags` bitfield is used to indicate that the channel is temporarily
735
- disabled. The following table specifies the meaning of the individual bits:
730
+ The `disable_flags` bitfield is used to indicate that the channel is either
731
+ temporarily or permanently disabled. The following table specifies the meaning
732
+ of the individual bits:
736
733
737
- | Bit Position | Name | Meaning |
738
- |---------------|------------|-------------------------------------------------|
739
- | 0 | `incoming` | The node can't receive via this channel |
740
- | 1 | `outgoing` | The node can't forward or send via this channel |
734
+ | Bit Position | Name | Meaning |
735
+ |--------------|-------------|-------------------------------------------------------|
736
+ | 0 | `permanant` | The disable update is permanent (otherwise temporary) |
737
+ | 1 | `incoming` | The node can't receive via this channel |
738
+ | 2 | `outgoing` | The node can't forward or send via this channel |
741
739
742
740
Both the `incoming` and `outgoing` bit can be set to indicate that the channel
743
741
peer is offline.
744
742
743
+ If the `permanant` bit is set, then the channel can be considered closed.
744
+
745
745
#### Message Field Descriptions
746
746
747
747
- The `chain_hash` is used to identify the blockchain containing the channel
@@ -757,11 +757,10 @@ peer is offline.
757
757
- The `disable` bit field can be used to advertise to the network that a channel
758
758
is disabled and that it should not be used for routing. The individual
759
759
`disable_flags` bits can be used to communicate more fine-grained information.
760
- - The `direction` is used to indicate which node in the channel node pair
761
- has created and signed this message. If the node was `node_id_1` in the
762
- `channel_announcment` message then the `direction` is 0 (false) otherwise
763
- it is 1 (true) and the node is `node_id_2` in the `channel_announcement`
764
- message.
760
+ - The `second_peer` is used to indicate which node in the channel node pair has
761
+ created and signed this message. If present, the node was `node_id_2` in the
762
+ `channel_announcment`, otherwise the node is `node_id_1` in the
763
+ `channel_announcement` message.
765
764
- `cltv_expiry_delta` is the number of blocks that the node will subtract from
766
765
an incoming HTLC's `cltv_expiry`.
767
766
- `htlc_minimum_msat` is the minimum HTLC value (in millisatoshi) that the
@@ -778,14 +777,13 @@ peer is offline.
778
777
779
778
#### TLV Defaults
780
779
781
- For types 0, 6, 8, 10, 12, 14, 16 and 18, the following defaults apply if the
780
+ For types 0, 6, 10, 12, 14, 16 and 18, the following defaults apply if the
782
781
TLV is not present in the message:
783
782
784
783
| `channel_update_2` TLV Type | Default Value | Comment |
785
784
|------------------------------------|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
786
785
| 0 (`chain_hash`) | `6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000` | The hash of the genesis block of the mainnet Bitcoin blockchain. |
787
786
| 6 (`disable`) | empty | |
788
- | 8 (`direction`) | false | |
789
787
| 10 (`cltv_expiry_delta`) | 80 | |
790
788
| 12 (`htlc_minimum_msat`) | 1 | |
791
789
| 14 (`htlc_maximum_msat`) | floor(channel capacity / 2) | // TODO: remove this since makes encoding/decoding dependent on things outside the message? |
@@ -817,9 +815,9 @@ The origin node:
817
815
- MUST set `chain_hash` AND `short_channel_id` to match the 32-byte hash AND
818
816
8-byte channel ID that uniquely identifies the channel specified in the
819
817
`channel_announcement_2` message.
820
- - MUST set `bip340_sig ` to a valid [BIP340][bip-340] signature for its own
818
+ - MUST set `signature ` to a valid [BIP340][bip-340] signature for its own
821
819
`node_id` key. The message to be signed is
822
- `MsgHash("channel_update_2", "bip340_sig ", m)` where `m` is the serialised
820
+ `MsgHash("channel_update_2", "signature ", m)` where `m` is the serialised
823
821
TLV stream of the `channel_update` (see the
824
822
[`MsgHash`](#signature-message-construction) definition).
825
823
- SHOULD NOT create redundant `channel_update_2`s.
@@ -834,7 +832,7 @@ The receiving node:
834
832
channels.
835
833
- SHOULD accept `channel_update_2`s for its own channels (even if non-public),
836
834
in order to learn the associated origin nodes' forwarding parameters.
837
- - if `bip340_sig ` is NOT a valid [BIP340][bip-340] signature (using `node_id`
835
+ - if `signature ` is NOT a valid [BIP340][bip-340] signature (using `node_id`
838
836
over the message):
839
837
- SHOULD send a `warning` and close the connection.
840
838
- MUST NOT process the message further.
@@ -890,7 +888,7 @@ aggnonce = Musig2.NonceAgg(announcement_node_secnonce_1, announcement_bitcoin_pu
890
888
```
891
889
892
890
The message, `msg` that the peers will sign is the serialisation of
893
- `channel_announcement_2` _without_ the `announcement_sig ` field (i.e. without
891
+ `channel_announcement_2` _without_ the `signature ` field (i.e. without
894
892
type 0)
895
893
896
894
With all the information mentioned, both peers can now construct the
@@ -1003,10 +1001,9 @@ The full list of inputs required:
1003
1001
- `node_id_2`
1004
1002
- `tr_output_key`
1005
1003
- `msg`: the serialised `channel_announcement_2` tlv stream.
1006
- - `sig`: the 64-byte BIP340 signature found in the
1007
- `channel_announcement_signature` field of the `channel_announcement_2`
1008
- message. This signature must be parsed into `R` and `s` values as defined in
1009
- BIP327.
1004
+ - `sig`: the 64-byte BIP340 signature found in the `signature` field of the
1005
+ `channel_announcement_2` message. This signature must be parsed into `R` and
1006
+ `s` values as defined in BIP327.
1010
1007
1011
1008
The aggregate key can be calculated as follows:
1012
1009
@@ -1016,7 +1013,7 @@ P_agg = MuSig2.KeyAgg(MuSig2.KeySort(`node_id_1`, `node_id_2`, `tr_output_key`))
1016
1013
1017
1014
The signature can then be verified as follows:
1018
1015
- Let `pk` = `bytes(P_agg)` where the `bytes` function is defined in BIP340.
1019
- - Let `m` = `MsgHash("channel_announcement_2", "announcement_signature ", msg)`
1016
+ - Let `m` = `MsgHash("channel_announcement_2", "signature ", msg)`
1020
1017
- Use the BIP340 `Verify` function to determine if the signature is valid by
1021
1018
passing in `pk`, `m` and `sig`.
1022
1019
@@ -1059,10 +1056,9 @@ The full list of inputs required:
1059
1056
- `bitcoin_key_1`
1060
1057
- `bitcoin_key_2`
1061
1058
- `msg`: the serialised `channel_announcement_2` tlv stream.
1062
- - `sig`: the 64-byte BIP340 signature found in the
1063
- `channel_announcement_signature` field of the `channel_announcement_2`
1064
- message. This signature must be parsed into `R` and `s` values as defined in
1065
- BIP327.
1059
+ - `sig`: the 64-byte BIP340 signature found in the `signature` field of the
1060
+ `channel_announcement_2` message. This signature must be parsed into `R` and
1061
+ `s` values as defined in BIP327.
1066
1062
1067
1063
The aggregate key can be calculated as follows:
1068
1064
@@ -1072,7 +1068,7 @@ P_agg = MuSig2.KeyAgg(MuSig2.KeySort(`node_id_1`, `node_id_2`, `bitcoin_key_1`,
1072
1068
1073
1069
The signature can then be verified as follows:
1074
1070
- Let `pk` = `bytes(P_agg)` where the `bytes` function is defined in BIP340.
1075
- - Let `m` = `MsgHash("channel_announcement_2", "announcement_signature ", msg)`
1071
+ - Let `m` = `MsgHash("channel_announcement_2", "signature ", msg)`
1076
1072
- Use the BIP340 `Verify` function to determine if the signature is valid by
1077
1073
passing in `pk`, `m` and `sig`.
1078
1074
0 commit comments