blvm-primitives 0.1.3

Bitcoin Commons BLVM: Foundational types, serialization, crypto, and config for consensus and protocol layers
Documentation

blvm-primitives

crates.io docs.rs CI License: MIT

Foundational types, serialization, crypto, and config for Bitcoin consensus and protocol layers.

Part of Bitcoin Commons BLVM. This crate is the shared foundation that blvm-consensus and blvm-protocol depend on, enabling parallel compilation and a clear split between consensus rules and protocol abstraction.

Contents

  • TypesHash, ByteString, Witness, Natural, Integer, Transaction, TransactionInput, TransactionOutput, Block, BlockHeader, OutPoint, UTXO, network enum, and related structs.
  • Serialization — block/transaction encoding and decoding, varint handling.
  • Crypto — SHA-256 (with optional asm/SHA-NI), hash comparison helpers, consensus-critical crypto using pinned versions.
  • Opcodes — script opcode constants and helpers.
  • Constants — consensus and tuning constants (e.g. IBD).
  • Config — shared config types used by node and consensus.
  • spec_types — optional spec-aware wrappers (SpecVec, SpecHashMap, spec_wrap!) for formal verification / Orange Paper alignment with blvm-spec-lock.

Usage

Add to your Cargo.toml:

[dependencies]
blvm-primitives = { path = "../blvm-primitives" }
# or from git:
# blvm-primitives = { git = "https://github.com/BTCDecoded/blvm-primitives" }

Optional features:

  • production — enables smallvec and rustc-hash for lower-allocation, production-oriented builds (used by blvm-consensus when built with production).

Building

cargo build
cargo test

License

MIT. See LICENSE if present.

Links