Skip to content

Commit e27f165

Browse files
committed
add option_pubkey_routing
1 parent 80c1ae1 commit e27f165

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

04-onion-routing.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ It is formatted according to the Type-Length-Value format defined in [BOLT #1](0
263263
2. data:
264264
* [`32*byte`:`payment_secret`]
265265
* [`tu64`:`total_msat`]
266+
1. type: 10 (`pub_key`)
267+
2. data:
268+
* [`33*byte`:`pub_key`]
266269

267270
### Requirements
268271

@@ -272,10 +275,16 @@ The writer:
272275
- For every node:
273276
- MUST include `amt_to_forward` and `outgoing_cltv_value`.
274277
- For every non-final node:
275-
- MUST include `short_channel_id`
278+
- If `option_pubkey_routing`:
279+
- MUST NOT include `short_channel_id`
280+
- MUST include `pub_key`
281+
- If not `option_pubkey_routing`:
282+
- MUST include `short_channel_id`
283+
- MUST NOT include `pub_key`
276284
- MUST NOT include `payment_data`
277285
- For the final node:
278286
- MUST NOT include `short_channel_id`
287+
- MUST NOT include `pub_key`
279288
- if the recipient provided `payment_secret`:
280289
- MUST include `payment_data`
281290
- MUST set `payment_secret` to the one provided
@@ -380,6 +389,8 @@ nodes A and B, the HTLC can be forwarded across any channel connecting A and B.
380389
Failure to adhere will result in the receiver being unable to decrypt the next
381390
hop in the onion packet.
382391

392+
If `pub_key` is specified, forwarding can only be non-strict.
393+
383394
### Rationale
384395

385396
In the event that two peers have multiple channels, the downstream node will be
@@ -399,7 +410,8 @@ A and B.
399410

400411
Non-strict forwarding allows nodes to make use of private channels connecting
401412
them to the receiving node, even if the channel is not known in the public
402-
channel graph.
413+
channel graph. When `option_pubkey_routing` is used, no channel point information
414+
needs to be leaked through invoice route hints at all.
403415

404416
### Recommendation
405417

09-features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ The Context column decodes as follows:
4040
| 18/19 | `option_support_large_channel` | Can create large channels | IN | | [BOLT #2](02-peer-protocol.md#the-open_channel-message) |
4141
| 20/21 | `option_anchor_outputs` | Anchor outputs | IN | `option_static_remotekey` | [BOLT #3](03-transactions.md) |
4242
| 22/23 | `option_anchors_zero_fee_htlc_tx` | Anchor commitment type with zero fee HTLC transactions | IN | | [BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful]|
43+
| 26/27 | `option_pubkey_routing` | Public key routing | IN9 | `var_onion_optin` | [BOLT #4](04-onion-routing.md#tlv-payload-format) |
4344

4445
## Requirements
4546

11-payment-encoding.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,10 @@ A writer:
187187
- MUST include at least one `r` field.
188188
- `r` field MUST contain one or more ordered entries, indicating the forward route from
189189
a public node to the final destination.
190-
- Note: for each entry, the `pubkey` is the node ID of the start of the channel;
191-
`short_channel_id` is the short channel ID field to identify the channel; and
190+
- Note: for each entry, the `pubkey` is the node ID of the start of the channel.
191+
`short_channel_id` is the short channel ID field to identify the channel. If the routing node
192+
supports `option_pubkey_routing`, `short_channel_id` may be set to all zeroes to
193+
keep the channel point information private.
192194
`fee_base_msat`, `fee_proportional_millionths`, and `cltv_expiry_delta` are as
193195
specified in [BOLT #7](07-routing-gossip.md#the-channel_update-message).
194196
- MAY include more than one `r` field to provide multiple routing options.

0 commit comments

Comments
 (0)