Rename the --transport n0 value to relay and say what n0 means

"n0" is Number 0, the company behind iroh, and the name leaked from iroh's
own preset into this project's user interface, where it explains nothing.
The value is now --transport relay, which says what it does; n0 stays as an
accepted alias.

Also spells out, in the CLI help, the README, the threat model and the
TransportPolicy docs, whose infrastructure is involved: address records are
published to and resolved from dns.iroh.link, and the fallback relays are
Number 0's, in the US, EU and Asia-Pacific.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
tsunagi
2026-09-21 12:17:01 +01:00
co-authored by Claude Opus 5
parent 5cc92d7067
commit fae62892e0
4 changed files with 35 additions and 24 deletions
+10 -9
View File
@@ -100,8 +100,8 @@ wireguard: tsunkkcp43lmdje on fd15:1d9e:fa21:f201:…/64 mtu 1100, 1/1 tunnel(s)
Notes: Notes:
- Only one side needs `--peer`; the link is bidirectional. - Only one side needs `--peer`; the link is bidirectional.
- The default `--transport n0` uses iroh's public address lookup and relays, so - The default `--transport relay` uses iroh's public address lookup and relays,
two machines behind NAT find each other. `--transport local` keeps everything so two machines behind NAT find each other. `--transport local` keeps everything
on the local network. See *How peers find each other* below — it is worth on the local network. See *How peers find each other* below — it is worth
understanding what gets published. understanding what gets published.
- Without `CAP_NET_ADMIN`, add `--no-tun`: the mesh, the data links and the - Without `CAP_NET_ADMIN`, add `--no-tun`: the mesh, the data links and the
@@ -184,10 +184,10 @@ explicitly.
Two different lookups are involved, and only one of them is this project's: Two different lookups are involved, and only one of them is this project's:
**1. Resolving one endpoint's address — iroh's, and it works today.** **1. Resolving one endpoint's address — iroh's, and it works today.**
With `--transport n0` or `--transport direct`, iroh publishes a signed record With `--transport relay` or `--transport direct`, iroh publishes a signed
of this endpoint's addresses, keyed by its endpoint id, to Number 0's public record of this endpoint's addresses, keyed by its endpoint id, to the public
service (`dns.iroh.link`, over pkarr and DNS) and resolves other endpoints the service run by Number 0 — "n0", the company behind iroh — at `dns.iroh.link`,
same way. That is why `--peer <endpoint-id>` works with no address attached: over pkarr and DNS, and resolves other endpoints the same way. That is why `--peer <endpoint-id>` works with no address attached:
iroh looks it up. None of that code is ours. iroh looks it up. None of that code is ours.
**2. Finding who is in a network — ours, and it is still manual.** **2. Finding who is in a network — ours, and it is still manual.**
@@ -200,12 +200,13 @@ whatever those agents reach.
What this means in practice: What this means in practice:
- With `n0` or `direct`, **your endpoint id and IP addresses are published to a - With `relay` or `direct`, **your endpoint id and IP addresses are published
public third-party service.** They are not secret, and the network secret is to a public third-party service** (Number 0's, unless you change it). They are not secret, and the network secret is
never published, but an observer of that service learns that your endpoint never published, but an observer of that service learns that your endpoint
exists and where it is. `--transport local` publishes nothing. exists and where it is. `--transport local` publishes nothing.
- A relay, when one is needed, sees the volume and timing of your traffic — not - A relay, when one is needed, sees the volume and timing of your traffic — not
its contents. its contents. The default relays are Number 0's, in the US, EU and
Asia-Pacific.
## Storage ## Storage
+3 -2
View File
@@ -43,8 +43,9 @@ Read this before relying on anything here. The protocol is in
handshake. Use `NetworkSecret::generate()`. handshake. Use `NetworkSecret::generate()`.
- **Public address publication.** With `TransportPolicy::N0Defaults` or - **Public address publication.** With `TransportPolicy::N0Defaults` or
`DirectOnly`, iroh publishes a signed record of this endpoint's addresses, `DirectOnly`, iroh publishes a signed record of this endpoint's addresses,
keyed by its endpoint id, to Number 0's public pkarr/DNS service, and keyed by its endpoint id, to the public pkarr/DNS service run by Number 0
resolves peers through it. The network secret is never published and ("n0", the company behind iroh) at `dns.iroh.link`, and resolves peers
through it. The network secret is never published and
membership cannot be inferred from a single record, but the endpoint's membership cannot be inferred from a single record, but the endpoint's
existence and its addresses become public. `LocalOnly` publishes nothing. existence and its addresses become public. `LocalOnly` publishes nothing.
- **Addresses and metadata are observable.** Anyone able to watch the network - **Addresses and metadata are observable.** Anyone able to watch the network
+10 -8
View File
@@ -72,17 +72,19 @@ impl PathArgs {
/// How much external connectivity machinery the endpoint may use. /// How much external connectivity machinery the endpoint may use.
/// ///
/// `direct` and `n0` publish this endpoint's addresses, keyed by its endpoint /// `direct` and `relay` publish this endpoint's addresses, keyed by its
/// id, to Number 0's public lookup service, and resolve peers through it. /// endpoint id, to the public lookup service run by Number 0 — the company
/// That is what makes `--peer <endpoint-id>` work without an address. /// behind iroh — at `dns.iroh.link`, and resolve peers through it. That is
/// what makes `--peer <endpoint-id>` work without an address.
#[derive(Debug, Clone, Copy, ValueEnum)] #[derive(Debug, Clone, Copy, ValueEnum)]
enum Transport { enum Transport {
/// Loopback and the local network only. Publishes nothing. /// Loopback and the local network only. Publishes nothing.
Local, Local,
/// Public address lookup, but no relays. /// Public address lookup, direct paths only, no relays.
Direct, Direct,
/// iroh's defaults: public address lookup plus the public n0 relays. /// Public address lookup plus public relay fallback. The default.
N0, #[value(alias = "n0")]
Relay,
} }
impl From<Transport> for TransportPolicy { impl From<Transport> for TransportPolicy {
@@ -90,7 +92,7 @@ impl From<Transport> for TransportPolicy {
match value { match value {
Transport::Local => TransportPolicy::LocalOnly, Transport::Local => TransportPolicy::LocalOnly,
Transport::Direct => TransportPolicy::DirectOnly, Transport::Direct => TransportPolicy::DirectOnly,
Transport::N0 => TransportPolicy::N0Defaults, Transport::Relay => TransportPolicy::N0Defaults,
} }
} }
} }
@@ -122,7 +124,7 @@ struct UpArgs {
hostname: Option<String>, hostname: Option<String>,
/// How much external connectivity to use. /// How much external connectivity to use.
#[arg(long, value_enum, default_value_t = Transport::N0)] #[arg(long, value_enum, default_value_t = Transport::Relay)]
transport: Transport, transport: Transport,
/// A peer to contact, as `<endpoint-id>` or `<endpoint-id>@<ip:port>,...`. /// A peer to contact, as `<endpoint-id>` or `<endpoint-id>@<ip:port>,...`.
+12 -5
View File
@@ -89,12 +89,19 @@ pub enum TransportPolicy {
/// Suitable for tests and for fully local deployments. /// Suitable for tests and for fully local deployments.
#[default] #[default]
LocalOnly, LocalOnly,
/// No relays, but the n0 DNS/pkarr address lookup is enabled. /// Public address lookup, but no relays.
DirectOnly,
/// iroh's standard behaviour, including the public n0 relays.
/// ///
/// Public relays are fine for development; they carry no availability /// Enables iroh's DNS/pkarr address lookup against the public service run
/// guarantee. /// by Number 0 (the company behind iroh) at `dns.iroh.link`. This endpoint
/// publishes a signed record of its own addresses there, so peers can dial
/// it by endpoint id alone.
DirectOnly,
/// iroh's standard behaviour: public address lookup plus public relays.
///
/// Maps to iroh's own `presets::N0`. As well as the address lookup above,
/// it uses Number 0's public relay servers as a fallback when a direct
/// path cannot be hole punched. They are fine for development and carry no
/// availability guarantee.
N0Defaults, N0Defaults,
} }