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_
CONCURRENT_ STREAMS - Per-peer cap on concurrently-OPEN streams (SPEC §3, WU4 gate item DIG-Network/dig_ecosystem#1162).
- 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).