How Your computers stays private

How your computers reach each other: an outgoing connection to a relay that only passes sealed bytes, a list of computers only your computers can sign, and a direct path on Tailscale.

Sign in to your Woolshed account on each of your computers. Every one of them then shows up in the sidebar under Your computers, with its agents and which of them need you. From any computer you can open, watch and type into the terminals on the others, and start new agents there, as if they were here. There's nothing to set up on the network: each computer connects out to a relay on woolshed.dev, so it works behind home routers, office firewalls and phone hotspots. The relay only passes sealed bytes along; it can't read your terminals. A new computer joins once you approve it on one you already use, and a lost one can be removed from any other computer or from the account page.

How two computers connect

 laptop                              woolshed.dev                         studio (at home)
 ┌──────────────┐  wss, outbound   ┌──────────────────┐   wss, outbound  ┌──────────────┐
 │ core         │ ───────────────▶ │ nginx :443       │ ◀─────────────── │ core         │
 │  machine     │                  │  /api/relay/     │   (control, held │  link        │
 │  "studio"    │  data stream:    │ woolshed-relay   │    open all the  │  listener    │
 │  via link ───┼── Noise IK ──────┼─ splices bytes ──┼── time)  ────────┼─▶ connect    │
 └──────────────┘  (sealed)        └──────────────────┘                  └──────────────┘

Every connection goes out from a computer to wss://woolshed.dev/api/relay/v1 (WebSocket over HTTPS on 443: it passes NAT, firewalls and corporate proxies that allow the web). Nothing listens for incoming connections on any computer.

Listening. While a computer is part of Your computers, its core holds one control connection to the relay. It authenticates by signing the relay's challenge with its device key (below). The relay pushes small events on it: incoming {stream}, roster (the list of computers changed), revoked (this computer was removed), ping.

Dialling. The laptop's core has a machine studio whose way in is the link. When the core dials it (on start, on first use, after a drop), it runs woolshed-core link dial <id> as its via command, as it would run ssh. That process opens a data connection, authenticates, and asks for dial <studio's id>. The relay checks both computers are on the same account, approved and Pro, then tells studio incoming {stream}. Studio's core opens its own data connection with accept {stream}, and the relay splices the two sockets together. From then on the relay copies bytes and counts them; it never parses them.

Inside the stream the two cores run a Noise handshake (below), and then carry exactly the bytes woolshed-core connect carries over ssh: studio's side bridges them to its own core socket, the laptop's side to its stdin and stdout. So the framed line, the hello with core ids, calls_you, events, attach, exec, file and put all work unchanged, and so does hc read studio/t3.

One data stream per pair of computers that talk (the core already multiplexes all terminals of a machine over one line). The relay keeps nothing but in-memory routing, plus byte counts.

Sealed end to end

Keys. On joining, each core makes two keys in its state folder (link/device.key, 0600, like an SSH key): Ed25519 for signing, X25519 for Noise and sealed boxes. The private keys never leave the core: not to the app, not to mods, not to the server. The computer's id is the first 16 bytes of SHA-256(sign_pub), written in base32 (26 characters).

The roster. Which computers are yours is decided by your computers, not by the server. It's an append-only, signed log, the chain:

{"seq": 4, "prev": "<hash of entry 3>", "kind": "add",
 "computer": {"id": "...", "name": "studio", "platform": "macos", "sign_pub": "...", "box_pub": "..."},
 "by": "<id of the approving computer>", "at": 1762500000, "sig": "<Ed25519 by 'by'>"}
  • Entry 0 is the account's first computer, signed by itself.
  • add and remove entries must be signed by a computer that is in the roster at that point.
  • Each core keeps its own verified copy (link/chain.json) and only accepts a longer chain that extends it. A chain that rewrites history or drops entries is refused, and the app says so ("woolshed.dev sent a list of computers that doesn't match this computer's").
  • The server stores the chain and hands it out, but can't add a computer: it has no device key to sign with.

The handshake is Noise_IK_25519_ChaChaPoly_BLAKE2s (the snow crate). The dialler knows studio's static key from the roster; both sides prove their static keys; the prologue binds woolshed-link-1, both ids and the stream id, so a stream can't be replayed or moved. Each side then checks the other's static key is in its current roster and not removed; if not, it closes. After the handshake, each message is a 2-byte length plus ChaCha20-Poly1305 ciphertext (at most 65,535 bytes), with a rekey every 2^20 messages. The relay sees sizes and timing, not content.

Server-only removals. A removal can come from the account web page (which has no device key). The server can always refuse service, so honouring a server's removal weakens nothing: cores accept a remove signed by the server's published key (pinned in the core: the Pro entitlement key), but never an add from it. Adding is the only direction that needs a computer's signature.

Approving a new computer, and removing a lost one

Joining

  1. On the new computer, sign in. If the account has Pro and Your computers is on, the app asks its core to make keys (link.setup), then asks to join, signing the request with its new key so the keys are shown to belong together.
  2. The account's first computer has nobody to ask: it signs entry 0 itself and is in.
  3. Otherwise the new computer shows:

    Approve this computer on one you already use Open Woolshed on another of your computers. It will ask about Sam's MacBook Air. Check that it shows this code: K7F2 · 9QDM

    Every approved computer that's online gets the request at once (a roster event on its control connection) and shows a card in the sidebar and a notification:

    Sam's MacBook Air wants to join your computers macOS · signed in to sam@example.com 1 minute ago Code: K7F2 · 9QDM (it should match the one on that computer) [Approve] [Not mine]

    The code is 40 bits of SHA-256("woolshed-join" ‖ sign_pub ‖ box_pub ‖ request id) in base32: comparing it is what stops a server from swapping in its own key.

  4. Approve asks the core to sign an add entry (link.approve), uploads it, and seals the vault key to the new computer. The new computer sees roster, verifies the chain, and appears everywhere.
  5. Not mine removes the request and, if the person agrees, signs this account out there. Requests expire after 30 minutes.

No other computer at hand (they're all off, or lost): the request page offers "I don't have my other computers". After a fresh email code, the server lets this computer start the list again: a new chain (a new epoch) with this computer as entry 0. Every old computer that comes online then sees "Your computers were started again from Sam's MacBook Air. Code: … [Trust it] [Not me]", and stays apart until a person answers. The vault can't be recovered this way (nobody has its key): it starts empty, and old computers re-upload theirs once trusted.

Removing

  • From any of your computers: right-click it in Your computers → Remove…. The core signs a remove, the server marks the computer removed, and the relay drops its connections at once. Every other core drops its line to it, refuses it from then on, and the vault key is rotated.
  • From the account page (/voice/account, a lost laptop when you have no other computer): "Disconnect" on a computer revokes its sign-in and removes it, with a server-signed remove. The next computer of yours that comes online rotates the vault key.
  • A removed computer keeps what it already had: its own terminals, and any vault entries it had decrypted. It can rejoin only by being approved again, as a new id.

Reconnecting and latency

  • Drops. Laptops sleep, Wi-Fi changes, the relay restarts. The control connection reconnects with backoff (0.25 s doubling to 30 s, with jitter, so a relay restart doesn't get every computer back in the same instant). Data streams end with their sockets; the core's existing machine supervisor dials again at once and then with backoff, and viewers reattach with the line ("[line to studio lost; reconnecting...]").
  • Liveness. The relay pings both connections every 20 s and drops one silent for 60 s. Inside the stream, the core's own line watchdog already gives up on a silent line.
  • Sleep and wake. On wake (a big gap between ticks), the core reconnects at once rather than waiting out a backoff.
  • Relay restart. In-flight streams end; everything is back within one backoff step (about 1 s in tests).
  • Latency. The relay is in Sydney. Two computers in Australia: about 20–60 ms added per round trip; in Europe or the US: 250–350 ms, which typing feels. The terminal echo is the remote program's, so local echo isn't an option. Two things keep it bearable: the direct path skips the relay entirely, and keystrokes go out as soon as they're typed (no Nagle: TCP_NODELAY on every socket, small frames flushed).

Limits

Per account, in the relay:

limitvaluewhen it's reached
computers10a join request says "remove one first"
data streams at once16the next dial is refused (too_many_streams)
speed per stream4 MB/sthe relay stops reading for a moment (TCP back-pressure, nothing lost)
relayed a month20 GBslowed to 256 KB/s until the month ends, and the app says why
control connections1 per computera newer one replaces the older

A direct path for Tailscale users

If both computers are on the same tailnet, there's no need for the relay:

  • A core with Tailscale (tailscale status --json answers) listens on its tailnet address only (port 7501, never on every interface), and the app puts that address in its roster entry (direct).
  • The dialler tries each direct address first, for 1.5 s, before the relay. It runs the same Noise handshake and roster check, so trust is the same as through the relay; Tailscale only carries the bytes. No woolshed.dev bytes, nothing counted.
  • When woolshed.dev is down, direct connections still work, against the roster this computer last had. The core accepts direct connections with a roster up to 7 days old.
  • hc machine ls shows via tailnet or via relay, and the sidebar shows a small "direct" marker.
  • People who prefer it can still add the same computer as a plain ssh machine over Tailscale SSH: that is unchanged.

The SSH vault

The SSH hosts you use (and, if you choose, their keys) follow you, sealed so that only your computers can read them.

  • The vault key is 32 random bytes made by the first computer, sealed to each approved computer's box_pub (X25519 sealed box) and stored on the server per computer (vault_keys). A new computer gets it sealed by the approver. Removing a computer rotates it: the remover makes a new key, re-seals every entry, and seals the key to the computers left.
  • Entries are sync items named vault/<id>. Their data is XChaCha20-Poly1305 ciphertext under the vault key (the item name as associated data), so sync's conflicts, undo, limits and deletion apply, and the server's own encryption is a second layer. An entry: {label, host, port, user, key?, jump?, options?}.
  • Keys stay on their computer unless you tick "Keep this key in your vault" on a host. A synced key is written on the other computer to ~/.config/woolshed/ssh/<entry> (0600) only when used, and never into ~/.ssh.
  • Using a host. Settings › Machines gets a Vault list: each host with Open (a terminal running ssh with the entry's options) and Add as machine (the usual hc machine add --via 'ssh -p … -i … user@host', with its prompts). Import from ~/.ssh/config offers each named Host.
  • Who decrypts. The app asks its core to open the sealed vault key (link.open, a sealed-box open with the device key) and keeps it in memory. Mods never see keys; the vault frame gets entries without key material.