Skip to main content

Module bytecode

Module bytecode 

Source
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 + 0xFE explicit-path codec
  • xpub_compact: 73-byte compact xpub form with depth/child_number reconstruction from origin_path
  • encode: top-level KeyCard → Vec<u8> encoder
  • decode: top-level Vec<u8> → KeyCard decoder

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 → canonical Vec<u8>.
header
1-byte bytecode header — version + reserved + fingerprint flag.
path
Origin-path codec — standard-table dictionary + 0xFE explicit-path escape hatch.
xpub_compact
73-byte compact xpub form per design/SPEC_mk_v0_1.md §3.6 (closure Q-7).