Descriptors and miniscript policy
Terms used in this lesson
- Descriptor
- A machine-readable description of the scripts, keys, and derivation paths a Bitcoin wallet watches or can spend.
- Miniscript
- A structured way to compose and analyze Bitcoin Script spending policies.
- Witness
- Signatures, scripts, or other data supplied to satisfy a Bitcoin output’s spending condition.
- P2WSH
- Pay to Witness Script Hash: a native SegWit output that commits to a witness script.
- Hashlock
- A spending condition that requires revealing data matching a committed hash.
- Taproot
- A Bitcoin output and spending design that can combine a public-key path with privately committed alternative scripts.
- SHA-256
- A cryptographic hash function used throughout Bitcoin to produce fixed-size 256-bit digests.
A wallet descriptor is a precise recipe for finding keys and constructing spending conditions. Miniscript is a structured way to express some of those conditions safely.
Loading lesson visuals...
Learn the idea
An output descriptor is a machine-readable expression describing the scripts and keys a wallet watches or can spend. Miniscript is a structured language for composing and analyzing certain Bitcoin Script policies. In the worked expression, wsh means a pay-to-witness-script-hash output, shortened to P2WSH; or_d selects one of two branches, pk requires a key signature, and older(144) requires a 144-block relative delay; and_v requires both delayed conditions to succeed. A policy expresses intent such as 'key A now, or key B after 144 blocks'; a descriptor fixes the concrete keys, derivation, script wrapper, and checksum needed to construct outputs.
Write the spending policy
Start with participants and conditions: signatures, hashlocks, or absolute and relative timelocks. This is the authorization intent.
Inspect every idea above to open it.
It may reveal complete wallet structure, derivation, balances, future addresses, and transaction links. Watch-only information still has significant privacy sensitivity.
The questions unlock after every required learning activity
Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.