Cargo Features

[dependencies]
bdk-debug = { version = "0.28.1-debug", default-features = false, features = ["minimal", "compiler", "verify", "std", "sqlite", "sqlite-bundled", "compact_filters", "key-value-db", "all-keys", "keys-bip39", "rpc", "hardware-signer", "async-interface", "electrum", "use-esplora-async", "use-esplora-blocking", "use-esplora-reqwest", "use-esplora-ureq", "esplora", "reqwest-default-tls", "test-blockchains", "test-electrum", "test-rpc", "test-rpc-legacy", "test-esplora", "test-md-docs", "test-hardware-signer", "dev-getrandom-wasm"] }
default = electrum, key-value-db, std

These default features are set whenever bdk-debug is added without default-features = false somewhere in the dependency tree.

minimal
compiler

Enables compiler of miniscript-debug

verify = bitcoinconsensus

Affects wallet::verify

std default

std feature is always required unless building for wasm32-unknown-unknown target if building for wasm user must add dependencies bitcoin/no-std,miniscript/no-std

Enables std of bitcoin ^0.29.2 and miniscript-debug

sqlite sqlite-bundled? = ahash, rusqlite

Affects any::SqliteDbConfiguration

sqlite-bundled = sqlite

Enables bundled of rusqlite ^0.28.0

compact_filters = cc, rocksdb, socks

Affects blockchain::compact_filters, blockchain::any

key-value-db default = sled

Affects any::SledDbConfiguration

all-keys = keys-bip39
keys-bip39 all-keys? = bip39

Affects keys::bip39

rpc test-rpc? test-rpc-legacy? = bitcoincore-rpc

Affects blockchain::rpc, blockchain::any

hardware-signer test-hardware-signer? = hwi

Affects wallet::hardwaresigner

async-interface = async-trait

We currently provide mulitple implementations of Blockchain, all are blocking except for the EsploraBlockchain which can be either async or blocking, depending on the HTTP client in use.

  • Users wanting asynchronous HTTP calls should enable async-interface to get access to the asynchronous method implementations. Then, if Esplora is wanted, enable the use-esplora-async feature.
  • Users wanting blocking HTTP calls can use any of the other blockchain implementations (compact_filters, electrum, or esplora). Users wanting to use Esplora should enable the use-esplora-blocking feature.

WARNING: Please take care with the features below, various combinations will fail to build. We cannot currently build bdk with --all-features.

electrum default test-electrum? test-md-docs? = electrum-client

Affects blockchain::electrum, blockchain::any

use-esplora-async use-esplora-reqwest? = esplora, futures

MUST ALSO USE --no-default-features.

Enables async of esplora-client ^0.5

use-esplora-blocking use-esplora-ureq? = esplora

Enables blocking of esplora-client ^0.5

use-esplora-reqwest = use-esplora-async

Deprecated aliases

use-esplora-ureq = use-esplora-blocking
esplora use-esplora-async? use-esplora-blocking?

Typical configurations will not need to use esplora feature directly.

Affects blockchain::esplora, blockchain::any

reqwest-default-tls

Use below feature with use-esplora-async to enable reqwest default TLS support

Enables async-https of esplora-client ^0.5

test-blockchains test-electrum? test-esplora? test-rpc? test-rpc-legacy? = bitcoincore-rpc, electrum-client

Debug/Test features

test-electrum dev = electrum, test-blockchains

Enables bitcoind_22_0 and electrs_0_8_10 of electrsd ^0.22

test-rpc dev = rpc, test-blockchains

Enables bitcoind_22_0 and electrs_0_8_10 of electrsd ^0.22

test-rpc-legacy dev = rpc, test-blockchains

Enables bitcoind_0_20_0 and electrs_0_8_10 of electrsd ^0.22

test-esplora dev = test-blockchains

Enables bitcoind_22_0, esplora_a33e97e1 and legacy of electrsd ^0.22

test-md-docs = electrum
test-hardware-signer = hardware-signer
dev-getrandom-wasm

This feature is used to run cargo check in our CI targeting wasm. It's not recommended for libraries to explicitly include the "getrandom/js" feature, so we only do it when necessary for running our CI. See: https://docs.rs/getrandom/0.2.8/getrandom/#webassembly-support

Enables js of getrandom

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

sled key-value-db

Enables sled

Optional dependencies

electrum-client electrum test-blockchains?

Enables electrum-client ^0.12

esplora-client reqwest-default-tls? use-esplora-async? use-esplora-blocking?

Enables esplora-client ^0.5

rusqlite sqlite? sqlite-bundled?

Enables rusqlite ^0.28.0

ahash sqlite?

Enables ahash ^0.7.6

futures use-esplora-async?
async-trait async-interface?
rocksdb compact_filters?

Enables rocksdb ^0.14

cc compact_filters?
socks compact_filters?
hwi hardware-signer?

Enables hwi ^0.5

bip39 keys-bip39?
bitcoinconsensus verify?

Enables bitcoinconsensus ^0.19.0-3

bitcoincore-rpc rpc? test-blockchains?

Enables bitcoincore-rpc ^0.16

Needed by bdk_blockchain_tests macro and the rpc feature