Skip to main content

bitcoin_rs_utxo/
lib.rs

1//! In-memory UTXO set for bitcoin-rs.
2//!
3//! The set is split into 256 first-byte shards. Each shard stores immutable
4//! transaction-level records in a `self_cell!`-pinned `bumpalo::Bump` arena,
5//! indexes them with `hashbrown::HashTable`, and guards mutation with a
6//! cache-padded `parking_lot::RwLock`.
7
8#![forbid(unsafe_op_in_unsafe_fn)]
9
10/// Round-robin shard defragmentation.
11pub mod defrag;
12/// UTXO hash-table key.
13pub mod key;
14/// Arena-resident UTXO records.
15pub mod record;
16/// UTXO-set mutations and lookup.
17pub mod set;
18/// Shard internals.
19pub mod shard;
20/// Native bitcoin-rs UTXO snapshot format.
21pub mod snapshot;
22
23pub use key::{UtxoBuildHasher, UtxoKey};
24pub use record::{OneUtxoOut, UtxoRecord};
25pub use set::{
26    BlockChanges, UndoBatch, UtxoAdd, UtxoChangeListener, UtxoError, UtxoSet, UtxoSetView,
27};
28pub use shard::LiveOutput;
29pub use snapshot::{
30    SnapshotLoad, aggregate_hash, hash_serialized_3, read_snapshot, write_snapshot,
31};