Skip to content

Commit efe9d2d

Browse files
committed
BOLT 1: adds remote address to optional init_tlvs
This adds the option to report an remote IP address back to a connecting peer using the `init` message. A node can decide to use that information to discover a potential update to its public IPv4 address (NAT) and use that for a `node_announcement` update message containing the new address. The proposal includes reporting the IPv4 and IPv6 address, however in IPv6 there are likely no NAT issues. TOR is skipped for obvious reasons. Certain approaches to check and use this information are thinkable: - Wait for multiple peers or a certain fraction to report the same new address. - Check some random node known via gossip to also report the new address. - Verify this information by making a test connection to itself.
1 parent ea37941 commit efe9d2d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

01-messaging.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,12 @@ The `features` field MUST be padded to bytes with 0s.
265265
2. data:
266266
* [`...*chain_hash`:`chains`]
267267

268+
1. type: 3 (`remote_addr`)
269+
2. data:
270+
* `address descriptor` (1 byte type and data, see BOLT 7)
268271

269272
The optional `networks` indicates the chains the node is interested in.
273+
The optional `remote_addr` can be used to circumvent NAT issues.
270274

271275
#### Requirements
272276

@@ -277,6 +281,10 @@ The sending node:
277281
- SHOULD NOT set features greater than 13 in `globalfeatures`.
278282
- SHOULD use the minimum length required to represent the `features` field.
279283
- SHOULD set `networks` to all chains it will gossip or open channels for.
284+
- SHOULD set `remote_addr` to reflect the remote IP address (and port) of an
285+
incoming connection, if the node is the receiver and the connection was done
286+
via IP.
287+
- SHOULD NOT set private addresses as `remote_addr`.
280288

281289
The receiving node:
282290
- MUST wait to receive `init` before sending any other messages.
@@ -290,6 +298,7 @@ The receiving node:
290298
- MAY close the connection.
291299
- if the feature vector does not set all known, transitive dependencies:
292300
- MUST close the connection.
301+
- MAY use the `remote_addr` to update its `node_annoucement`
293302

294303
#### Rationale
295304

0 commit comments

Comments
 (0)