[package]
name = "mk-codec"
version = "0.3.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = "Reference implementation of the Mnemonic Key (MK) backup format for engravable BIP 32 xpub backups"
homepage = "https://github.com/bg002h/mnemonic-key"
documentation = "https://docs.rs/mk-codec"
readme = "README.md"
keywords = ["bitcoin", "bip32", "xpub", "backup", "engraving"]
categories = ["cryptography::cryptocurrencies", "encoding"]

[lints]
workspace = true

[features]
# Gates the optional `gen_mk_vectors` binary that emits the canonical
# vector corpus to `crates/mk-codec/src/test_vectors/v0.1.json`. Off by
# default so library consumers don't pull in serde / serde_json /
# sha2 transitively. Enable with `cargo run --bin gen_mk_vectors --features gen-vectors`.
gen-vectors = ["dep:serde_json"]

[[bin]]
name = "gen_mk_vectors"
path = "src/bin/gen_mk_vectors.rs"
required-features = ["gen-vectors"]

[dependencies]
bitcoin = "0.32"
bech32 = "0.11"
getrandom = "0.2"
thiserror = "2.0"
# Optional — only present when the `gen-vectors` feature is enabled.
serde_json = { version = "1", optional = true }

[dev-dependencies]
hex = "0.4"
serde_json = "1"
sha2 = "0.10"
# strum::EnumIter for tests/error_coverage.rs exhaustiveness CI gate.
# Mirrors md-codec's pattern (`crates/md-codec/Cargo.toml`).
strum = { version = "0.26", features = ["derive"] }
