Pieter Wuille Unveils 'Miniscript,' A New Smart Contract Language for Bitcoin

AccessTimeIconAug 20, 2019 at 2:30 p.m. UTC
Updated Sep 13, 2021 at 11:21 a.m. UTC
10 Years of Decentralizing the Future
May 29-31, 2024 - Austin, TexasThe biggest and most established global event for everything crypto, blockchain and Web3.Register Now

Smart contracts could soon get a boost in bitcoin as prominent programmer Pieter Wuille has unveiled a new coding language designed specifically for their use.

Posted to the bitcoin developer mailing list Monday, the 'Miniscript' language aims to make it easier for programmers to write up "smart contracts" or conditions for spending bitcoins. Programmers Wuille, Andrew Poelstra and Sanket Sanjalkar have been working on the code for roughly a year, Wuille said.

Although it's been shared around behind the scenes, Wuille said he is now posting it to the email list because it's now it's reached "a stage where I'd like to get it some more attention."

Backing up a bit, "Script" is the smart contracting language in bitcoin, which allows users to specify certain conditions need to be met before the bitcoin can be spent. Say, funds are locked up until a certain time before they can be spent. Or, two people need to sign off on a transaction before the money can be moved, a concept called "multi-sig."

This programmability is novel when it comes to digital money, since before bitcoin, it wasn't possible to implement such rules without trusting a bank or a similar type of intermediary in the middle.

"Miniscript," on the other hand, builds on top of this programming language, improving on it in several ways. One is it's a bit easier to look at and reason about, as Wuille argued with an example that "that permits A to take the coins at any time, and B after [one] day."

This are how these rules are implemented in bitcoin's Script:

Then, the same thing in Minscript:


Miniscript builds on top of Script, able to "compile" to bitcoin's native language.

The new language is getting applause from developers in the community. Blockstream lightning engineer Rusty Russell, for example, tweeted: "This will be one of those, 'How the hell did we do it before this?!' technologies. Unsexy and vital."

There are many potential use cases, such as making it easier to implement such complex scripts in wallet, as Eric Lombrozo tweeted. Or, as bitcoin educator Jimmy Song described, it could even be used for underpinning the lightning network.

Thinking about it in the wider context of blockchain languages, Song commented that the smart contract language differs from ethereum's Solidity language, because while ethereum makes it possible to write many more types of smart contracts, Miniscript actually reduces the possibilities.

Song argues this is better because it reduces the "complexity" and "attack surface."

Included in this release are two working implementations, in the programming languages C++ and Rust, which Wuille called a "work in progress," adding:

"Through large scale randomized tests we have confidence that the language design and associated witnesses are compatible with the existing consensus and standardness rules."

Wuille image via CoinDesk archives


Please note that our privacy policy, terms of use, cookies, and do not sell my personal information has been updated.

CoinDesk is an award-winning media outlet that covers the cryptocurrency industry. Its journalists abide by a strict set of editorial policies. In November 2023, CoinDesk was acquired by the Bullish group, owner of Bullish, a regulated, digital assets exchange. The Bullish group is majority-owned by Block.one; both companies have interests in a variety of blockchain and digital asset businesses and significant holdings of digital assets, including bitcoin. CoinDesk operates as an independent subsidiary with an editorial committee to protect journalistic independence. CoinDesk employees, including journalists, may receive options in the Bullish group as part of their compensation.

Learn more about Consensus 2024, CoinDesk's longest-running and most influential event that brings together all sides of crypto, blockchain and Web3. Head to consensus.coindesk.com to register and buy your pass now.