THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Bitcoin Output Descriptors Explained: Wallet Scripts and Recovery

permalink THAMER
#bip380#bitcoin-core#bitcoin-output-descriptors#descriptor-wallet#wpkh

A Bitcoin output descriptor is a structured expression describing how a wallet recognizes or constructs certain output scripts. Instead of assuming that one seed phrase identifies every relevant address, descriptor-aware software can record the actual script template and key derivation information used by the wallet.

What does a descriptor describe?

Common descriptor expressions include wpkh(KEY) for a native SegWit pay-to-witness-public-key-hash output, wsh(SCRIPT) for a witness-script-hash output, and tr(KEY) for a Taproot output. Real descriptors may include key origin fingerprints, derivation paths, ranged wildcards, and a checksum. The exact supported syntax and functionality depend on the wallet and software version.

Why is the script template important?

The same underlying key material can be used in different output types. A wallet scanning only P2WPKH outputs may miss funds received to P2TR outputs. A descriptor tells software what to derive and which scripts to search for. It does not create on-chain funds or bypass the need to know the correct key material.

What are ranged descriptors?

A descriptor containing a derivation wildcard can describe a sequence of outputs, such as an external receive branch or an internal change branch. Scanning needs a suitable range and discovery policy. A narrow scan can report an incomplete balance even when the wallet's funds remain on-chain.

What is a descriptor checksum?

Descriptors can include a short checksum after a # character to detect transcription errors. The checksum is not a digital signature and does not establish ownership or authorization. A descriptor that contains only public keys or xpubs can be useful for watch-only tracking, but it still reveals sensitive financial metadata.

Does a descriptor replace a seed backup?

Not necessarily. A public descriptor describes outputs but cannot sign without the necessary private keys. Conversely, a seed alone may be insufficient to locate every output without knowing scripts, accounts, derivation paths, and wallet-specific recovery information. Store sensitive backup components securely and test recovery against known addresses.

Developer implementation notes

Distinguish private descriptors from public watch-only descriptors. Validate checksums, network compatibility, key origins, and scan ranges. Never publish descriptors containing private key material. Treat any descriptor received from an untrusted party as data requiring parsing and validation, not executable instructions.

Primary references

  • BIP380 — Output Script Descriptors General Operation: https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki
  • BIP381 — Non-Segwit Output Script Descriptors: https://github.com/bitcoin/bips/blob/master/bip-0381.mediawiki
  • BIP386 — tr() Output Script Descriptors: https://github.com/bitcoin/bips/blob/master/bip-0386.mediawiki
  • Bitcoin Core RPC documentation: https://bitcoincore.org/en/doc/

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects