#bitcoin #script #analysis #version #handling #subset #support #minimum


Miniscript: a subset of Bitcoin Script designed for analysis

29 releases (10 breaking)

0.12.0 Jan 10, 2020
0.11.0 Oct 4, 2019
0.10.0 Sep 9, 2019
0.5.7 Jun 13, 2019
0.1.0 Nov 13, 2018
Download history 53/week @ 2019-10-06 30/week @ 2019-10-13 48/week @ 2019-10-20 222/week @ 2019-10-27 58/week @ 2019-11-03 19/week @ 2019-11-10 75/week @ 2019-11-17 63/week @ 2019-11-24 29/week @ 2019-12-01 264/week @ 2019-12-08 22/week @ 2019-12-15 36/week @ 2019-12-22 3/week @ 2019-12-29 14/week @ 2020-01-05 403/week @ 2020-01-12

290 downloads per month

CC0 license

10K SLoC


Minimum Supported Rust Version: 1.22.0


Library for handling Miniscript, which is a subset of Bitcoin Script designed to support simple and general tooling. Miniscripts represent threshold circuits of spending conditions, and can therefore be easily visualized or serialized as human-readable strings.

High-Level Features

This library supports

  • Output descriptors including embedded Miniscripts
  • Parsing and serializing descriptors to a human-readable string format
  • Compilation of abstract spending policies to Miniscript (enabled by the compiler flag)
  • Semantic analysis of Miniscripts and spending policies, with user-defined public key types
  • Encoding and decoding Miniscript as Bitcoin Script, given key types that are convertible to bitcoin::PublicKey
  • Determining satisfiability, and optimal witnesses, for a given descriptor; completing an unsigned bitcoin::TxIn with appropriate data
  • Determining the specific keys, hash preimages and timelocks used to spend coins in a given Bitcoin transaction

More information can be found in the documentation or in the examples/ directory


Contributions are generally welcome. If you intend to make larger changes please discuss them in an issue before PRing them to avoid duplicate work and architectural mismatches. If you have any questions or ideas you want to discuss please join us in ##miniscript on freenode.


This library is stable enough that it will no longer publish breaking changes in minor releases. However, the library (and Miniscript itself) is still under active development and is not held to the same standards as rust-bitcoin or rust-secp256k1.

For this reason, it is not recommended to use it in production.


~31K SLoC