blvm-protocol 0.1.10

Bitcoin Commons BLVM: Bitcoin protocol abstraction layer for multiple variants and evolution
Documentation
[package]
name = "blvm-protocol"
version = "0.1.10"
edition = "2021"
authors = ["Bitcoin Commons Team"]
description = "Bitcoin Commons BLVM: Bitcoin protocol abstraction layer for multiple variants and evolution"
license = "MIT"
repository = "https://github.com/BTCDecoded/blvm-protocol"
homepage = "https://btcdecoded.org"
documentation = "https://docs.rs/blvm-protocol"
keywords = ["bitcoin", "protocol", "blockchain", "network", "consensus"]
categories = ["cryptography::cryptocurrencies", "network-programming"]
rust-version = "1.82"

# Spec lives in blvm-spec repo; #[spec_locked] is a no-op marker at compile time when spec
# is not present. Verification runs via `cargo-spec-lock verify` in CI (see verify job).
include = ["Cargo.toml", "src/**"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
blvm-consensus = "0.1.16"
# Spec-lock for #[spec_locked] annotations (UTXO commitments 11.4)
blvm-spec-lock = { version = ">=0.1, <1", default-features = false, optional = true }

# Serialization - EXACT VERSIONS for security
serde = { version = "=1.0.228", features = ["derive"] }  # Updated for iroh 0.95 compatibility
serde_json = "=1.0.108"
bincode = "=1.3.3"  # For payment protocol serialization
serde_bytes = "=0.11.19"  # P2P extension messages (bincode + byte blobs)
tracing = "=0.1.41"  # Optional debug in [`node_tcp::TcpFramedParser`]

# Error handling - EXACT VERSIONS for security
anyhow = "=1.0.93"
thiserror = "=1.0.69"

# Cryptography - EXACT VERSIONS for security
sha2 = "=0.10.9"
ripemd = "=0.1.3"
# Pure-Rust secp256k1 (same implementation used by blvm-consensus).
blvm-secp256k1 = { version = ">=0.1, <1" }
hex = "=0.4.3"  # For hex encoding/decoding
chacha20poly1305 = { version = "=0.10.1", optional = true }  # BIP324 v2 encrypted transport
aead = { version = "=0.5.2", optional = true }               # AEAD trait for ChaCha20Poly1305
getrandom = { version = "=0.2", optional = true }            # Random key generation in BIP324
hkdf = { version = "=0.12.4", optional = true }              # HKDF key derivation for BIP324

# Address encoding (BIP173/350/351)
bech32 = "=0.9"

# UTXO commitments (sparse merkle tree, randomness)
sparse-merkle-tree = { version = "=0.6", optional = true }
rand = { version = "=0.8.5", optional = true }
# LruCache for spam filter script type cache (production)
lru = { version = "=0.12", optional = true }
# Rayon for parallel UTXO proof verification
rayon = { version = "=1.10", optional = true }

[dependencies.smallvec]
version = "=1.15.1"
optional = true
features = ["serde"]

# Local monorepo: sibling paths override the blvm-* version pins above.
[features]
# Production performance optimizations (passed through from blvm-consensus)
production = ["blvm-consensus/production", "dep:smallvec", "dep:lru", "dep:rayon"]
# UTXO commitments module (implementation in blvm-protocol)
utxo-commitments = ["sparse-merkle-tree", "dep:rand", "dep:blvm-spec-lock"]
# CTV (BIP119 CheckTemplateVerify) - passed through from blvm-consensus
ctv = ["blvm-consensus/ctv"]
# IBD/PERF profiling - passed through from blvm-consensus (profile_log, BATCH, etc.)
profile = ["blvm-consensus/profile"]
# Benchmarking hooks on consensus (assume-valid height, cache clears, etc.) — for benches via facade.
benchmarking = ["blvm-consensus/benchmarking"]
# BIP324: v2 encrypted transport protocol
bip324 = ["dep:chacha20poly1305", "dep:aead", "dep:getrandom", "dep:hkdf"]
# UTXO proof verification (optional, for future use)
utxo-proof-verification = []
# Parallel UTXO proof verification (requires rayon)
parallel-verification = ["dep:rayon"]
# Sigop counting module (always available, no feature flag needed)
# sigop module is always compiled in blvm-consensus
# Re-export `blvm_consensus::test_utils` for integration tests (enable on dev-deps from upper crates).
test-utils = []
# TCP framed P2P (`node_tcp`): Erlay message variants
erlay = []
# [`node_tcp::VersionMessage`] helper `supports_dandelion`
dandelion = []
# Orange Paper spec-lock on [`node_tcp::ProtocolParser`] (same dep as utxo-commitments)
protocol-verification = ["dep:blvm-spec-lock"]

[dev-dependencies]
blvm-primitives = { version = ">=0.1, <1", default-features = false }
blvm-secp256k1 = { version = ">=0.1, <1" }

# Fast release: opt-level 2 for iteration (matches blvm/blvm-node/blvm-consensus)
[profile.release-fast]
inherits = "release"
opt-level = 2