Author: Pieter Wuille 2019-08-19 23:17:21
Published on: 2019-08-19T23:17:21+00:00
Miniscript is a language for writing Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing and more. It is a joint project between Pieter Wuille, Andrew Poelstra and Sanket Sanjalkar. Using Miniscript it's possible to write descriptors for addresses for scripts that implement things more complicated than multisig. Additionally, it makes it possible to make software that can deal with the composition of policies, compile complex spending policies to efficient scripts, and figure out under what necessary and/or sufficient conditions a script can be satisfied. Moreover, given signatures for a sufficient set of keys (and hash preimages, if needed), it generically constructs a witness for arbitrary scripts, without metadata apart from the script itself and public keys appearing in it. This means generic PSBT signers are possible for this class of scripts. Furthermore, it computes the bounds on the size of a witness for arbitrary scripts and performs static analysis to see if any of Script's resource limitations (ops limit, stack size, ...) might interfere with the ability to spend. There are two implementations of Miniscript: a C++ one and a Rust library. The implementations are a work in progress, but through large scale randomized tests, the developers have confidence that the language design and associated witnesses are compatible with the existing consensus and standardness rules. Miniscript is designed for Bitcoin as it exists today (primarily P2WSH) and does not need any consensus changes. However, the developers plan to extend the design to support future script changes Bitcoin may include.
Updated on: 2023-05-20T20:55:38.545248+00:00