Output descriptors

output descriptor, descriptor, descriptors, BIP 380, wpkh, wsh, tr()

A compact text format that describes exactly how a wallet derives its addresses and scripts from its keys, so any compatible wallet can import it.

An output descriptor is a notation for the scripts a wallet produces. A descriptor like wpkh([d34db33f/84h/0h/0h]xpub.../0/*) reads as: derive native SegWit P2WPKH addresses from this extended public key, at derivation path 0/i, starting at i=0, and remember that the key originated from fingerprint d34db33f at path m/84h/0h/0h. Imported into any descriptor-aware wallet, that one string scans and spends the same UTXOs as the wallet that exported it, with no ambiguity about script type or derivation.

Before descriptors, sharing a wallet across tools required out-of-band conventions. Two wallets could agree on the same master seed and then disagree on which derivation path to scan or which script type to expect. Descriptors fold every piece of that information into one string. A checksum at the end catches accidental edits, and the key-origin fields ([fingerprint/path]) tell a hardware signer which of its child keys should sign a given input.

Descriptors compose. sh(wpkh(...)) wraps a SegWit key inside a P2SH output for legacy compatibility. wsh(multi(2,key1,key2,key3)) produces a 2-of-3 multisig under a native SegWit output. tr(internal,{script1,script2}) produces a Taproot output with an internal key and a script tree. The fragments nest the same way the underlying Bitcoin scripts do, which makes descriptors a clean pair with Miniscript for spending policies that go beyond single-key wallets.

Descriptors are standardized across BIPs 380 to 386. Bitcoin Core adopted them for its wallet format, and they are now the default for newly created wallets. BDK, rust-bitcoin, and descriptor-based wallets such as Bitcoin Safe, Liana, and Sparrow use them as the primary wallet format, and hardware signers increasingly accept descriptors for multisig coordination.

References