Skip to main content

Output Script Descriptor | Bitcoin Glossary | Mapping Bitcoin

Output Script Descriptor

Desarrollo

Also known as: descriptor, script descriptor

A human-readable language for describing the scripts used in Bitcoin transaction outputs and their associated keys. Descriptors provide a standardized way to express complex wallet configurations, making it easier to import and export wallet data between software.

Overview

Output Script Descriptors are a compact, human-readable notation for describing exactly which scripts a wallet can sign for and how keys are derived. Introduced primarily through the work on Bitcoin Core, descriptors replace the older "dump all keys" approach to wallet backup and portability with a precise, composable language.

How Descriptors Work

A descriptor string encodes three key pieces of information: the script template, the key origin information, and a checksum for error detection.

Descriptor Structure:
┌─────────────────────────────────────────────────┐
│  wpkh([d34db33f/84h/0h/0h]xpub.../0/*)#checksum │
│  ─┬──  ──────┬──────────── ──┬─── ─┬─  ──┬────  │
│   │          │               │     │     │       │
│ script    key origin       xpub  path  checksum  │
│ type     (fingerprint                            │
│           + derivation)                          │
└─────────────────────────────────────────────────┘

Common descriptor functions include:

  • pk(KEY) — bare public key
  • pkh(KEY)P2PKH output
  • wpkh(KEY)P2WPKH native SegWit output
  • sh(wpkh(KEY)) — nested SegWit
  • tr(KEY)P2TR Taproot output
  • multi(k, KEY1, KEY2, ...) — k-of-n multisig
  • sortedmulti(k, KEY1, KEY2, ...) — multisig with sorted keys

Why Descriptors Matter

Before descriptors, exporting a wallet required dumping every individual private key or relying on xpub/xprv strings with implicit assumptions about derivation paths. This created compatibility headaches between different wallet software. Descriptors make wallet configuration fully explicit and portable, eliminating ambiguity.

Relationship to Miniscript

Output Script Descriptors and Miniscript are complementary technologies. While descriptors describe which scripts a wallet uses and how keys are derived, Miniscript provides a structured way to express the spending conditions within those scripts. Together they enable wallets to reason about complex Bitcoin Script policies in a safe, composable way.

Common Misconception

Descriptors are not just for advanced or multisig wallets. Even a simple single-key wallet benefits from descriptors because they unambiguously record the address type and derivation path, preventing the common problem of importing a seed into different software and seeing different addresses.