Expand description
The base envelope + inner message — the byte-deterministic Chia-Streamable wire shapes (SPEC §2, §5.2) and the length-framed, size-bounded codec (SPEC §1).
The envelope header (fields 1-8) is cleartext so a relay can route on recipient and multiplex on
correlation_id/stream; ALL content lives in the sealed region (field 9). WU1 defines the shapes
and the framing; the seal (SealedPayload.kem_enc + ciphertext) and the signature
(InnerMessage.sender_sig) are populated by WU2 — their FIELDS are final here.
Structs§
- DigMessage
Envelope - The base envelope (SPEC §2, field order normative). Fields 1-8 are the cleartext routing header; field 9 is the sealed region.
- Inner
Message - The sealed inner message (SPEC §5.2, FINAL field list — order is normative). Every field lives inside the AEAD-authenticated + signed region so a relay cannot tamper with any of it.
- Message
Type - Extensible message-type id (SPEC §4). Additive-only: an id, once assigned, is never renumbered or repurposed. The runtime registry that dispatches on it is WU3; the wire newtype is defined here.
- Sealed
Payload - The e2e-sealed region (SPEC §5.2). WU1 defines the shape; WU2 fills
kem_enc(the G1 ephemeral encapsulation) andciphertext(AEAD.Sealof theInnerMessage). - Stream
Header - A stream frame’s control header (SPEC §3), present iff the shape is
StreamFrame. The state machine that drives these frames is WU4; the wire shape is final here.
Enums§
- Interaction
Shape - The interaction shape carried in
flagsbits 0-1 (SPEC §2 field 3 / §3). - Stream
Frame - Stream frame kinds (SPEC §3). The wire field
StreamHeader::frameis au8; this enum names the values for WU4’s state machine.
Constants§
- FLAG_
SEALED flagsbit 2: the sealed bit — MUST be 1 for directed messages (SPEC §2 field 3).- FLAG_
SHAPE_ MASK flagsbitmask: bits 0-1 are theInteractionShape(SPEC §2 field 3).
Functions§
- decode_
envelope - Decode an envelope from on-wire bytes, rejecting an over-cap frame BEFORE decoding and an unknown version after (SPEC §1, §2).
- encode_
envelope - Serialize an envelope to its on-wire bytes, enforcing the
MAX_ENVELOPE_BYTEScap (SPEC §1).