Definition
Miniscript is a language for expressing a well-defined subset of Bitcoin Script in a structured way, designed so that scripts can be reliably analyzed, composed, and signed for by general-purpose software. It was designed by Pieter Wuille, Andrew Poelstra, and Sanket Kanjalkar at Blockstream Research and is specified in BIP379. The core idea is that highly structured script templates let wallets and tools reason about spending conditions — their cost, satisfiability, and security — without having to interpret arbitrary, hand-rolled Script.
Policy language and compilation
Alongside Miniscript, Wuille introduced a higher-level policy language. A developer describes the conditions under which coins may be spent — combinations of keys, thresholds, timelocks, and hashlocks — and a compiler translates that policy into the most efficient equivalent Miniscript, and from there into valid Bitcoin Script. This separation lets people express intent clearly while letting the tooling pick an optimal, correct encoding.
Why it matters
Hand-writing Bitcoin Script is error-prone, and mistakes can lock funds permanently or create unintended spending paths. Miniscript reduces that risk by making scripts machine-analyzable: a wallet can determine whether it can satisfy a script, what witness it needs, and how large the resulting input will be. It integrates with output descriptors, and support has been added to Bitcoin Core and hardware wallets, making advanced multisig and timelock setups more practical and auditable.
Miniscript builds on the same opcodes as raw Script and pairs naturally with modern spending paths such as Taproot and Tapscript.
In Simple Terms
Miniscript is a language for expressing a well-defined subset of Bitcoin Script in a structured way, designed so that scripts can be reliably analyzed, composed,…
