@@ -286,6 +286,10 @@ The following `address descriptor` types are defined:
286
286
onion service addresses; Encodes:
287
287
` [32:32_byte_ed25519_pubkey] || [2:checksum] || [1:version] ` , where
288
288
` 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
289
293
290
294
### Requirements
291
295
@@ -307,13 +311,14 @@ The origin node:
307
311
- MUST place address descriptors in ascending order.
308
312
- SHOULD NOT place any zero-typed address descriptors anywhere.
309
313
- 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.
312
316
- SHOULD ensure ` ipv4_addr ` AND ` ipv6_addr ` are routable addresses.
313
317
- MUST set ` features ` according to [ BOLT #9 ] ( 09-features.md#assigned-features-flags )
314
318
- SHOULD set ` flen ` to the minimum length required to hold the ` features `
315
319
bits it sets.
316
320
- SHOULD not announce a Tor v2 onion service.
321
+ - MUST NOT announce more than one ` type 5 ` DNS hostname.
317
322
318
323
The receiving node:
319
324
- if ` node_id ` is NOT a valid compressed public key:
@@ -338,7 +343,7 @@ any future fields appended to the end):
338
343
- SHOULD send a ` warning ` .
339
344
- MAY close the connection.
340
345
- if ` port ` is equal to 0:
341
- - SHOULD ignore ` ipv6_addr ` OR ` ipv4_addr ` .
346
+ - SHOULD ignore ` ipv6_addr ` OR ` ipv4_addr ` OR ` hostname ` .
342
347
- if ` node_id ` is NOT previously known from a ` channel_announcement ` message,
343
348
OR if ` timestamp ` is NOT greater than the last-received ` node_announcement `
344
349
from this ` node_id ` :
@@ -351,6 +356,9 @@ any future fields appended to the end):
351
356
- MAY use ` rgb_color ` AND ` alias ` to reference nodes in interfaces.
352
357
- SHOULD insinuate their self-signed origins.
353
358
- 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 ` .
354
362
355
363
### Rationale
356
364
0 commit comments