Skip to content

Design mill pass 2: iroh-native ID transport in fleet — identity, postcards, format conversion #10391

Open

Description

@dezren39

Parent design mill: #10389

Design mill pass 2: iroh-native ID transport in fleet — identity, postcards, format conversion

Part of the fleet-surface design mill (Drew, 2026-11-14). Parent issue cross-links all passes.

What to design

ID's native transport is iroh, which needs full iroh credentials and protocols — the one tool the plain pass-through of pass 1 cannot cover. Two levels:

Level 1: raw proxy

Fleet proxies raw input/output over an iroh connection without handling the payload. Also design the relay-aware variant: a proxy that uses iroh itself to do the transfer (not mere packet forwarding) while still requiring something on the far end that speaks the protocol.

Level 2: fleet as iroh initiator

Fleet fully handles the iroh connection and is the initiator:

  • Credentials: fleet handles the iroh credentials, or the caller provides a secret key. Default: fleet generates a random key per session as part of its ID stamp; the public key is attached to queue items it picks up and everywhere else the stamp goes, and stored in an environment variable when the stamp is dot-sourced. (This extends the context-propagation design in code#10357.)
  • Byte streaming: stream bytes from the caller in, and bytes back out on stdout/stderr-style streams.
  • Postcard-native mode: fleet targets the ID postcard shape and sends/receives postcard values directly — postcards in and out, one at a time, or wrapped for wire efficiency. Investigate postcard wire-format inefficiencies for large streams and file transfers; where it matters, convert: unwrap postcards from the iroh connection and re-encode as MessagePack or CBOR, and serve over WebSocket or WebTransport so web frontends/backends (including browsers) can connect.

Boundaries

  • The WebSocket/WebTransport + CBOR conversion SERVING side for ID apps belongs to the ID binary's REST mode (pass 3) — this pass covers fleet's client/initiator side and the wire handling. Where the two meet, design the seam once and reference it from both.
  • Fleet may launch the ID binary to handle a connection, or hit an ID-specific REST endpoint where one exists.

Acceptance

A design section naming: the identity/key lifecycle (generation, stamping, env var, storage), the raw-proxy vs initiator modes and when each is chosen, the postcard handling and the conditions for MessagePack/CBOR conversion, and the WebSocket/WebTransport serving shape on the fleet side.

Activity

  1. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 15, 2026

    @dezren39
    MemberAuthor

    Iroh probe 2 (2026-11-15): sandbox ↔ unmodified laptop iroh WORKS via own relay + a sandbox-side CONNECT shim

    Full report: ~/workspace/iroh-probe2-2026-11-15.md (probe 1: iroh-probe-2026-11-15.md).

    The wall, precisely characterized: every outbound TCP connection in the sandbox is transparently redirected to a CONNECT-only HTTP proxy (198.19.0.1:3128). Stock iroh's relay dialer starts TLS immediately and dies on the proxy's plain-HTTP response (tls connection failed: received corrupt message of type InvalidContentType). Resolution is not the blocker — iroh's resolver gets the A record via TCP-DNS fallback and selects the relay as home; the dial is what fails, for every destination (verified against both our relay and use1-1.relay.n0.iroh.link). Proxy env vars are irrelevant (identical failure with them unset — the redirect is in the network, not the env).

    Branch A (own relay, stock config both ends) — failed at the sandbox dial. Built anyway and left in place: stock iroh-relay v1.4.1 in --dev mode (plain HTTP :3340) on the laptop, behind the existing sandbox-link Cloudflare Tunnel as relay.security.cab (DNS + ingress added; production tunnels untouched). Reachable by normal clients (curl → 200). Access is OFF for this hostname — stock relay clients can't send Access headers; like n0's public relays it relies on endpoint-key authentication and end-to-end encryption (exposure = bandwidth abuse, noted).

    Branch B (resolver-only fix) — refuted by the Branch A/B dial evidence; no patch built.

    Branch C (CONNECT shim, sandbox side only) — WORKS, both directions, stock binaries everywhere:

    • Sandbox side: bind-mounted /etc/hosts maps relay.security.cab → 127.0.0.1 (iroh's resolver honors it; the advertised relay URL stays the real public one, so tickets are standard), plus a ~110-line Python shim on 127.0.0.1:443 that performs the CONNECT handshake to the platform proxy (credentials from env) and then splices bytes — TLS stays end-to-end (verified: real CN=security.cab Let's Encrypt cert through the shim). Client invoked with the stock --relay https://relay.security.cab knob.
    • sandbox → laptop, laptop on pure stock defaults: 4 MiB and 10 MiB, sha256-identical both sides.
    • laptop → sandbox, laptop homed on our relay via the stock --relay knob: 4 MiB, sha256-identical.
    • Control (pure defaults both ends, laptop initiates): fails — the sandbox can't dial the public relay named in a default ticket. Sandbox-initiated (the level-2 shape in this issue) needs nothing on the peer.
    • Speed: ≈0.23 MB/s incremental (10 MiB in 46.8 s wall incl. setup; relay RTT 184 ms) — Tailscale-relay class, fine for control/small payloads, not a bulk pipe.

    One-sided fix: the shim is needed only inside the CONNECT-only egress; after the handshake it hands iroh an ordinary connection, and relay + peers run stock code. In our own app this collapses to two library-level pieces (a CONNECT-capable relay dialer + a resolver override for the relay name) — no root, no /etc/hosts, no counterpart on other hosts.

    Left running: the laptop relay (daemon job, *:3340) + the relay.security.cab DNS/ingress; the sandbox shim is an unmanaged prototype process (dies with the sandbox). Test payloads/processes cleaned up both sides.

  3. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Triage verdict (repo-queue task 19250, openchamber scheduled lane, 2026-11-17 UTC)

    Fresh state: issue OPEN, no labels. Pass 2 of the design mill under parent #10389, which is still open.

    Latest comment (2026-11-15) is iroh probe 2: sandbox to laptop iroh works through the relay and a CONNECT shim. That evidence is input to this design, not a fix.

    This is a design pass that depends on pass 1 (#10390, triaged in this run) for the credential and endpoint decisions, and on the probe findings. No implementation exists or is in scope.

    Verdict: keep open, triaged. Route to the design-mill owner under #10389, sequenced after #10390. Not a closure candidate, and no worker packet from here: the design needs the pass 1 decisions first.

  4. removed their assignment
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions