From ba2b95a98a415a24c27685a34648c1f64468a4bf Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 11 Sep 2023 12:56:09 +0930 Subject: [PATCH] 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. --- 04-onion-routing.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/04-onion-routing.md b/04-onion-routing.md index 6c4d08fa1..f68a0da0a 100644 --- a/04-onion-routing.md +++ b/04-onion-routing.md @@ -243,7 +243,8 @@ leaking its position in the route. The creator of `encrypted_recipient_data` (usually, the recipient of payment): - MUST create `encrypted_data_tlv` for each node in the blinded route (including itself). - - MUST include `encrypted_data_tlv.short_channel_id` and `encrypted_data_tlv.payment_relay` for each non-final node. + - MUST include `encrypted_data_tlv.payment_relay` for each non-final node. + - MUST include exactly one of `encrypted_data_tlv.short_channel_id` or `encrypted_data_tlv.next_node_id` for each non-final node. - MUST set `encrypted_data_tlv.payment_constraints` for each non-final node: - `max_cltv_expiry` to the largest block height at which the route is allowed to be used, starting from the final node and adding `encrypted_data_tlv.payment_relay.cltv_expiry_delta` at each hop. @@ -1541,7 +1542,8 @@ The reader: - if the `encrypted_data_tlv` contains `path_id`: - MUST ignore the message. - otherwise: - - SHOULD forward the message using `onion_message` to the next peer indicated by `next_node_id`. + - SHOULD forward the message using `onion_message` to the next peer indicated by either `next_node_id` + or the channel counterparty with `short_channel_id`. - if it forwards the message: - MUST set `blinding` in the forwarded `onion_message` to the next blinding as calculated in [Route Blinding](#route-blinding). - otherwise (it is the final node):