Bitcoin Miniscript Explained: Spending Policies, Analysis, and Satisfaction
Miniscript is a structured subset of Bitcoin Script designed to make complex spending conditions easier for software to compose, analyze, and satisfy. It is not a new Bitcoin consensus language and does not change the rules that nodes enforce.
Policy versus script
A policy expresses an intended authorization rule, such as one signer now or another signer after a delay. Miniscript expresses a carefully constrained script structure implementing that rule. A policy compiler can produce Miniscript, but a policy description and its compiled script are not identical objects.
What Miniscript enables
Miniscript's type system and analysis rules help tools reason about script correctness, available spending paths, signature requirements, timelocks, and satisfaction cost. Wallets can determine what witnesses are needed for a particular branch rather than hand-authoring arbitrary script for every policy.
Satisfaction and dissatisfaction
A satisfaction is witness data that makes a script evaluate successfully under its spending conditions. A dissatisfaction deliberately makes a subexpression false where composition requires it. Which branch can be satisfied depends on keys, preimages, timelocks, and the exact script context. Wallets must select a satisfiable branch and estimate its witness size.
Example policy
Consider a primary signing key and a recovery key usable after 144 blocks. A high-level policy might describe an OR between an immediate signature and a delayed signature. The compiled script must handle the delay correctly; 144 blocks is a relative height interval, not an exact number of hours. A descriptor can then bind the script policy to a wallet output type.
Script contexts matter
Miniscript support and permitted fragments depend on the script context, including SegWit v0 and Taproot tapscript. Do not assume a Miniscript expression compiled for one context can be reused unchanged in another. Verify descriptor and compiler support in the actual wallet software version.
Security and operational limits
Static analysis does not prove that key custody is safe, that a signer will remain available, or that a backup includes all required scripts and derivation metadata. Review recovery branches and their satisfactions before funding an output. Always test on regtest before mainnet use.
Primary references
BIP379 — https://bips.dev/379/
BIP380 — https://bips.dev/380/
Bitcoin Core descriptors — https://bitcoincore.org/en/doc/
