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: Syntax, Checksums, and Wallet Recovery

permalink THAMER
#bip380#bitcoin#output-descriptors#wallet-recovery#xpub

Bitcoin output descriptors are structured expressions describing which Bitcoin outputs a wallet can recognize or construct. Unlike a bare address or extended public key, a descriptor can identify the script template and derivation details needed to reproduce a wallet's addresses. They are especially useful for watch-only monitoring, backups, and wallet interoperability.

What a descriptor describes

A descriptor combines an output type with its key material or script expression. Common examples include wpkh(KEY) for native SegWit single-key outputs, sh(wpkh(KEY)) for P2SH-wrapped SegWit, wsh(SCRIPT) for witness scripts, and tr(KEY) for Taproot outputs. KEY is a placeholder here, not a usable public key. An expression such as wpkh([FINGERPRINT/84h/0h/0h]XPUB/0/*) illustrates origin information, an account extended public key, an external-chain branch, and a wildcard index. Replace placeholders with valid values before importing.

Descriptors may carry a checksum after #, calculated according to the descriptor checksum algorithm. This detects many transcription errors; it does not authenticate the source or protect a secret. Descriptor origin paths describe derivation context but do not prove ownership.

Ranged descriptors and change branches

The * wildcard indicates a range of child indexes. Wallet software must scan an appropriate range and expand it as necessary. An external receive branch and an internal change branch are distinct. For a conventional BIP84 account, .../0/* and .../1/* represent those branches. Backing up only the receive descriptor can miss change outputs and lead to an incomplete recovery.

An extended public key can derive addresses but cannot authorize spending. A private-key descriptor or independent signing material is needed to sign, depending on the wallet architecture. Treat xpubs as privacy-sensitive because they can expose address clusters and transaction history.

Descriptor backup and import

A robust backup records the exact descriptor expressions, network, derivation origins, range information, and any separate signing material. Use getdescriptorinfo to inspect or obtain a checksum, deriveaddresses to derive addresses, and descriptor-wallet RPCs such as importdescriptors where supported. RPC details and wallet behavior depend on Bitcoin Core version and whether the wallet is descriptor-based.

Importing a descriptor does not guarantee immediate discovery of historical transactions. Rescanning, birth timestamps, range expansion, and available historical block data matter. Pruned nodes may not have every historical block required for a full rescan.

What descriptors do not guarantee

A descriptor is not itself a seed phrase, a guarantee of private-key recovery, or a universal export of all wallet metadata. Some complex policies require additional data, signing coordination, or software support. Verify backups by independently deriving expected receive and change addresses before relying on them.

Primary references

BIP380 — Output Script Descriptors General Operation: https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki

BIP386 — tr() Output Script Descriptors: https://github.com/bitcoin/bips/blob/master/bip-0386.mediawiki

Bitcoin Core descriptor documentation: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md

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