Expand description
Essential Bitcoin types for consensus validation
Modules§
- smallvec
- Small vectors in various sizes. These store a certain number of elements inline, and fall back to the heap for larger allocations. This can be a useful optimization for improving cache locality and reducing allocator traffic for workloads that fit within the inline buffer.
Structs§
- Bip54
Boundary Timestamps - BIP54 timewarp: timestamps of boundary blocks for period-boundary checks.
- Block
- Block: ℬ = ℋ × 𝒯𝒳*
- Block
Context - Block validation context
- Block
Hash - Block hash: newtype wrapper for type safety
- Block
Header - Block Header: ℋ = ℤ × ℍ × ℍ × ℕ × ℕ × ℕ
- Block
Height - Block height: newtype wrapper for type safety
- OutPoint
- OutPoint: 𝒪 = ℍ × ℕ
- Script
Context - Script execution context
- Shared
Byte String - Shareable script_pubkey for UTXO: small scripts use inline storage; longer use
Arc<[u8]>. Clone is cheap (inline copies up to 64 bytes, shared isArc::clone). Serde matchesByteString. - Time
Context - Time context for consensus validation
- Transaction
- Transaction: 𝒯𝒳 = ℕ × ℐ* × 𝒯* × ℕ
- Transaction
Input - Transaction Input: ℐ = 𝒪 × 𝕊 × ℕ
- Transaction
Output - Transaction Output: 𝒯 = ℤ × 𝕊
- UTXO
- UTXO: 𝒰 = ℤ × 𝕊 × ℕ
Enums§
- ForkId
- Stable identifier for each consensus-affecting fork (BIP or soft-fork bundle).
- Network
- Network type for consensus validation
- Validation
Result - Validation result
Functions§
- utxo_
set_ insert - Insert owned UTXO into UtxoSet (wraps in Arc). Convenience for tests and one-off inserts.
- utxo_
set_ with_ capacity - Pre-allocate a UtxoSet for
nentries. Avoids costly reallocation spikes when loading large checkpoints (at 50M entries the HashMap table alone is ~2.5 GB; a growth-triggered realloc temporarily doubles that).