Crate bitcoin_primitives

Source
Expand description

§Rust Bitcoin - primitive types.

Primitive data types that are used throughout the rust-bitcoin ecosystem.

This crate can be used in a no-std environment but a lot of the functionality requires an allocator i.e., requires the alloc feature to be enabled.

Modules§

absolutealloc
Provides type LockTime that implements the logic around nLockTime/OP_CHECKLOCKTIMEVERIFY.
amount
Bitcoin amounts.
block
Bitcoin blocks.
fee_ratealloc
Implements FeeRate and assoctiated features.
locktimealloc
Provides absolute and relative locktimes.
merkle_tree
Bitcoin Merkle tree functions.
opcodes
Bitcoin script opcodes.
pow
Proof-of-work related integer types.
relativealloc
Provides type LockTime that implements the logic around nSequence/OP_CHECKSEQUENCEVERIFY.
scriptalloc
Bitcoin scripts.
sequence
Bitcoin transaction input sequence number.
taproot
Bitcoin Taproot.
transaction
Bitcoin transactions.
weightalloc
Implements Weight and associated features.
witnessalloc
A witness.

Structs§

Amount
An amount.
Blockalloc
Bitcoin block.
BlockHash
A bitcoin block hash.
BlockHeader
Bitcoin block header.
BlockHeightalloc
The block height, zero denotes the genesis block.
BlockIntervalalloc
The block interval.
CompactTarget
Encoding of 256-bit target as 32-bit float.
FeeRatealloc
Represents fee rate.
Sequence
Bitcoin transaction input sequence number.
SignedAmount
A signed amount.
TapBranchTag
The tag used for [$hash_name].
TapLeafHash
Taproot-tagged hash with tag "TapLeaf".
TapLeafTag
The tag used for [$hash_name].
TapNodeHash
Tagged hash used in Taproot trees.
TapTweakHash
Taproot-tagged hash with tag "TapTweak".
TapTweakTag
The tag used for [$hash_name].
Transactionalloc
Bitcoin transaction.
TxInalloc
Bitcoin transaction input.
TxMerkleNode
A hash of the Merkle tree branch or root for transactions.
TxOutalloc
Bitcoin transaction output.
Txid
A bitcoin transaction hash/transaction ID.
Weightalloc
Represents block weight - the weight of a transaction or block.
Witnessalloc
The Witness is the data used to unlock bitcoin since the segwit upgrade.
WitnessCommitment
A hash corresponding to the witness structure commitment in the coinbase transaction.
WitnessMerkleNode
A hash corresponding to the Merkle tree root for witness data.
Wtxid
A bitcoin witness transaction ID.

Enums§

BlockCheckedalloc
Marker that the block’s merkle root has been successfully validated.
BlockUncheckedalloc
Marker that the block’s merkle root has not been validated.

Traits§

BlockValidationalloc
Marker for whether or not a block has been validated.