From 841236dc8741386888bb861737f9a477830729cb Mon Sep 17 00:00:00 2001 From: mnovak Date: Sat, 14 Nov 2026 13:06:56 +0100 Subject: [PATCH] =?UTF-8?q?[docs]=20F20:=20PROTOCOL.md=20section=208,=20th?= =?UTF-8?q?e=20v0=20routes=20=E2=80=94=20approved=20by=20Mark=202026-11-14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/PROTOCOL.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md index c80dc5c..7231e54 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -61,3 +61,25 @@ The platform facts above are Claude's understanding, to be verified in `.agents/ - A delivered blob is gone; an undelivered blob is gone after the TTL (clock injected). - Parsers are fuzzed (`cargo fuzz`) for every message type. - Every check in `VERIFY.md` §1 has a CI job or a documented manual procedure. + +## 8. The wire (v0) — approved 2026-11-08, routes added 2026-11-14 +HTTP/1.1 behind TLS (the reverse proxy, F23). Ids and tokens are unpadded base64url of a fixed length +with one canonical spelling: ids are 16 bytes, and tokens and hashes are 32. JSON bodies refuse +unknown fields. A blob is at most 256 KiB, and a KeyPackage at most 16 KiB. + +| Method and path | Auth (`Authorization: Bearer`) | Effect | +|:--|:--|:--| +| `POST /v0/mailboxes` `{id, postTokenHash, fetchTokenHash}` | none | creates a mailbox. The owner sends **hashes**, so the relay never holds a token | +| `POST /v0/mailboxes/{id}/blobs` (bytes) | post token | stores the blob with its size and the hour it arrived | +| `GET /v0/mailboxes/{id}/blobs` | fetch token | the waiting blobs, oldest first, at most 100. Fetching deletes nothing | +| `DELETE /v0/mailboxes/{id}/blobs/{sha256}` | fetch token | acknowledges: deletes that mailbox's blob with this SHA-256. §5 has no blob id, and a sequential id would leak how busy the relay is | +| `PUT /v0/mailboxes/{id}/post-token` `{postTokenHash}` | fetch token | blocks: the old post token is refused from now on | +| `POST /v0/invites` `{id, secretHash, keyPackage}` | none | stores an invite. It expires after 7 days, rounded up to the hour | +| `GET /v0/invites/{id}` | invite secret | returns the KeyPackage once, then deletes the invite | +| `GET /version` | none | the protocol and relay versions | + +- A wrong token, an unknown id and a malformed id all give the same bare **404**, so nobody can probe + what exists. +- A refusal has no body. +- The relay prints no request. +- Tests: `crates/relay/tests/relay.rs`, `crates/protocol/tests/wire.rs`.