Transports
CapTP handles calls, promises, and handoffs between two peers. A transport, or netlayer, carries its bytes and determines how you reach the peer: encrypted QUIC, a sealed TCP stream, a Tor circuit, a browser DataChannel, or a cleartext testing socket.
How a peer is named
You reach a peer through an OCapN locator:
ocapn://<designator>.<transport>
The designator is the peer’s name for that transport:
- The keyed and sealed transports use an Ed25519 public key.
- iroh uses a node id.
- Onion uses a Tor service id.
- Plain
tcpuses ahost:portand is testing-only.
Optional hints can carry routing help, such as the bound address for a key-addressed listener, but a hint is never permission. Concepts covers locators and sturdyrefs (locators you can save and redeem later) in full.
What proves who answered
Every CapTP session signs its opening message (the hello) with a fresh key. That signature holds the handshake together but does not prove who the durable peer is. The channel has to supply that:
- On Noise, completing the handshake proves the dialed key.
- On iroh, the QUIC handshake authenticates the node id.
- On WebRTC, the signaling service vouches for which peer is on the DataChannel.
- On onion, Tor proves the dialed service.
A key written into a cleartext locator is only a dial target until one of these proves possession of it.
Picking one
On a cleartext transport, anyone on the path can read and alter the frames. Choosing a transport is the decision table. A browser that cannot open a raw socket uses the relay.
One program can listen on several of these at once, but a standard locator names one transport, so two listeners look like two peers. Multi-home peers is glowcap’s id locator: one durable key as the name, with the routes underneath it.