Skip to main content

Module consts

Module consts 

Source
Expand description

v0.1 wire-format constants.

Naming convention: ASCII byte literals (b'0', b's') are used for values whose semantic meaning is the character on the wire (threshold digit, share-index letter); hex literals (0x00) are used for values whose semantic meaning is the byte on the wire (the reserved-prefix byte). Both produce u8; the form chosen reflects which mental model is more natural at the use site.

Constants§

CHECKSUM_LEN_SHORT
Short codex32 checksum length in characters.
HRP
HRP for ms1 strings (BIP-93 codex32 HRP).
MNEM_LANGUAGE_NAMES
BIP-39 wordlist language names indexed by language byte (0 = English). This order MUST match ms-cli’s CliLanguage declaration order (Phase 2 depends on it).
MNEM_PREFIX
v0.2 mnem-prefix byte (type discriminator for Mnem payloads).
RESERVED_ID_BLOCKLIST
Anti-collision blocklist for the random 4-char id of a v0.2 K-of-N share-set (SPEC_ms_v0_2_kofn §2 consts / design-review I4). A share-set’s id is random-per-set; re-roll while it lands in this set so a share-set id never collides with a v0.1 type-tag-shaped value.
RESERVED_NOT_EMITTED_V01
4-byte type tags reserved-not-emitted in v0.1 (decoder rejects). mnem is no longer reserved-not-emitted: it is emitted in v0.2+ as Payload::Mnem.
RESERVED_PREFIX
v0.1 reserved-prefix byte (becomes the v0.2 type discriminator).
SEPARATOR
BIP-93 separator character.
SHARE_INDEX_V01
v0.1 emit-side share-index value (ASCII; “s” denotes the unshared secret per BIP-93).
TAG_ENTR
4-byte type tag — v0.1 emit (also accept).
THRESHOLD_V01
v0.1 emit-side threshold value (ASCII).
VALID_ENTR_LENGTHS
Allowed v0.1 entr entropy byte lengths (bijective with BIP-39 word counts {12,15,18,21,24}).
VALID_MNEM_STR_LENGTHS
Allowed v0.2 mnem total ms1 string lengths (byte-aligned: prefix + lang + entropy). Computed: 9 fixed + ceil((entropy_bytes + 2) * 8 / 5) payload symbols + 13 cksum.
VALID_STR_LENGTHS
Allowed v0.1 total ms1 string lengths (HRP+sep+threshold+id+share+payload+cksum). Computed: 9 fixed + ceil((entropy_bytes + 1) * 8 / 5) payload symbols + 13 cksum.