Skip to content

Commit 3db064e

Browse files
jkczyzrustyrussell
authored andcommitted
Add a sciddir_or_pubkey fundamental type
Offers may contain blinded paths to allow for greater recipient privacy. However, they come at a cost of increased QR code size as the introduction node requires a 33-byte `point`. Define a new `sciddir_or_pubkey` fundamental type such that either a point or a reference to one in a `channel_announcement` can be used. This is backwards compatible with `point`. Use this new type for the `blinded_path` subtype's `first_node_id`.
1 parent ba2b95a commit 3db064e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

01-messaging.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ The following convenience types are also defined:
246246
* `bip340sig`: a 64-byte bitcoin Elliptic Curve Schnorr signature as per [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki)
247247
* `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))
248248
* `short_channel_id`: an 8 byte value identifying a channel (see [BOLT #7](07-routing-gossip.md#definition-of-short-channel-id))
249+
* `sciddir_or_pubkey`: either 9 or 33 bytes referencing or identifying a node, respectively
250+
* if the first byte is 0 or 1, then an 8-byte `short_channel_id` follows for a total of 9 bytes
251+
* 0 for the first byte indicates this refers to `node_id_1` in the `channel_announcement` for `short_channel_id`
252+
* 1 for the first byte indicates this refers to `node_id_2` in the `channel_announcement` for `short_channel_id`
253+
(see [BOLT #7](07-routing-gossip.md#the-channel_announcement-message)
254+
* if the first byte is 2 or 3, then the value is a 33-byte `point`
249255
* `bigsize`: a variable-length, unsigned integer similar to Bitcoin's CompactSize encoding, but big-endian. Described in [BigSize](#appendix-a-bigsize-test-vectors).
250256
* `utf8`: a byte as part of a UTF-8 string. A writer MUST ensure an array of these is a valid UTF-8 string, a reader MAY reject any messages containing an array of these which is not a valid UTF-8 string.
251257

04-onion-routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ even, of course!).
14851485

14861486
1. subtype: `blinded_path`
14871487
2. data:
1488-
* [`point`:`first_node_id`]
1488+
* [`sciddir_or_pubkey`:`first_node_id`]
14891489
* [`point`:`blinding`]
14901490
* [`byte`:`num_hops`]
14911491
* [`num_hops*onionmsg_hop`:`path`]

0 commit comments

Comments
 (0)