Expand description
Wire format v2 — namespace-agnostic, AEX-branded prefix.
This module is the v2 counterpart of crate::wire. The only semantic
changes versus v1 are:
- Prefix is brand-neutral: every canonical message starts with
aex-<msg>:v2instead ofspize-<msg>:v1. The wire format no longer embeds a vendor name in cryptographically signed bytes. - Tighter clock skew window: 60 seconds (down from 300s in v1).
Aligns with JWT/OAuth2 RFC 7519 §4.1.4 norms — see ADR-0044.
AgentId values inside the payload are expected to be W3C DID URIs
(
did:method:specific-id[#fragment]), but legacyspize:strings are still accepted at parse-time for the v1→v2 grace window.
The byte-level shape (line-based, LF terminator, no trailing LF, ASCII-only fields) is identical to v1. Existing signers/verifiers that operate on raw bytes need only swap the bytes-producing function.
See crate::wire for the v1 canonical formats kept stable for the
30-day sunset grace defined in ADR-0036.
Constants§
- MAX_
CLOCK_ SKEW_ SECS_ V2 - Maximum acceptable clock skew between client and server for v2 messages, in seconds. Tighter than v1’s 300s; see ADR-0044.
- 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. Unchanged from v1 — entropy budget is the same regardless of prefix.
- PROTOCOL_
VERSION_ V2 - Wire protocol version produced by this module.
Functions§
- data_
ticket_ bytes_ v2 - Canonical bytes signed by the control plane when issuing a data-plane ticket (v2). Semantically identical to v1; only the prefix changes.
- decision_
request_ bytes_ v2 - Canonical bytes for an
aex-decision-request:v2message. - decision_
response_ bytes_ v2 - Canonical bytes for an
aex-decision-response:v2message. - is_
within_ clock_ skew_ v2 - Check if
issued_atis within the v2 allowed skew relative tonow. Overflow-safe under alli64inputs. - registration_
challenge_ bytes_ v2 - Produce the canonical bytes a client signs to register an agent (v2).
- rotate_
key_ challenge_ bytes_ v2 - Canonical bytes signed by an agent’s current key when requesting a key rotation (v2). Mirrors the v1 protocol defined in ADR-0024.
- transfer_
intent_ bytes_ v2 - Canonical bytes signed by the sender when initiating a transfer (v2).
- transfer_
receipt_ bytes_ v2 - Canonical bytes signed by the recipient when requesting a blob or acknowledging delivery (v2).