BitcoinerLAB

Miniscript

This project is a TypeScript implementation of Bitcoin Miniscript, a structured language for describing Bitcoin spending conditions.

It includes a compiler and static analyzer, plus a signer-agnostic satisfier that produces symbolic witness stacks (for example <sig(key)> <sha256_preimage(H)>), so you can reason about valid spends without private keys.

Features

  • Compile Miniscript into Bitcoin script (ASM).
  • Analyze Miniscript for sanity and malleability via the static type system.
  • Generate symbolic witness stacks with satisfier, including non-malleable solutions.
  • Tapscript support.

Documentation

This module has detailed documentation available on its Github repository. For a complete understanding and the latest API, please read the official README. In addition, you can use the playground on this page to experiment with the module and try out its features.

Playground

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 environment...
Code
Output
No output yet.