Skip to main content

Module msg

Module msg 

Source

Structs§

Envelope
An encrypted message envelope for transport.
Headers
Signed message headers (without content body).
Message
A signed actor-to-actor message.
ReplayGuard
Sliding-window replay guard for message deduplication.

Constants§

DEFAULT_MAX_CLOCK_SKEW_SECS
DEFAULT_MESSAGE_TTL_SECS
DEFAULT_REPLAY_WINDOW_SECS
MESSAGE_PREFIX

Functions§

decode_content
Peel the multicodec varint prefix from content bytes. Returns (codec, payload). Legacy messages without a prefix should be treated as codec 0x00 (identity/raw bytes).
default_protocol
encode_content
Prefix payload with a multicodec varint so the codec is self-describing. Common codec values: CODEC_IDENTITY (0x00) raw bytes, CODEC_DAG_CBOR (0x71), CODEC_RAW (0x55). Use CODEC_IDENTITY for plain text — backward-compatible with receivers that treat content as raw bytes.