From 7add56aa2072c70659057c36504e11ccebfeaf10 Mon Sep 17 00:00:00 2001 From: Thomas HUET Date: Wed, 14 Feb 2024 13:41:34 +0100 Subject: [PATCH 1/2] Compact representation for node id --- 01-messaging.md | 6 ++++++ 04-onion-routing.md | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/01-messaging.md b/01-messaging.md index 5bf740c4e..3c4e178ea 100644 --- a/01-messaging.md +++ b/01-messaging.md @@ -245,6 +245,12 @@ The following convenience types are also defined: * `signature`: a 64-byte bitcoin Elliptic Curve signature * `point`: a 33-byte Elliptic Curve point (compressed encoding as per [SEC 1 standard](http://www.secg.org/sec1-v2.pdf#subsubsection.2.3.3)) * `short_channel_id`: an 8 byte value identifying a channel (see [BOLT #7](07-routing-gossip.md#definition-of-short-channel-id)) +* `sciddir_or_pubkey`: either 9 or 33 bytes referencing or identifying a node, respectively + * if the first byte is 0 or 1, then an 8-byte `short_channel_id` follows for a total of 9 bytes + * 0 for the first byte indicates this refers to `node_id_1` in the `channel_announcement` for `short_channel_id` + * 1 for the first byte indicates this refers to `node_id_2` in the `channel_announcement` for `short_channel_id` + (see [BOLT #7](07-routing-gossip.md#the-channel_announcement-message) + * if the first byte is 2 or 3, then the value is a 33-byte `point` * `bigsize`: a variable-length, unsigned integer similar to Bitcoin's CompactSize encoding, but big-endian. Described in [BigSize](#appendix-a-bigsize-test-vectors). ## Setup Messages diff --git a/04-onion-routing.md b/04-onion-routing.md index b62f4874b..cfd244e13 100644 --- a/04-onion-routing.md +++ b/04-onion-routing.md @@ -468,7 +468,7 @@ may contain the following TLV fields: * [`short_channel_id`:`short_channel_id`] 1. type: 4 (`next_node_id`) 2. data: - * [`point`:`node_id`] + * [`sciddir_or_pubkey`:`node_id`] 1. type: 6 (`path_id`) 2. data: * [`...*byte`:`data`] @@ -1476,7 +1476,7 @@ even, of course!). 1. subtype: `blinded_path` 2. data: - * [`point`:`first_node_id`] + * [`sciddir_or_pubkey`:`first_node_id`] * [`point`:`blinding`] * [`byte`:`num_hops`] * [`num_hops*onionmsg_hop`:`path`] From 8287b02ac44d7aeee54708994d7f35c7f323c243 Mon Sep 17 00:00:00 2001 From: Thomas HUET <81159533+thomash-acinq@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:51:03 +0100 Subject: [PATCH 2/2] Update 01-messaging.md Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com> --- 01-messaging.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/01-messaging.md b/01-messaging.md index 3c4e178ea..8f7259b60 100644 --- a/01-messaging.md +++ b/01-messaging.md @@ -247,9 +247,8 @@ The following convenience types are also defined: * `short_channel_id`: an 8 byte value identifying a channel (see [BOLT #7](07-routing-gossip.md#definition-of-short-channel-id)) * `sciddir_or_pubkey`: either 9 or 33 bytes referencing or identifying a node, respectively * if the first byte is 0 or 1, then an 8-byte `short_channel_id` follows for a total of 9 bytes - * 0 for the first byte indicates this refers to `node_id_1` in the `channel_announcement` for `short_channel_id` - * 1 for the first byte indicates this refers to `node_id_2` in the `channel_announcement` for `short_channel_id` - (see [BOLT #7](07-routing-gossip.md#the-channel_announcement-message) + * 0 for the first byte indicates this refers to `node_id_1` in the `channel_announcement` for `short_channel_id` (see [BOLT #7](07-routing-gossip.md#the-channel_announcement-message)) + * 1 for the first byte indicates this refers to `node_id_2` in the `channel_announcement` for `short_channel_id` (see [BOLT #7](07-routing-gossip.md#the-channel_announcement-message)) * if the first byte is 2 or 3, then the value is a 33-byte `point` * `bigsize`: a variable-length, unsigned integer similar to Bitcoin's CompactSize encoding, but big-endian. Described in [BigSize](#appendix-a-bigsize-test-vectors).