nim-waku has recently implemented EIP-1459 for peer discovery.
In short, EIP-1459 proposes a method to store and traverse a tree of peer records stored in DNS TXT entries for bootstraping purposes. Given a single
enrtree url, one can retrieve connection information for a large list of nodes.
All entries are signed by a public key, which is provided as part of the
Link entries allows pointing to other domain name allowing discovery of further peers listed by different authorities.
EIP-1459 uses EIP-778 to encode peer information.
EIP-778 enables the encoding of arbitrary key/value peers, with the following keys having predefined meanings:
In a browser environment, it is not possible to directly connect to TCP or UDP ports.
Currently, js-waku only support websocket (
ws) connections. Other methods such as QUIC are being considered but not yet available.
Moreover, modern browsers only allow connections to a secure websocket (
wss) within a secure context (
https). For waku nodes to be reachable via wss they need to provide an SSL connection and hence setup a SSL certificate.
Modern browser accept both self-signed ip certificates and domain certificates signed by pre-defined root CA.
Also, websocket connections run over TCP as they initiate with an HTTP Upgrade.
This means that it is not possible to define peers reachable by a web app only using the keys predefined by EIP-778.
I propose to define the following keys to be used in EIP-778 entry for Waku EIP-1459 usage:
|Key||Value Type||Value Length||Value Description|
||Max 253 Bytes ||Fully Qualified Domain Name of the node, SHOULD be used in favor of
||-||secure websocket port|
||-||IPv6 specific secure websocket port|
wsis not proposed as it has little practical value,
wssshould be preferred for all http content.
- EIP-778 defines that
The maximum encoded size of a node record is 300 bytes.. This should be kept in mind when encoding long FQDN.
- See  regarding FQDN length, note that the max length is noted in characters which is not equivalent to Bytes since the introduction of utf-8 domains.
- I could not find if any other application already use such keys (or similar) with EIP-778. I will do further investigation and update this post.
The maximum number of octets is a label is 63. RFC1035.
The maximum number of octets in a domain name is 255 octets. RFC1035
The maximum length of a fqdn, not a hostname, is 1004 characters. RFC1035
The maximum length of a full qualified hostname is 253 characters. Imputed from RFC952, RFC1123 and RFC1035.