Miniscript [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2019-08-20T08:14:13+00:00


Summary:

Miniscript is a language for writing Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing and more. It is a joint project between Pieter Wuille, Andrew Poelstra, and Sanket Sanjalkar. The language allows for the creation of descriptors for addresses that implement more complex scripts than multisig. This opens up possibilities for software that can handle policy composition and compile complex spending policies into efficient scripts. Miniscript also enables users to determine the necessary and/or sufficient conditions for a script to be satisfied. With signatures for a set of keys, it can generically construct a witness for arbitrary scripts without any additional metadata. This means that generic PSBT signers are possible for this class of scripts.Furthermore, Miniscript computes the bounds on the size of a witness for arbitrary scripts and performs static analysis to identify any resource limitations that might interfere with spending ability. Currently, there are two implementations of Miniscript: a C++ version and a Rust library. While still a work in progress, the developers have conducted large-scale randomized tests to ensure compatibility with existing consensus and standardness rules. Importantly, Miniscript is designed for Bitcoin as it stands today, primarily utilizing P2WSH, and does not require any consensus changes. However, the developers plan to extend the design to support future script changes that may be included in Bitcoin.The adoption of Miniscript would have significant benefits for the Bitcoin ecosystem. It would reduce the barrier for new application writers by providing tools for analyzing code and mitigating the risk of user funds being lost. Developers could utilize Miniscript to assure themselves and others that their code maintains the desired outcome of no loss of coins, aside from transaction fees. While Miniscript may not identify specific transaction types, such as CoinJoin, it can verify that the final result is the same as the initial holdings. In essence, Miniscript would provide a valuable tool for ensuring the integrity and security of Bitcoin transactions.


Updated on: 2023-08-02T01:17:18.548175+00:00