Skip to main content

Basic Structure

Descriptors consist of expressions with an optional checksum:
Where CHECKSUM is an 8-character alphanumeric descriptor checksum that protects against typos.

SCRIPT Expressions

Usage: sh(SCRIPT) (top level only)Creates a P2SH output that embeds the argument script.
Nesting example:
Usage: wsh(SCRIPT) (top level or inside sh only)Creates a P2WSH output that embeds the argument script.
Usage: pk(KEY) (anywhere)Creates a P2PK output for the given public key.
Usage: pkh(KEY) (not inside tr)Creates a P2PKH output for the given public key.
Usage: wpkh(KEY) (top level or inside sh only)Creates a P2WPKH output for the given compressed pubkey.
Usage: combo(KEY) (top level only)Alias for pk(KEY) and pkh(KEY). If the key is compressed, also includes wpkh(KEY) and sh(wpkh(KEY)).
Usage: multi(k,KEY_1,KEY_2,...,KEY_n) (not inside tr)k-of-n multisig using OP_CHECKMULTISIG. Use sortedmulti for lexicographically sorted keys.
Usage: multi_a(k,KEY_1,KEY_2,...,KEY_N) (only inside tr)k-of-n multisig using OP_CHECKSIG, OP_CHECKSIGADD, and OP_NUMEQUAL for Taproot.
Usage: tr(KEY) or tr(KEY,TREE) (top level only)P2TR output with the specified key as internal key, and optionally a tree of script paths.
With script paths:
Usage: addr(ADDR) (top level only)Expands to the script that the given address represents.
Usage: raw(HEX) (top level only)Uses the script whose hex encoding is HEX.

KEY Expressions

KEY expressions can include optional key origin information and support multiple formats.

Key Origin Information

Format: [fingerprint/path]KEY
Components:
  • [ - Opening bracket
  • d34db33f - 8 hex character fingerprint (first 32 bits of Hash160 of master pubkey)
  • /44'/0'/0' - Derivation path (unhardened or hardened steps)
  • ] - Closing bracket

Supported Key Formats

Compressed: 66 characters starting with 02 or 03
Uncompressed: 130 characters starting with 04x-only (Taproot): 64 hex characters (inside tr and rawtr only)
Note: Only compressed keys are permitted inside wpkh and wsh.
WIF-encoded private keys can be specified instead of public keys.
BIP32 extended public or private keys with optional derivation paths.Basic xpub:
With derivation path:
With wildcard:
Derivation path syntax:
  • /NUM - Unhardened derivation
  • /NUM' or /NUM h - Hardened derivation
  • /* - All unhardened children (default range: 0-1000)
  • /*' or /*h - All hardened children
Note: Hardened derivation requires access to the private key.

Multipath Descriptors

Specify receiving and change paths in a single descriptor using tuple notation:
Receiving and change in one descriptor:
This expands to two descriptors:
  • wpkh(xpub.../0/*) - Receiving addresses
  • wpkh(xpub.../1/*) - Change addresses

TREE Expressions

For Taproot script trees inside tr(): Single script:
Multiple scripts:
Nested trees:

Checksums

Descriptors should include an 8-character checksum for error detection:
Checksum properties:
  • Detects up to 4 character substitution errors (descriptors ≤ 501 chars)
  • Detects up to 3 errors in longer descriptors
  • ~1 in trillion false negative rate for other error types
Generate checksums:

Address Types

Supported address formats for addr() expressions:
  • P2PKH: 1... (mainnet) or [nm]... (testnet)
  • P2SH: 3... (mainnet) or 2... (testnet)
  • Segwit: bc1... (mainnet) or tb1... (testnet) - bech32/bech32m format