<metaname="description"content="Abstract # 33/WAKU2-DISCV5 specifies a modified version of Ethereum’s Node Discovery Protocol v5 as a means for ambient node discovery. 10/WAKU2 uses the 33/WAKU2-DISCV5 ambient node discovery network for establishing a decentralized network of interconnected Waku2 nodes. In its current version, the 33/WAKU2-DISCV5 discovery network is isolated from the Ethereum Discovery v5 network. Isolation improves discovery efficiency, which is especially significant with a low number of Waku nodes compared to the total number of Ethereum nodes.">
<metaproperty="og:description"content="Abstract # 33/WAKU2-DISCV5 specifies a modified version of Ethereum’s Node Discovery Protocol v5 as a means for ambient node discovery. 10/WAKU2 uses the 33/WAKU2-DISCV5 ambient node discovery network for establishing a decentralized network of interconnected Waku2 nodes. In its current version, the 33/WAKU2-DISCV5 discovery network is isolated from the Ethereum Discovery v5 network. Isolation improves discovery efficiency, which is especially significant with a low number of Waku nodes compared to the total number of Ethereum nodes."/>
<li>Editor: Daniel Kaiser <ahref="mailto:danielkaiser@status.im">danielkaiser@status.im</a></li>
</ul><h1id="abstract">
Abstract
<aclass="anchor"href="#abstract">#</a>
</h1>
<p><code>33/WAKU2-DISCV5</code> specifies a modified version of <ahref="https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md">Ethereum’s Node Discovery Protocol v5</a> as a means for ambient node discovery.
<ahref="/specs/10">10/WAKU2</a> uses the <code>33/WAKU2-DISCV5</code> ambient node discovery network for establishing a decentralized network of interconnected Waku2 nodes.
In its current version, the <code>33/WAKU2-DISCV5</code> discovery network is isolated from the Ethereum Discovery v5 network.
Isolation improves discovery efficiency, which is especially significant with a low number of Waku nodes compared to the total number of Ethereum nodes.</p>
<h1id="disclaimer">
Disclaimer
<aclass="anchor"href="#disclaimer">#</a>
</h1>
<p>This version of <code>33/WAKU2-DISCV5</code> has a focus on timely deployment of an efficient discovery method for <ahref="/specs/10">10/WAKU2</a>.
Establishing a separate discovery network is in line with this focus.
However, we are aware of potential resilience problems (see section on security considerations) and are <ahref="https://forum.vac.dev/t/waku-v2-discv5-roadmap-discussion/121/8">discussing</a>
<p><ahref="/specs/11">11/WAKU2-RELAY</a> assumes the existence of a network of Waku2 nodes.
For establishing and growing this network, new nodes trying to join the Waku2 network need a means of discovering nodes within the network.
<ahref="/specs/10">10/WAKU2</a> supports the following discovery methods in order of increasing decentralization</p>
<ul>
<li>hard coded bootstrap nodes</li>
<li><ahref="https://rfc.vac.dev/spec/10/#discovery-domain"><code>DNS discovery</code></a> (based on <ahref="https://eips.ethereum.org/EIPS/eip-1459">EIP-1459</a>)</li>
<li><code>peer-exchange</code> (work in progress)</li>
<li><code>33/WAKU2-DISCV5</code> (specified in this document)</li>
</ul>
<p>The purpose of ambient node discovery within <ahref="/specs/10">10/WAKU2</a> is discovering Waku2 nodes in a decentralized way.
The unique selling point of <code>33/WAKU2-DISCV5</code> is its holistic view of the network, which allows avoiding hotspots and allows merging the network after a split.
While the other methods provide either a fixed or local set of nodes, <code>33/WAKU2-DISCV5</code> can provide a random sample of Waku2 nodes.
Future iterations of this document will add the possibility of efficiently discovering Waku2 nodes that have certain capabilities, e.g. holding messages of a certain time frame during which the querying node was offline.</p>
<p><code>33/WAKU2-DISCV5</code> spans an overlay network separate from the <ahref="https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/README.md">GossipSub</a> network <ahref="/specs/11">11/WAKU2-RELAY</a> builds on.
Because it is a P2P network on its own, it also depends on bootstrap nodes.
Having a separate discovery network reduces load on the bootstrap nodes, because the actual work is done by randomly discovered nodes.
<p><code>33/WAKU2-DISCV5</code> spans a discovery network isolated from the Ethereum Discovery v5 network.</p>
<p>Another simple solution would be taking part in the Ethereum Discovery network, and filtering Waku nodes based on whether they support <ahref="/specs/31">31/WAKU2-ENR</a>.
This solution is more resilient towards eclipse attacks.
However, this discovery method is very inefficient for small percentages of Waku nodes (see <ahref="https://forum.vac.dev/t/waku-v2-discv5-roadmap-discussion/121/8">estimation</a>).
It boils down to random walk discovery and does not offer a O(log(n)) hop bound.
The rarer the requested property (in this case Waku), the longer a random walk will take until finding an appropriate node, which leads to a needle-in-the-haystack problem.
Using a dedicated Waku2 discovery network, nodes can query this discovery network for a random set of nodes
and all (well-behaving) returned nodes can serve as bootstrap nodes for other Waku2 protocols.</p>
<p>A more sophisticated solution would be using <ahref="https://github.com/ethereum/devp2p/blob/master/discv5/discv5-theory.md#topic-advertisement">Discv5 topic discovery</a>.
However, in its current state it also has efficiency problems for small percentages of Waku nodes and is still in the design phase (<ahref="https://github.com/ethereum/devp2p/issues/199">see here</a>).</p>
<p>Currently, the Ethereum discv5 network is very efficient in finding other discv5 nodes,
but it is not so efficient for finding discv5 nodes that have a specific property or offer specific services, e.g. Waku.</p>
<p>As part of our <ahref="https://forum.vac.dev/t/waku-v2-discv5-roadmap-discussion/121">discv5 roadmap</a>, we consider two ideas for future versions of <code>33/WAKU2-DISCV5</code></p>
<ul>
<li><ahref="https://github.com/ethereum/devp2p/blob/master/discv5/discv5-theory.md#topic-advertisement">Discv5 topic discovery</a> with adjustments (ideally upstream)</li>
<li>a hybrid solution that uses both a separate discv5 network and a Waku-ENR-filtered Ethereum discv5 network</li>
</ul>
<h1id="semantics">
Semantics
<aclass="anchor"href="#semantics">#</a>
</h1>
<p><code>33/WAKU2-DISCV5</code> fully inherits the <ahref="https://github.com/ethereum/devp2p/blob/master/discv5/discv5-theory.md">discv5 semantics</a>.</p>
<p><code>33/WAKU2-DISCV5</code> inherits the <ahref="https://github.com/ethereum/devp2p/blob/master/discv5/discv5-wire.md">discv5 wire protocol</a> except for the following differences</p>
<li>can be augmented to make the <code>protocol-id</code> selectable using a compile-time flag as in <ahref="https://github.com/kaiserd/nim-eth/blob/add-selectable-protocol-id-static/eth/p2p/discoveryv5/encoding.nim#L34">this feature branch</a> of nim-eth/discv5.</li>
<li>can be forked followed by changing the <code>protocol-id</code> string as in <ahref="https://github.com/status-im/go-waku/blob/master/waku/v2/discv5/discover.go#L135-L137">go-waku</a>.</li>
<p>Implementations should limit the number of bucket entries that have the same network parameters (IP address / port) to mitigate Sybil attacks.</p>
<h2id="eclipse-attack">
Eclipse attack
<aclass="anchor"href="#eclipse-attack">#</a>
</h2>
<p>Eclipse attacks aim to eclipse certain regions in a DHT.
Malicious nodes provide false routing information for certain target regions.
The larger the desired eclipsed region, the more resources (i.e. controlled nodes) the attacker needs.
This introduces an efficiency versus resilience tradeoff.
Discovery is more efficient if information about target objects (e.g. network parameters of nodes supporting Waku) are closer to a specific DHT address.
If nodes providing specific information are closer to each other, they cover a smaller range in the DHT and are easier to eclipse.</p>
<p>Sybil attacks greatly increase the power of eclipse attacks, because they significantly reduce resources necessary to mount a successful eclipse attack.</p>
<p>A dedicated Waku discovery network is more likely to be subject to successful eclipse attacks (and to DoS attacks in general).
This is because eclipsing in a smaller network requires less resources for the attacker.
DoS attacks render the whole network unusable if the percentage of attacker nodes is sufficient.</p>
<p>Using random walk discovery would mitigate eclipse attacks targeted at specific capabilities, e.g. Waku.
However, this is because eclipse attacks aim at the DHT overlay structure, which is not used by random walks.
So, this mitigation would come at the cost of giving up overlay routing efficiency.
The efficiency loss is especially severe with a relatively small number of Waku nodes.</p>
<p>Properly protecting against eclipse attacks is challenging and raises research questions that we will address in future stages of our discv5 roadmap.</p>