Crate bdk_chain

source ·
Expand description

This crate is a collection of core structures for Bitcoin Dev Kit (alpha release).

The goal of this crate is give wallets the mechanisms needed to:

  1. Figure out what data they need to fetch.
  2. Process that data in a way that never leads to inconsistent states.
  3. Fully index that data and expose it so that it can be consumed without friction.

Our design goals for these mechanisms are:

  1. 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 tell bdk_chain’s APIs about it and that information will be integrated if it can be done consistently.
  2. Error free APIs.
  3. Data persistence agnostic – bdk_chain does not care where you cache on-chain data, what you cache or how you fetch it.

Re-exports

pub use bitcoin;
pub use miniscript;

Modules

Module for structures that combine the features of sparse_chain and tx_graph.
Module for keychain based structures.
Module for structures that maintain sparse (purposely incomplete) snapshots of blockchain data.
Module for structures that store and traverse transactions.

Structs

A reference to a block in the cannonical chain.
A TxOut with as much data as we can retreive about it
An index storing TxOuts that have a script pubkey that matches those in a list.

Enums

Block height and timestamp in which a transaction is confirmed in.
Represents the height in which a transaction is confirmed at.

Constants

How many confirmations are needed for a coinbase output to be spent

Traits

Trait for things that have a single Transaction in them.
A trait to extend the functionality of a miniscript descriptor.
Trait to do something with every txout contained in a structure.
A trait like core::convert::Into for converting one thing into another.