You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: standards/core/rendezvous.md
+41-34Lines changed: 41 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,11 @@ It supplements Discovery v5 and Waku peer exchange.
15
15
16
16
## Background and Rationale
17
17
18
-
Waku nodes need a discovery mechanism that is both rapid and robust against attacks. Rendezvous enables quick identification of relevant peers, complementing slower but more resilient approaches like Discv5. For healthy network participation, nodes must connect to a diverse set of peers. However, the rendezvous protocol is vulnerable to denial of service attacks and depends on centralized rendezvous points, so it is best used in conjunction with other discovery methods such as Discv5.
19
-
20
-
Ethereum Node Record (ENR) size constraints make it impractical to encode additional metadata, such as Mix public keys, in ENRs for Discv5-based discovery. Rendezvous, using a custom peer record (`WakuPeerRecord`), allows nodes to advertise Mix-specific information—including the Mix public key—without being restricted by ENR size. This serves as an interim solution until a comprehensive capability discovery mechanism is available.
18
+
Waku needs discovery mechanism(s) that are both rapid and robust against attacks.
19
+
Fully centralised discovery (such as DNS lookup) may be fast but is not secure.
20
+
Fully decentralised discovery (such as discv5) may be robust, but too slow for some bootstrapping use cases
21
+
Rendezvous provides a limited, balanced solution that trades off some robustness for speed.
22
+
It's meant to complement not replaced fully decentralised discovery mechanisms, like discv5
21
23
22
24
By combining rendezvous with
23
25
[Discv5](https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md#node-discovery-protocol-v5) and
@@ -34,9 +36,41 @@ This allows nodes to advertise additional Waku-specific metadata beyond what is
Nodes advertise their information through `WakuPeerRecord`, a custom peer record structure designed for Waku rendezvous.
42
+
Since this is a customPeerRecord, we define a private multicodec value of `0x300000` as per [multicodec table](https://github.com/multiformats/multicodec/blob/master/table.csv).
43
+
The `WakuPeerRecord` is defined as follows:
44
+
45
+
**WakuPeerRecord fields:**
46
+
47
+
-`peer_id`: The libp2p PeerId of the node.
48
+
-`seqNo`: The time at which the record was created or last updated (Unix epoch, seconds).
49
+
-`multiaddrs`: A list of multiaddresses for connectivity.
50
+
-`mix_public_key`: The Mix protocol public key (only present for nodes supporting Mix).
51
+
52
+
**Encoding:**
53
+
WakuPeerRecord is encoded as a protobuf message. The exact schema is:
54
+
55
+
```protobuf
56
+
message WakuPeerRecord {
57
+
string peer_id = 1;
58
+
uint64 seqNo = 2;
59
+
repeated string multiaddrs = 3;
60
+
optional bytes mix_public_key = 4;
61
+
}
62
+
```
63
+
64
+
When a node discovers peers through rendezvous, it receives the complete `WakuPeerRecord` for each peer, allowing it to make informed decisions about which peers to connect to based on their advertised information.
65
+
37
66
### Namespace Format
38
67
39
-
The namespaces used to register and request MUST be in the format `rs/<cluster-id>/<capability>`.
68
+
The [rendezvous namespaces](https://github.com/libp2p/specs/blob/69c4fdf5da3a07d2f392df6a892c07256c1885c0/rendezvous/README.md#the-protocol) used to register and request peer records
69
+
MUST be in the format `rs/<cluster-id>/<capability>`.
70
+
`<capability>` is a string representing the individual capability for which a discoverable Waku peer record is registered.
71
+
The Waku peer record is separately registered against each capability for which discovery is desired.
72
+
The only defined capability for now is `mix`, representing [Waku Mix](https://github.com/waku-org/specs/blob/master/standards/core/mix.md) support.
73
+
For example, a Waku peer record for a node supporting mix protocol in cluster `1` will be registered against a namespace: `rs/1/mix`.
40
74
41
75
This allows for discovering peers with specific capabilities within a given cluster.
42
76
Currently, this is used for Mix protocol discovery where the capability field specifies `mix`.
@@ -49,11 +83,11 @@ Every [Waku Relay](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/
49
83
50
84
Each relay node that participates in discovery
51
85
MUST register with random rendezvous points at regular intervals.
52
-
53
-
All relay nodes participating in rendezvous discovery SHOULD advertise their information using `WakuPeerRecord`. For nodes supporting the Mix protocol, the `mix_public_key` field MUST be included. For non-Mix relay nodes, the `mix_public_key` field SHOULD be omitted. The standard libp2p PeerRecord is not used for Waku rendezvous; all advertised records MUST conform to the `WakuPeerRecord` definition.
54
-
55
86
The RECOMMENDED registration interval is 10 seconds.
56
87
88
+
All relay nodes participating in rendezvous discovery SHOULD advertise their information using `WakuPeerRecord`. For nodes supporting the Mix protocol, the `mix_public_key` field MUST be included.
89
+
All advertised records MUST conform to the `WakuPeerRecord` definition.
90
+
57
91
It is RECOMMENDED that rendezvous points expire registrations after 1 minute (60 seconds TTL)
58
92
to keep discovered peer records limited to those recently online.
59
93
@@ -64,33 +98,6 @@ It is RECOMMENDED a maximum of 12 peers be requested each time.
64
98
This number is sufficient for good GossipSub connectivity and
65
99
minimizes the load on rendezvous points.
66
100
67
-
### Peer Records
68
-
69
-
Nodes advertise their information through `WakuPeerRecord`, a custom peer record structure designed for Waku rendezvous.
70
-
Since this is a customPeerRecord, it uses a private multicodec value of `0x300000` as per [multicodec table](https://github.com/multiformats/multicodec/blob/master/table.csv).
71
-
The `WakuPeerRecord` is defined as follows:
72
-
73
-
**WakuPeerRecord fields:**
74
-
75
-
-`peer_id`: The libp2p PeerId of the node.
76
-
-`seqNo`: The time at which the record was created or last updated (Unix epoch, seconds).
77
-
-`multiaddrs`: A list of multiaddresses for connectivity.
78
-
-`mix_public_key`: The Mix protocol public key (only present for nodes supporting Mix).
79
-
80
-
**Encoding:**
81
-
WakuPeerRecord is encoded as a protobuf message. The exact schema is:
82
-
83
-
```protobuf
84
-
message WakuPeerRecord {
85
-
string peer_id = 1;
86
-
uint64 seqNo = 2;
87
-
repeated string multiaddrs = 3;
88
-
optional bytes mix_public_key = 4;
89
-
}
90
-
```
91
-
92
-
When a node discovers peers through rendezvous, it receives the complete `WakuPeerRecord` for each peer, allowing it to make informed decisions about which peers to connect to based on their advertised information.
93
-
94
101
### Operational Recommendations
95
102
96
103
It is RECOMMENDED that bootstrap nodes participate in rendezvous discovery and
0 commit comments