This project is a JavaScript implementation of Bitcoin Miniscript, a high-level language for describing Bitcoin spending conditions.

It includes a novel Miniscript Satisfier for generating explicit script witnesses that are decoupled from the tx signer, as well as a transpilation of Peter Wuille's C++ code for compiling spending policies into Miniscript and Bitcoin scripts.


  • Compile Policies into Miniscript and Bitcoin scripts.
  • A Miniscript Satisfier that discards malleable solutions and is able to generate explicit witnesses from Miniscripts using variables, such as pk(key).


This module has detailed documentation available on its Github repository. In addition, you can use the playground on this page to experiment with the module and try out its features.


Let's consider the policies used for demonstration in Wuille's paper and add some more that include unknown pieces of information (referred to as unknowns).
Loading Playground environment...