Expand description
On-the-wire formats shared between SDKs and the control plane.
This module intentionally defines plain byte formats rather than JSON envelopes. Canonical byte sequences are the source of truth for what gets signed — any framing (JSON, protobuf, HTTP headers) is a transport concern and must not alter the signed bytes.
Constants§
- MAX_
CLOCK_ SKEW_ SECS - Maximum acceptable clock skew between client and server, in seconds. Messages older/newer than this are rejected to limit replay windows.
- MAX_
NONCE_ LEN - Maximum nonce length (hex chars). Prevents pathological inputs.
- MIN_
NONCE_ LEN - Minimum nonce length (hex chars). 32 chars = 128 bits of entropy.
- PROTOCOL_
VERSION - Current wire protocol version. Bumped only when the canonical byte sequence of any message format below changes. Old versions must continue to verify for audit replay.
Functions§
- data_
ticket_ bytes - Canonical bytes signed by the control plane when issuing a data- plane ticket. A ticket is a short-lived capability that authorises the holder to fetch blob bytes from a data-plane server directly, without the control plane proxying the stream.
- is_
within_ clock_ skew - Check if
issued_atis within the allowed skew relative tonow. Overflow-safe: a malicious client sendingi64::MINori64::MAXcannot panic the server (release-mode wraparound would previously silently accept those values; debug-mode would panic). - registration_
challenge_ bytes - Produce the canonical bytes that a client signs to prove possession of
the private key matching
public_key_hexwhen registering an agent. - rotate_
key_ challenge_ bytes - Canonical bytes signed by an agent’s outgoing (current) key when requesting to rotate to a new public key. Part of the formal rotation protocol defined in ADR-0024.
- transfer_
intent_ bytes - Canonical bytes signed by the sender when initiating a transfer.
- transfer_
receipt_ bytes - Canonical bytes signed by the recipient when requesting the blob or acknowledging delivery. Binds the recipient’s identity to the specific transfer_id and a fresh nonce to prevent replay.