Crypto glossary

Miniscript

Definition

Miniscript is a structured way of writing Bitcoin scripts that makes complex spending policies easier to compose, analyse and sign correctly.

Writing raw Bitcoin Script by hand is error-prone, and subtle mistakes can make coins unspendable or easier to steal. Miniscript, developed by Pieter Wuille, Andrew Poelstra and Sanket Kanjalkar around 2019, is a subset of Script with a clear, composable structure. A policy such as either two of my three keys, or my backup key after one year can be written in a readable language, compiled to an efficient script and analysed automatically for cost and correctness.

Because any compatible wallet can understand a Miniscript policy, different software and hardware signers can cooperate on the same complex wallet. That has enabled more advanced self-custody setups: multisig with decaying thresholds, inheritance plans with timelocked recovery keys and corporate treasury policies. Bitcoin Core supports Miniscript in its descriptor wallets, and several wallets are built around it.

Miniscript does not add new capabilities to Bitcoin; it only makes existing ones safer to use. Complex policies still require careful backups of every key and the descriptor itself, since losing the policy can make funds hard to recover. Hardware wallet support varies, so users should test recovery before storing large amounts.

Example

A family wallet uses a Miniscript policy: any two of three parents' keys can spend at any time, and after 18 months without activity a lawyer's key alone can move the funds to heirs.

Related terms