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 asunknowns).- A single key
- One of two keys (equally likely)
- One of two keys (equally likely) - with unknown private key_2
- One of two keys (one likely, one unlikely)
- One of two keys (one likely, one unlikely) - with unknown unlikely private key
- A user and a 2FA service need to sign off, but after 90 days the user alone is enough
- A 3-of-3 that turns into a 2-of-3 after 90 days
- The BOLT #3 to_local policy
- The BOLT #3 offered HTLC policy
- The BOLT #3 offered HTLC policy - with no known preimage or revocation private key
- The BOLT #3 received HTLC policy
Code
Output
No output yet.