Expand description
Chunk header per SPEC v0.30 §2.2.
Encodes the 37-bit chunked wire-format header. First-symbol layout
MSB-first: [v3][v2][v1][v0][chunked] (4-bit version + 1-bit chunked-flag).
Remainder: 20-bit chunk-set-id + 6-bit count-minus-1 + 6-bit index.
Total = 4 + 1 + 20 + 6 + 6 = 37 bits.
Structs§
- Chunk
Header - Wire header for a single chunk in a chunked v0.30 payload.
Constants§
- SINGLE_
STRING_ PAYLOAD_ BIT_ LIMIT - Threshold (in payload bits) above which chunking is required. Derived from
codex32 regular-form’s 80-char data-part limit (per BIP 93): 3 HRP + 1
separator + 64 data + 13 checksum (see
codex32::REGULAR_CHECKSUM_SYMBOLS). Long-form codex32 was dropped in v0.12.0, so the legal data-symbol budget per chunk is 64 = 320 bits. Encoders attempt single-string emit first; if the codex32 wrapping reports “too long”, split into N chunks.
Functions§
- derive_
chunk_ set_ id - Derive the 20-bit chunk-set-id from a
Md1EncodingIdby taking the top 20 bits of the underlying 16-byte hash, MSB-first. - reassemble
- Reassemble a
Descriptorfrom N md1 codex32 strings. - split
- Split a
Descriptorinto N codex32 md1 strings, each carrying a chunk header and a slice of the canonical payload.