Skip to content

Commit a152559

Browse files
committed
blip-0043: Alternative Addresses
Signed-off-by: Max Rantil <[email protected]>
1 parent 9a1bd0a commit a152559

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ For more detail on the process, please read [bLIP-0001](./blip-0001.md) and
2828
| [17](./blip-0017.md) | Hosted Channels | Anton Kumaigorodskiy | Active |
2929
| [25](./blip-0025.md) | Forward less than onion value | Valentine Wallace | Active |
3030
| [32](./blip-0032.md) | Onion Message DNS Resolution | Matt Corallo | Active |
31-
31+
| [43](./blip-0043.md) | Alternative Addresses | Max Rantil | Active |

blip-0043.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
```
2+
bLIP: 43
3+
Title: Alternative Addresses for Peer Connections
4+
Status: Active
5+
Author: Max Rantil <[email protected]>
6+
Created: 2024-08-31
7+
License: CC0
8+
```
9+
10+
## Abstract
11+
12+
The `alt_addr` message introduces a mechanism for nodes to specify private alternative connection addresses for peers. These addresses facilitate reconnections between nodes with an existing relationship, bypassing the public gossip protocol. This allows peers with an established channel or history to use alternative addresses for improved privacy, reliability, or latency.
13+
14+
## Copyright
15+
16+
This bLIP is licensed under the CC0 license.
17+
18+
## Motivation
19+
20+
The primary motivations for introducing alternative addresses are:
21+
22+
- Enhanced privacy: By allowing peers to use private addresses not disclosed in the public network, the risk of traffic analysis is reduced.
23+
- Improved reliability: Alternative addresses can provide fallback options if the primary address becomes unreachable.
24+
- Potential latency improvements: Private addresses might offer more direct or optimized network paths between peers.
25+
- Greater control: Nodes can selectively share alternative addresses with trusted peers, maintaining public presence while offering improved connectivity to specific partners.
26+
27+
## Specification
28+
29+
### The `alt_addr` Message
30+
31+
1. **type**: 209 (`peer_alt_addr`)
32+
2. **data**:
33+
- [`channel_id`:`channel_id`]
34+
- [`u8`:`addr_len`]
35+
- [`addr_len*byte`:`addrs`]
36+
37+
The first byte describes the address type and is followed by the appropriate number of bytes for that type.
38+
39+
The following address descriptor types are defined:
40+
41+
* `1`: ipv4; data = `[4:ipv4_addr][2:port]` (length 6)
42+
* `2`: ipv6; data = `[16:ipv6_addr][2:port]` (length 18)
43+
* `3`: Deprecated (length 12). Used to contain Tor v2 onion services.
44+
* `4`: Tor v3 onion service; data = `[35:onion_addr][2:port]` (length 37)
45+
* version 3 ([prop224](https://gitweb.torproject.org/torspec.git/tree/proposals/224-rend-spec-ng.txt))
46+
onion service addresses; Encodes:
47+
`[32:32_byte_ed25519_pubkey] || [2:checksum] || [1:version]`, where
48+
`checksum = sha3(".onion checksum" || pubkey || version)[:2]`.
49+
* `5`: DNS hostname; data = `[1:hostname_len][hostname_len:hostname][2:port]` (length up to 258)
50+
* `hostname` bytes MUST be ASCII characters.
51+
* Non-ASCII characters MUST be encoded using Punycode:
52+
https://en.wikipedia.org/wiki/Punycode
53+
54+
### Requirements
55+
56+
#### Sending Node
57+
58+
- **SHOULD** send `alt_addr` when a new connection address is necessary for enhanced privacy or network performance.
59+
- **MAY** send an empty `addr` to clear any previously stored alternative addresses.
60+
- **MUST** store a record of the peers to whom it has sent its `alt_addr` for future verification.
61+
- **MUST** verify that an incoming connection attempt using `alt_addr` is from the specific peer to whom it has previously provided that exact address.
62+
- **MUST** reject connection attempts using `alt_addr` if it has not sent that specific `alt_addr` to the connecting peer.
63+
64+
#### Receiving Node
65+
66+
- **MUST** store the `alt_addr` in persistent storage upon successful validation.
67+
- **MUST** use the stored `alt_addr` when initiating a connection to the peer that provided it.
68+
- **MAY** continue using the original address until `alt_addr` is fully validated.
69+
70+
## Rationale
71+
72+
By allowing nodes to use private, alternative connection addresses, this proposal enables a more controlled and secure network environment, where peers can selectively manage who has access to their alternative addresses without exposing these addresses to the wider public network.
73+
74+
This feature also complements other address management features such as `alt-bind-addr` and `alt-announce-addr`, providing nodes with additional flexibility in how they present and manage their network addresses.
75+
76+
## Backwards Compatibility
77+
78+
This proposal does not affect backward compatibility as it introduces an optional message that nodes can choose to implement without impacting the existing protocol.

0 commit comments

Comments
 (0)