Skip to main content

mk_codec/bytecode/
mod.rs

1//! Bytecode layer — `KeyCard` ↔ canonical bytecode (pre-chunking).
2//!
3//! Per `design/SPEC_mk_v0_1.md` §3 and `bip/bip-mnemonic-key.mediawiki`
4//! §"Bytecode layer". The bytecode is the byte sequence emitted between
5//! the string-layer chunk header and the cross-chunk integrity hash;
6//! the string-layer (BCH, HRP-mixing, chunk reassembly) lives in
7//! `crate::string_layer` (Phase 5).
8//!
9//! Submodules:
10//!
11//! - [`header`]: 1-byte bytecode header (version + fingerprint flag)
12//! - [`path`]: standard-table dictionary + `0xFE` explicit-path codec
13//! - [`xpub_compact`]: 73-byte compact xpub form with depth/child_number
14//!   reconstruction from `origin_path`
15//! - [`encode`]: top-level `KeyCard → Vec<u8>` encoder
16//! - [`decode`]: top-level `Vec<u8> → KeyCard` decoder
17
18pub mod decode;
19pub mod encode;
20pub mod header;
21pub mod path;
22pub mod xpub_compact;
23
24#[cfg(test)]
25pub(crate) mod test_helpers;
26
27pub use decode::decode_bytecode;
28pub use encode::encode_bytecode;
29pub use header::BytecodeHeader;
30pub use path::{STANDARD_PATHS, decode_path, encode_path, lookup_indicator, lookup_path};
31pub use xpub_compact::{XpubCompact, decode_xpub_compact, encode_xpub_compact, reconstruct_xpub};