Expand description
Rust Bitcoin - primitive types
Primitive data types that are used throughout the rust-bitcoin ecosystem.
If you are using rust-bitcoin then you do not need to access this crate directly. Everything
here is re-exported in rust-bitcoin at the same path.
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.
Re-exports§
pub extern crate hex_stable as hex;
Modules§
- absolute
- Provides type
LockTimethat implements the logic aroundnLockTime/OP_CHECKLOCKTIMEVERIFY. - amount
- Bitcoin amounts.
- block
- Bitcoin blocks.
- fee_
rate - Implements
FeeRateand associated features. - locktime
- Provides absolute and relative locktimes.
- merkle_
tree - Bitcoin Merkle tree functions.
- parse_
int - Parsing utilities.
- pow
- Proof-of-work related integer types.
- relative
- Provides type
LockTimethat implements the logic aroundnSequence/OP_CHECKSEQUENCEVERIFY. - result
- Provides a monadic type returned by mathematical operations (
core::ops). - script
- Bitcoin scripts.
- sequence
- Bitcoin transaction input sequence number.
- time
- A UNIX timestamp used as the Bitcoin block time.
- transaction
- Bitcoin transactions.
- weight
- Implements
Weightand associated features. - witness
- A witness.
Structs§
- Amount
- An amount.
- Block
- Bitcoin block.
- Block
Hash - A bitcoin block hash.
- Block
Header - Bitcoin block header.
- Block
Height - A block height. Zero denotes the genesis block.
- Block
Height Interval - An unsigned block interval.
- Block
Mtp - The median timestamp of 11 consecutive blocks.
- Block
MtpInterval - An unsigned difference between two
BlockMtps. - Block
Time - A Bitcoin block timestamp.
- Block
Version - Bitcoin block version number.
- Compact
Target - Encoding of 256-bit target as 32-bit float.
- FeeRate
- Fee rate.
- Ntxid
- A “normalized TXID”.
- OutPoint
- A reference to a transaction output.
- Sequence
- Bitcoin transaction input sequence number.
- Signed
Amount - A signed amount.
- Transaction
- Bitcoin transaction.
- Transaction
Version - The transaction version.
- TxIn
- Bitcoin transaction input.
- TxMerkle
Node - A hash of the Merkle tree branch or root for transactions.
- TxOut
- Bitcoin transaction output.
- Txid
- A bitcoin transaction hash/transaction ID.
- Weight
- The weight of a transaction or block.
- Witness
- The Witness is the data used to unlock bitcoin since the SegWit upgrade.
- Witness
Commitment - A hash corresponding to the witness structure commitment in the coinbase transaction.
- Witness
Merkle Node - A hash corresponding to the Merkle tree root for witness data.
- Wtxid
- A bitcoin witness transaction ID.
Enums§
- Block
Checked - Marker that the block’s merkle root has been successfully validated.
- Block
Unchecked - Marker that the block’s merkle root has not been validated.
- NumOp
Result - Result of a mathematical operation on two numeric types.
Traits§
- Block
Validation - Marker for whether or not a block has been validated.
Type Aliases§
- Redeem
Script - A reference to a P2SH redeem script.
- Redeem
Script Buf - A P2SH redeem script.
- Script
PubKey - A reference to a
scriptPubKey(locking script). - Script
PubKey Buf - A
scriptPubKey(locking script). - Script
Sig - A reference to a script signature (scriptSig).
- Script
SigBuf - A script signature (scriptSig).
- TapScript
- A reference to a Segwit v1 Taproot script.
- TapScript
Buf - A Segwit v1 Taproot script.
- Witness
Script - A reference to a Segwit v0 witness script.
- Witness
Script Buf - A Segwit v0 witness script.