4 releases (breaking)

0.4.0 Oct 8, 2024
0.3.1 May 10, 2024
0.3.0 Jan 30, 2024
0.2.0 Jun 22, 2023
0.1.0 Jul 29, 2021

#1 in #miniscript

Download history 599/week @ 2024-08-31 404/week @ 2024-09-07 357/week @ 2024-09-14 330/week @ 2024-09-21 382/week @ 2024-09-28 803/week @ 2024-10-05 1277/week @ 2024-10-12 828/week @ 2024-10-19 472/week @ 2024-10-26 344/week @ 2024-11-02 539/week @ 2024-11-09 274/week @ 2024-11-16 701/week @ 2024-11-23 403/week @ 2024-11-30 598/week @ 2024-12-07 618/week @ 2024-12-14

2,355 downloads per month
Used in 13 crates (9 directly)

CC0 and maybe GPL-3.0-only

4.5MB
53K SLoC

Build

Minimum Supported Rust Version: 1.63.0

*This crate uses "2018" edition

Elements Miniscript

This library is a fork of rust-miniscript for elements.

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 elements::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

Building

The cargo feature std is enabled by default. At least one of the features std or no-std or both must be enabled.

Enabling the no-std feature does not disable std. To disable the std feature you must disable default features. The no-std feature only enables additional features required for this crate to be usable without std. Both can be enabled without conflict.

Benchmarking

To run the benchmarks run RUSTFLAGS=--cfg=miniscript_bench cargo +nightly bench --all-features.

Minimum Supported Rust Version (MSRV)

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

Some dependencies do not play nicely with our MSRV, if you are running the tests you may need to pin as follows:

cargo update -p byteorder --precise 1.4.3

Note this list could sometimes be not exhaustive because not enforced by CI. If you have any issues check the script executed in CI: contrib/test.sh

Contributing

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

See CHANGELOG.md.

Licensing

The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.

Dependencies

~19MB
~228K SLoC