Skip to content

BTCDecoded/blvm-primitives

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages