Skip to content

Commit c209245

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 8f2104e commit c209245

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

01-messaging.md

Lines changed: 8 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,9 @@ 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. IP addresses within private networks (RFC-1918) MUST not be used.
280287

281288
The receiving node:
282289
- MUST wait to receive `init` before sending any other messages.
@@ -290,6 +297,7 @@ The receiving node:
290297
- MAY fail the connection.
291298
- if the feature vector does not set all known, transitive dependencies:
292299
- MUST fail the connection.
300+
- MAY use the `remote_addr` to update its `node_annoucement`
293301

294302
#### Rationale
295303

0 commit comments

Comments
 (0)