Flow

Core Concepts

How Pilot Protocol addresses, transports, encrypts, traverses NATs, and establishes trust.

Addressing

Every agent on the network gets a 48-bit virtual address with two parts: a 16-bit network prefix and a 32-bit node address.

Addresses are displayed in hex format: N:NNNN.HHHH.LLLL

Examples:

Agents can also register hostnames - human-readable names like my-agent. Most commands accept either an address or a hostname. If you don't set one, the node simply has no hostname (empty) and is addressed by its virtual address; you can set a hostname later with pilotctl set-hostname.

Special addresses

Transport

Pilot Protocol provides reliable streams (TCP-equivalent) over UDP tunnels. The transport layer includes:

The transport also supports datagrams - unreliable, unordered messages for scenarios where reliability isn't needed.

Connection lifecycle

Encryption

Traffic is encrypted by default. The encryption stack:

Every node has a persistent Ed25519 identity keypair stored at ~/.pilot/identity.json. The public key is registered with the registry and used for trust handshake signing.

Two coordination services exist: the registry (address assignment, key storage, hostname lookup — its binary is named rendezvous, and docs use the two names interchangeably) and the beacon (STUN discovery, NAT hole-punching, relay fallback). Data flows peer-to-peer on the direct path; when a direct path isn't possible, the beacon relays the (still-encrypted) traffic. Self-hosted deployments run their own rendezvous.

NAT Traversal

The daemon automatically discovers its public endpoint and handles NAT traversal:

  1. STUN discovery - the daemon queries the beacon server to learn its public IP and port
  2. Direct connection - for Full Cone NATs, the STUN-discovered endpoint works for all peers
  3. Hole-punching - for Restricted/Port-Restricted Cone NATs, the beacon coordinates simultaneous UDP packets from both peers to punch through the NAT
  4. Relay fallback - for Symmetric NATs (where each destination gets a different port mapping), traffic is relayed through the beacon server

The fallback ladder (direct → hole-punch → relay) is automatic; the daemon does not classify the NAT type. Cloud VMs with static IPs can skip STUN with the --endpoint host:port flag.

Trust Model

Agents are private by default at the application connectivity layer: open directory lookups withhold private endpoints, and private nodes reject incoming application streams and datagrams unless peer trust or shared-network membership grants access. Directory metadata such as hostname, tags, or network membership can remain visible depending on registry and network configuration. Optional strict deployment controls extend authorization to pre-connection key exchange, private directory operations, and NAT-punch requests.

The trust flow:

  1. Agent A sends a handshake request to Agent B (with a justification message)
  2. The request is relayed through the registry (signed with Ed25519)
  3. Agent B sees the request in pending and can approve or reject it
  4. Once both sides trust each other, they can communicate directly

Auto-approval: if both agents independently send handshake requests to each other, trust is established automatically - no manual approval needed.

Trust persists across daemon restarts. You can revoke trust at any time with untrust.

Well-known Ports

PortServiceDescription
7EchoLiveness probes, latency measurement, throughput benchmarks
53NameserverDNS-style hostname resolution
80HTTPWeb endpoints (use with the gateway)
443Secure service conventionUses the same tunnel encryption applied to all ports today
444HandshakeTrust negotiation protocol
1000StdioText streams between agents (default for connect)
1001Data ExchangeTyped frames: text, JSON, binary, file transfer
1002Event StreamPub/sub broker with topic filtering and wildcards
1003VerifyVerified-identity service (used by pilotctl verify)