Skip to content

Commit 38a2b1d

Browse files
authored
Merge pull request #911 from m-schmoock/bolt7-hostnames
BOLT 7: add gossip address descriptor type DNS hostname
2 parents 341ec84 + 088ac9d commit 38a2b1d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

07-routing-gossip.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ The following `address descriptor` types are defined:
286286
onion service addresses; Encodes:
287287
`[32:32_byte_ed25519_pubkey] || [2:checksum] || [1:version]`, where
288288
`checksum = sha3(".onion checksum" | pubkey || version)[:2]`.
289+
* `5`: DNS hostname; data = `[1:hostname_len][hostname_len:hostname][2:port]` (length up to 258)
290+
* `hostname` bytes MUST be ASCII characters.
291+
* Non-ASCII characters MUST be encoded using Punycode:
292+
https://en.wikipedia.org/wiki/Punycode
289293

290294
### Requirements
291295

@@ -307,13 +311,14 @@ The origin node:
307311
- MUST place address descriptors in ascending order.
308312
- SHOULD NOT place any zero-typed address descriptors anywhere.
309313
- SHOULD use placement only for aligning fields that follow `addresses`.
310-
- MUST NOT create a `type 1` OR `type 2` address descriptor with `port` equal
311-
to 0.
314+
- MUST NOT create a `type 1`, `type 2` or `type 5` address descriptor with
315+
`port` equal to 0.
312316
- SHOULD ensure `ipv4_addr` AND `ipv6_addr` are routable addresses.
313317
- MUST set `features` according to [BOLT #9](09-features.md#assigned-features-flags)
314318
- SHOULD set `flen` to the minimum length required to hold the `features`
315319
bits it sets.
316320
- SHOULD not announce a Tor v2 onion service.
321+
- MUST NOT announce more than one `type 5` DNS hostname.
317322

318323
The receiving node:
319324
- if `node_id` is NOT a valid compressed public key:
@@ -338,7 +343,7 @@ any future fields appended to the end):
338343
- SHOULD send a `warning`.
339344
- MAY close the connection.
340345
- if `port` is equal to 0:
341-
- SHOULD ignore `ipv6_addr` OR `ipv4_addr`.
346+
- SHOULD ignore `ipv6_addr` OR `ipv4_addr` OR `hostname`.
342347
- if `node_id` is NOT previously known from a `channel_announcement` message,
343348
OR if `timestamp` is NOT greater than the last-received `node_announcement`
344349
from this `node_id`:
@@ -351,6 +356,9 @@ any future fields appended to the end):
351356
- MAY use `rgb_color` AND `alias` to reference nodes in interfaces.
352357
- SHOULD insinuate their self-signed origins.
353358
- SHOULD ignore Tor v2 onion services.
359+
- if more than one `type 5` address is announced:
360+
- SHOULD ignore the additional data.
361+
- MUST not forward the `node_announcement`.
354362

355363
### Rationale
356364

0 commit comments

Comments
 (0)