Skip to main content

Module codec

Module codec 

Source
Expand description

Wire codec for hotmint P2P messages.

Applies optional zstd compression based on payload size:

[0x00][raw CBOR]     — uncompressed (small messages)
[0x01][zstd bytes]   — zstd-compressed CBOR

This is part of the hotmint wire protocol — all node implementations (regardless of P2P library) must support this format.

Enums§

DecodeError
EncodeError

Functions§

decode
Decode a wire frame: check tag byte, optionally decompress, then CBOR-decode.
encode
Serialize a value to CBOR, then conditionally zstd-compress.