#3535·iroh

Custom validation of node IDs prior to establishing direct connections

Author: TapGhoulCreated Oct 14, 2025Updated Sep 14, 2026
LabelsNAT Traversalc-irohprivacyroadmap

In the current implementation, as far as I can tell, you cannot see the NodeId or anything about the remote certificate prior to establishing a connection, or more importantly, passing the direct IP info to the remote. For certain applications, it is undesirable to reveal any native IP address until the remote node can be validated in some way. Unfortunately, it seems like the direct address is sent immediately.

It would be good to provide some way to hold back sending direct addresses until some validation has occurred. For example, providing the NodeId within Incoming, or more likely, Connecting on the incoming side (as I'm not sure Incoming has enough info yet).

Alternatively, an option in either Connecting or Incoming::accept_with() to defer sending direct addresses through MagicSock, and then some way to allow direct addresses to be sent once a full connection has been established (ideally with an interface that discourages using this functionality to prevent ever establishing a direct connection to try and prevent unnecessary load on relay servers) - though ideally being able to reject the connection without having to disable this functionality in order to be able to validate the NodeId would be ideal.

The main issue here being people who need to not have their IP addresses revealed as they are targeted by DDoS attacks during sensitive times (p2p game instances, livestreamers, etc) and wish to use Iroh for easy p2p comms for mesh connection style comms, or otherwise need to not be able to be trivially reached without some kind of confirmation prompt. The main concern here is the DHT, as while enumerating the standard n0 resolvers requires a lot of manual requests, you can sniff for activity on the DHT to find currently active nodes, which reduces the search space. While direct IPs aren't listed on it (by default), there is no way to prevent discovering the direct IP at the moment with any more complex application-level authentication.

While this can be avoided by just not using the built-in discovery at all, I feel like this somewhat defeats the purpose of having Iroh - the ease of establishing connectivity is one of the primary draws of Iroh in my opinion.