Expand description
This crate is a collection of core structures for Bitcoin Dev Kit.
The goal of this crate is to give wallets the mechanisms needed to:
- Figure out what data they need to fetch.
- Process the data in a way that never leads to inconsistent states.
- Fully index that data and expose it to be consumed without friction.
Our design goals for these mechanisms are:
- Data source agnostic – nothing in
bdk_chain
cares about where you get data from or whether you do it synchronously or asynchronously. If you know a fact about the blockchain, you can just tellbdk_chain
’s APIs about it, and that information will be integrated, if it can be done consistently. - Data persistence agnostic –
bdk_chain
does not care where you cache on-chain data, what you cache or how you retrieve it from persistent storage.
Re-exports§
pub extern crate bdk_core;
pub extern crate rusqlite;
pub extern crate serde;
pub use indexed_tx_graph::IndexedTxGraph;
pub use indexer::spk_txout;
pub use indexer::Indexer;
pub use tx_graph::TxGraph;
pub use indexer::keychain_txout;
pub use bitcoin;
pub use miniscript;
Modules§
- bitcoin
- Rust Bitcoin Library
- indexed_
tx_ graph - Contains the
IndexedTxGraph
and associated types. Refer to theIndexedTxGraph
documentation for more. - indexer
Indexer
provides utilities for indexing transaction data.- local_
chain - The
LocalChain
is a local implementation ofChainOracle
. - rusqlite_
impl - Support for persisting
bdk_chain
structures to SQLite using [rusqlite
]. - spk_
client - Helper types for spk-based blockchain clients.
- tx_
graph - Module for structures that store and traverse transactions.
Structs§
- Balance
- Balance, differentiated into various categories.
- BlockId
- A reference to a block in the canonical chain.
- Canonical
Iter - Iterates over canonical txs.
- Check
Point - A checkpoint is a node of a reference-counted linked list of
BlockId
s. - Check
Point Iter - Iterates over checkpoints backwards.
- Confirmation
Block Time - Represents the confirmation block and time of a transaction.
- Descriptor
Id - Represents the unique ID of a descriptor.
- Full
TxOut - A
TxOut
with as much data as we can retrieve about it - Impl
- A wrapper that we use to impl remote traits for types in our crate or dependency crates.
- SpkIterator
- An iterator for derived script pubkeys.
- TxPos
InBlock - Set of parameters sufficient to construct an
Anchor
. - TxUpdate
- Data object used to communicate updates about relevant transactions from some chain data source
to the core model (usually a
bdk_chain::TxGraph
).
Enums§
- Canonical
Reason - The reason why a transaction is canonical.
- Chain
Position - Represents the observed position of some chain data.
- Observed
In - Represents when and where a transaction was last observed in.
Constants§
- BIP32_
MAX_ INDEX - Maximum BIP32 derivation index.
Traits§
- Anchor
- Trait that “anchors” blockchain data to a specific block of height and hash.
- Chain
Oracle - Represents a service that tracks the blockchain.
- Descriptor
Ext - A trait to extend the functionality of a miniscript descriptor.
- Merge
- Trait that makes an object mergeable.
Type Aliases§
- Indexed
- A tuple of keychain index and
T
representing the indexed value. - Keychain
Indexed - A tuple of keychain
K
, derivation index (u32
) and aT
associated with them.