Smart contracts may soon get a bitcoin boost as the famous programmer Pieter Wuille has unveiled a new coding language designed specifically for their use.
Posted on the bitcoin developers' mailing list on Monday, the "Miniscript" language aims to make it easier for programmers to write "smart contracts" or conditions to spend bitcoins. Wuille, Andrew Poelstra and Sanket Sanjalkar programmers have been working on the code for about a year, Wuille said.
Even though it was shared behind the scenes, Wuille said that he is now posting it on the mailing list because he has now reached "a phase where I would like to attract a little more attention".
Backing up a bit, "Script" is the intelligent contract language in bitcoin, which allows users to specify that certain conditions must be met before bitcoin can be spent. Suppose the funds are blocked until a certain time before they can be spent. Or two people have to sign a transaction before the money can be moved, a concept called "multi-sig".
This programmability is new when it comes to digital currency, since before bitcoin it was not possible to implement these rules without trusting a bank or a similar type of intermediary in the middle.
"Miniscript", on the other hand, is based on this programming language, improving it in different ways. One is that it is a little easier to look at and reason, as Wuille said with an example that "which allows A to take coins at any time, and B after [one] day."
Here's how these rules are implemented in the bitcoin script:
OP_EQUALVERIFY OP_CHECKSIGVERIFY <144> OP_CSV OP_ENDIF
So the same thing in Minscript:
or_d (c: pk (A), and_v (vc: pk_h (B), older (144)))
Miniscript is based on Script, able to "compile" in the mother tongue of bitcoins.
The new language is getting applause from the developers of the community. The lightning engineer Blockstream Rusty Russell, for example, tweeted: "This will be one of those," How the hell did we do before this ?! "Unsexy and vital."
There are many potential use cases, such as making the implementation of such complex scripts easier in the portfolio, as Eric Lombrozo tweeted. Or, as described by the bitcoin educator Jimmy Song, it could also be used to support the lightning network.
Thinking about it in the broader context of the blockchain languages, Song commented that the language of the intelligent contract differs from the Solidity language of ethereum, because while ethereum makes it possible to write many more types of smart contracts, Miniscript actually reduces the possibilities.
Song claims this is better because it reduces the "complexity" and the "attack surface".
This version includes two working implementations, in the C ++ and Rust programming languages, which Wuille has called a "work in progress", adding:
"Through large-scale randomized tests we have the certainty that the design of the language and the associated witnesses are compatible with the current rules of consent and standardization".
Image of Wuille through the CoinDesk archives