Skip to content

Commit ba2b95a

Browse files
jkczyzrustyrussell
authored andcommitted
Allow using short_channel_id in onion messages
Offers may contain blinded paths to allow for greater recipient privacy. However, they come at a cost of increased QR code size as each hop requires a 33-byte `point` for the `next_node_id`. Allow using `short_channel_id` instead, which only requires 8 bytes. Still allow for use of `next_node_id` for cases where the blinded path may not involve channel counterparties or for long-lived offers, which may outlive the given channels.
1 parent fe6c2c6 commit ba2b95a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

04-onion-routing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ leaking its position in the route.
243243
The creator of `encrypted_recipient_data` (usually, the recipient of payment):
244244

245245
- MUST create `encrypted_data_tlv` for each node in the blinded route (including itself).
246-
- MUST include `encrypted_data_tlv.short_channel_id` and `encrypted_data_tlv.payment_relay` for each non-final node.
246+
- MUST include `encrypted_data_tlv.payment_relay` for each non-final node.
247+
- MUST include exactly one of `encrypted_data_tlv.short_channel_id` or `encrypted_data_tlv.next_node_id` for each non-final node.
247248
- MUST set `encrypted_data_tlv.payment_constraints` for each non-final node:
248249
- `max_cltv_expiry` to the largest block height at which the route is allowed to be used, starting
249250
from the final node and adding `encrypted_data_tlv.payment_relay.cltv_expiry_delta` at each hop.
@@ -1541,7 +1542,8 @@ The reader:
15411542
- if the `encrypted_data_tlv` contains `path_id`:
15421543
- MUST ignore the message.
15431544
- otherwise:
1544-
- SHOULD forward the message using `onion_message` to the next peer indicated by `next_node_id`.
1545+
- SHOULD forward the message using `onion_message` to the next peer indicated by either `next_node_id`
1546+
or the channel counterparty with `short_channel_id`.
15451547
- if it forwards the message:
15461548
- MUST set `blinding` in the forwarded `onion_message` to the next blinding as calculated in [Route Blinding](#route-blinding).
15471549
- otherwise (it is the final node):

0 commit comments

Comments
 (0)