Bitcoin Core developer Peter Wuille has introduced new Bitcoin (BTC) smart contract programming language dubbed Miniscript.
Wuille, a creator of major Bitcoin network upgrade SegWit, announced the Miniscript project website on the mailing list message for Bitcoin developers on Aug. 19.
As noted in the statement, Miniscript was developed and implemented by Wuille, Andrew Poelstra and Sanket Kanjalkar at Canadian blockchain tech firm Blockstream Research. Wuille claimed that the project took the developers around a year, and it has now reached the stage where it needs to get more attention.
Mini-Bitcoin script
Miniscript is a language for writing a subset of Bitcoin scripts in a structured way, which enables analysis, composition, generic signing and others, as Wuille describes it in short. Meanwhile, Bitcoin script is a basic programming language that makes smart contracts on Bitcoin network possible by enabling users to set specific conditions for a certain transaction to be completed.
According to Wuille, the adoption of Miniscript language could reduce some barriers between pieces of software used in smart contracts, also providing a multisig ecosystem that functions in a more effective way that simple script language. He explained on Twitter:
“Imagine a company wants to protect its cold storage funds using a 2-of-3 multisig policy with 3 executives. One of the executives however has a nice 2FA/multisig/timelock based setup on his own. Why can’t that entire setup be one of the multisig “participants”? A lot of work is focused on extensions to the functionality of the blockchain itself to support more complex application, but I feel we’re forgetting that using these features in an accessible, composable, analyzable way is basically impossible today.”
Script analysis made easier
While Miniscript is basically a reformulation of Bitcoin script, it remains the same script language, but instead allows wallets and other software to construct and analyze scripts more effectively, Wuille explained on Reddit.
In the post, Wuille provided an example of how the same notation would look in basic Bitcoin script in comparison with one in Miniscript language.
Bitcoin script:
OP_CHECKSIG OP_IFDUP OP_NOTIF OP_DUP OP_HASH160
OP_EQUALVERIFY OP_CHECKSIGVERIFY <144> OP_CSV OP_ENDIF
Miniscript:
or_d(c:pk(A),and_v(vc:pk_h(B),older(144)))
Miniscript is now available in implementations for C ++ and Rust, Wuille wrote, adding that work on the project is ongoing. The developer clarified that Miniscript is designed for Bitcoin as it exists to date and does not require any consensus changes.