Bitcoin Development in Rust
BDK: Descriptor Wallets and PSBTs · 1/2

Descriptors describe how funds can be spent, not just where they are

The Bitcoin Development Kit (BDK) builds wallet logic on top of rust-bitcoin, and its foundation is the descriptor, a string that encodes exactly how a set of coins can be spent: which key derivation path, which script type, and under what conditions. A descriptor like wpkh(xpub.../0/*) tells a wallet 'these coins are spendable via a single signature from keys derived along this path using P2WPKH.' This replaces the older, more brittle approach of a wallet just tracking addresses and assuming a fixed script type. Descriptors are self-describing, portable between wallets, and can express far more than single-signature spending, including multisig and timelocked conditions once combined with Miniscript.

On top of descriptors, BDK implements coin selection, the algorithm that decides which UTXOs to spend when constructing a new transaction. This sounds simple but isn't: naive coin selection leaks privacy by linking UTXOs together, wastes money on fees by choosing inputs inefficiently, and can create unusable 'dust' outputs. BDK's coin selection strategies balance fee efficiency, privacy, and avoiding future dust, decisions a hand-rolled wallet would otherwise get wrong silently.