38 releases (7 major breaking)

Uses old Rust 2015

7.0.0 Apr 20, 2022
7.0.0-rc.2 Mar 28, 2022
6.1.0 Apr 19, 2022
6.0.1 Aug 5, 2021
0.1.0 Nov 13, 2018

#9 in Magic Beans

Download history 2549/week @ 2022-04-23 4065/week @ 2022-04-30 3526/week @ 2022-05-07 3994/week @ 2022-05-14 3869/week @ 2022-05-21 2717/week @ 2022-05-28 4108/week @ 2022-06-04 4834/week @ 2022-06-11 4030/week @ 2022-06-18 4749/week @ 2022-06-25 5268/week @ 2022-07-02 4720/week @ 2022-07-09 2530/week @ 2022-07-16 3552/week @ 2022-07-23 3923/week @ 2022-07-30 3583/week @ 2022-08-06

14,022 downloads per month
Used in 62 crates (27 directly)

CC0 license

43K SLoC


Minimum Supported Rust Version: 1.29.0

This crate uses "2015" edition and won't be ported over "2018" edition in the near future as this will change the MSRV to 1.31.


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

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.29.

Because some dependencies have broken the build in minor/patch releases, to compile with 1.29.0 you will need to generate the lockfile and run the following version-pinning command:

cargo generate-lockfile --verbose
cargo update -p cc --precise "1.0.41" --verbose

In order to use the use-serde feature or to build the unit tests with 1.29.0, the following version-pinning commands are also needed:

cargo update --package "serde" --precise "1.0.98"
cargo update --package "serde_derive" --precise "1.0.98"


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 Libera.

Release Notes



~74K SLoC