[package]
name = "blvm-sdk"
version = "0.1.11"
edition = "2021"
rust-version = "1.82"
authors = ["Bitcoin Commons Contributors"]
description = "Bitcoin Commons software developer kit, governance infrastructure and composition framework for Bitcoin"
license = "MIT"
repository = "https://github.com/BTCDecoded/blvm-sdk"
homepage = "https://github.com/BTCDecoded/blvm-sdk"
documentation = "https://docs.rs/blvm-sdk"
keywords = ["bitcoin", "governance", "cryptography", "consensus"]
categories = ["cryptography", "development-tools"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("node", "wasm-modules", "registry", "git"))'] }

[dependencies]
# Governance cryptography (Bitcoin-compatible)
blvm-secp256k1 = { version = ">=0.1, <1" }  # Pure-Rust crypto (replaces crates.io secp256k1)
sha2 = "=0.10.9"  # SHA256 for checksums, SHA512 for seed derivation
hmac = "=0.12.1"
ripemd = "=0.1.3"
pbkdf2 = "=0.12.2"  # PBKDF2-SHA512 for BIP39 seed derivation

# Serialization
serde = { version = "=1.0.228", features = ["derive"] }
serde_json = "=1.0.108"

# Error handling
anyhow = "=1.0.93"
thiserror = "=1.0.69"

# Encoding
hex = "=0.4.3"
base64 = "=0.21.5"

# Random number generation
rand = "=0.8.5"

# Date/time
chrono = { version = "=0.4.35", features = ["serde"] }

# CLI dependencies
# In-repo proc-macro crate (same repository; published separately as blvm-sdk-macros on crates.io).
blvm-sdk-macros = { version = "=0.1.11", path = "crates/blvm-sdk-macros" }
clap = { version = "=4.4.11", features = ["derive"] }

# Composition framework dependencies
toml = "=0.8.2"
# Modules use sled for `open_module_db`; do not pull `blvm-node` default `rocksdb` (heavy in CI/cross).
blvm-node = { version = "0.1.21", optional = true, default-features = false }
tokio = { version = "=1.48.0", features = ["rt", "macros", "sync", "fs"] }
tracing = "0.1"
reqwest = { version = "0.12", features = ["json", "blocking"], optional = true }
flate2 = { version = "1.0", optional = true, default-features = false, features = ["rust_backend"] }
tar = { version = "0.4", optional = true }
git2 = { version = "0.18", optional = true }
# RUSTSEC-2026-*: wasmtime 22 had multiple sandbox / cranelift CVEs; minimum patched line is 36.0.7+.
wasmtime = { version = "=36.0.9", optional = true, default-features = false, features = ["wat", "cranelift", "runtime"] }

# Local monorepo: sibling paths override the version pins above.
[features]
default = ["node"]
registry = ["dep:reqwest", "dep:flate2", "dep:tar"]
git = ["dep:git2"]
# Match historical `blvm-node` default **minus** `rocksdb` (avoids librocksdb-sys in module/out-of-process builds).
node = [
    "dep:blvm-node",
    "blvm-node/sled",
    "blvm-node/sysinfo",
    "blvm-node/nix",
    "blvm-node/libc",
    "blvm-node/production",
    "blvm-node/governance",
    "blvm-node/utxo-commitments",
    "blvm-node/protocol-verification",
]
wasm-modules = ["dep:wasmtime", "node", "blvm-node/wasm-modules"]

[dev-dependencies]
# Testing
criterion = "=0.5.1"  # Benchmarking
tempfile = "=3.8.1"  # Temporary files for tests

[[example]]
name = "hello-module"
path = "examples/hello-module/main.rs"

[[example]]
name = "demo-module"
path = "examples/demo-module/main.rs"

[[bin]]
name = "blvm-keygen"
path = "src/bin/blvm-keygen.rs"

[[bin]]
name = "blvm-sign"
path = "src/bin/blvm-sign.rs"

[[bin]]
name = "blvm-verify"
path = "src/bin/blvm-verify.rs"

[[bin]]
name = "blvm-compose"
path = "src/bin/blvm-compose.rs"

[[bin]]
name = "blvm-sign-binary"
path = "src/bin/blvm-sign-binary.rs"

[[bin]]
name = "blvm-verify-binary"
path = "src/bin/blvm-verify-binary.rs"

[[bin]]
name = "blvm-aggregate-signatures"
path = "src/bin/blvm-aggregate-signatures.rs"

[[bin]]
name = "blvm-registry"
path = "src/bin/blvm-registry.rs"
