Skip to main content

Module constants

Module constants 

Source
Expand description

Protocol constants — the pinned, normative values every conforming implementation shares (SPEC §1, §1.1, §2, §5.6, §5.6b). These are the byte-level contract; a second implementation MUST match them.

Constants§

ENVELOPE_VERSION
Current envelope format version (SPEC §2 field 1). A newer reader accepts older versions; an unknown newer version is rejected UnsupportedVersion.
FRESHNESS_WINDOW_MS
Anti-replay freshness window in milliseconds (±5 min) (SPEC §5.6). Enforcement is WU4.
MAX_CHUNK_BYTES
Per-stream-chunk on-wire cap (SPEC §3).
MAX_CHUNK_DECOMPRESSED_BYTES
Per-stream-chunk decompressed cap (SPEC §1.1 / §3). Equal to MAX_CHUNK_BYTES.
MAX_DECOMPRESSED_BYTES
Hard cap on the declared + actual decompressed size of a single message (SPEC §1.1 bomb guard).
MAX_ENVELOPE_BYTES
Hard cap on the on-wire compressed+sealed frame (SPEC §1). A receiver rejects an over-cap or truncated envelope before decoding.
MAX_MESSAGE_TTL_MS
Maximum sender-controlled message TTL in milliseconds (30 days) (SPEC §5.6b). Enforcement is WU4.
MAX_TRACKED_SENDERS
LRU cap on tracked senders for the anti-replay table (SPEC §5.6). Enforcement is WU4.
MIN_COMPRESS_BYTES
Below this size (or when compression does not shrink), a sender MUST use the raw codec (SPEC §1.1).
REPLAY_WINDOW
Anti-replay sliding-window width in bits (SPEC §5.6). Enforcement is WU4.
SIG_DOMAIN
BLS signature domain tag — keeps a dig-message signature un-confusable with a Chia spend signature (SPEC §5.1a). The signing itself is WU2; the tag lives here as the shared constant.
ZSTD_LEVEL
Pinned zstd level (SPEC §1.1: level 3, zstd default, no dictionary, single-frame — deterministic across the Rust and wasm/JS targets).