Expand description
Bytecode layer — KeyCard ↔ canonical bytecode (pre-chunking).
Per design/SPEC_mk_v0_1.md §3 and bip/bip-mnemonic-key.mediawiki
§“Bytecode layer”. The bytecode is the byte sequence emitted between
the string-layer chunk header and the cross-chunk integrity hash;
the string-layer (BCH, HRP-mixing, chunk reassembly) lives in
crate::string_layer (Phase 5).
Submodules:
header: 1-byte bytecode header (version + fingerprint flag)path: standard-table dictionary +0xFEexplicit-path codecxpub_compact: 73-byte compact xpub form with depth/child_number reconstruction fromorigin_pathencode: top-levelKeyCard → Vec<u8>encoderdecode: top-levelVec<u8> → KeyCarddecoder
Re-exports§
pub use decode::decode_bytecode;pub use encode::encode_bytecode;pub use header::BytecodeHeader;pub use path::STANDARD_PATHS;pub use path::decode_path;pub use path::encode_path;pub use path::lookup_indicator;pub use path::lookup_path;pub use xpub_compact::XpubCompact;pub use xpub_compact::decode_xpub_compact;pub use xpub_compact::encode_xpub_compact;pub use xpub_compact::reconstruct_xpub;
Modules§
- decode
- Top-level bytecode decoder: canonical
Vec<u8>→KeyCard. - encode
- Top-level bytecode encoder:
KeyCard→ canonicalVec<u8>. - header
- 1-byte bytecode header — version + reserved + fingerprint flag.
- path
- Origin-path codec — standard-table dictionary +
0xFEexplicit-path escape hatch. - xpub_
compact - 73-byte compact xpub form per
design/SPEC_mk_v0_1.md§3.6 (closure Q-7).