EIP-1459 DNS-based node list discovery (Node Discovery via DNS)

No call decision · Networking & nodes · EIP status Stagnant · created 2018-09-26

Defines a frequently updatable node list scheme in which the list of bootstrap nodes hardcoded into clients is instead distributed via DNS and verified with a signature.

Why it is needed

Ethereum clients today hardcode a list of bootstrap nodes inside the software. Changing this list requires updating the client itself, and because the list is small, there are few entry points available when first joining the network. Operators want to maintain large node lists, on the order of hundreds, gathered by crawling the discovery DHT, and to update them regularly, but the current approach does not allow that. DNS is accessible even in restricted network environments such as behind firewalls, has low latency, lets intermediate resolvers cache responses to reduce load, and can be hosted on existing DNS providers without separate server software. For these reasons, a signed, updatable node list scheme built on top of DNS replaces the hardcoded list.

What changes

Today

After EIP-1459

Who is affected

In depth

enrtree URL structure

A URL pointing to a node list uses the enrtree:// scheme, with the secp256k1 public key that signed the list (the compressed 32-byte public key encoded in RFC-4648 base32) in the username portion, followed by the DNS name where the list resides. Example: enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org

Root TXT record

The root of the tree is a TXT record of the form 'enrtree-root:v1 e=<enr-root> l=<link-root> seq=<sequence-number> sig=<signature>'. enr-root and link-root are the root hashes of the node subtree and the link subtree respectively, seq is a decimal update sequence number, and sig is a 65-byte secp256k1 signature, encoded as URL-safe base64, over the keccak256 hash of the record content excluding the sig= part.

Three node types: branch and two kinds of leaves

A subdomain name is the base32 encoding of the (truncated) keccak256 hash of the corresponding text content. enrtree-branch:<h1>,<h2>,...,<hn> is an intermediate node holding a list of child subtree hashes, enrtree://<key>@<fqdn> is a link leaf pointing to another list (appearing only in the link-root subtree), and enr:<node-record> is a leaf holding an ENR encoded as URL-safe base64 (appearing only in the enr-root subtree).

Client discovery procedure

The client reads the root TXT record for the target name, verifies the signature and seq, then looks up the subdomain for the enr-root hash and checks that its content matches the hash. If it is enrtree-branch, it continues looking up the listed hashes the same way, and if it is an enr entry, it decodes it and adds it to the local node store. During traversal, it must track hashes/domains already processed to prevent infinite loops; traversing in random order is advantageous for the client, and under normal operation it is preferable to query DNS as needed rather than downloading the entire tree at once.

Why DNS was chosen

DNS is always accessible even under restrictive network conditions, has low latency, and lets intermediate resolvers cache responses to reduce load. It needs no separate server software, and lists can be distributed using client libraries from common DNS providers such as CloudFlare DNS, dnsimple, and Amazon Route 53.

Why use a merkle tree structure

Because it is a merkle tree, a single signature over the root can authenticate the entire list, and hashed subdomains preserve the integrity of each entry, so an intermediate resolver can block access or refuse to serve updates but cannot tamper with the content. The seq number prevents rollback to an older root. Individual entries in the tree are small enough to fit in a single UDP DNS packet, and since only the root needs a short TTL while the rest of the entries can be cached for days, this works well with caching resolvers.

Purpose and security limits of the link subtree

The link subtree references other lists to provide federation and web-of-trust functionality. An operator running a large list can delegate maintenance to another list provider, and if two lists link to each other, using either one gives you nodes from both. The link tree is kept separate from the ENR tree, so clients can sync them independently. That said, discovery via DNS is less secure than via a DHT, since it depends on a trusted party publishing the list periodically. If that party publishes only node records it controls, it can easily eclipse bootstrap nodes. This EIP's status is Stagnant and it requires EIP-778 (ENR), so possible changes before adoption should be kept in mind.

Original EIP · ← EIPs