Miniscript: Smart Contracts & Bitcoin

Smart Contracts on Bitcoin become a lot easier thanks to Miniscript. This simplification of the Script programming language makes it a lot easier to create and verify Bitcoin smart contracts.

Smart Contracts on Bitcoin? Yes, of course. When talking about smart contracts, many people often think of all kinds of other blockchains, but Bitcoin was the first one that made it possible to program smart contracts.

A smart contract is a conditional transaction: conditions can be programmed to a transaction. Those conditions can be anything. For example, the condition that the bitcoins can only be spent when multiple parties sign ( Multi-Sig ). Or, for example, that the funds can only be spent after a certain amount of time has passed ( timelocks ).

Thanks to these smart contracts, all kinds of innovative financial applications are conceivable that go well beyond sending bitcoins from A to B. The programming language Script makes it possible to program such smart contracts. A lot is possible with this, but it is also complicated. Bitcoin uses a complex data structure and Script is a fairly basic programming language that doesn’t make things any easier. For example, with Script you can program a smart contract to act in a certain way with a certain type of input, but it is not always immediately clear what will happen when a different type of input is given.

It is therefore difficult and time-consuming to verify the operation of smart contracts in Script. And that is important, because when it comes to money you don’t want unexpected things to happen. There must be room for improvement, thought Bitcoin programmers Pieter Wuille, Andrew Poelstra and Sanket Sanjalkar.

Miniscript

So they spent a year working on Miniscript, a simplified way of programming in Script. Miniscript is an addition to Script and is intended to make the logic behind smart contracts easier for people to understand. It is still Script at its core, but less error-prone and presented in a structure that is easier for people to follow.

This makes it easier to create smart contracts that behave in a desired way. It is also easier for others to check its operation. The latter in particular can make an important contribution to the adoption of smart contracts.

According to the developers, Miniscript can be used for most practical applications. In the exceptional case that Miniscript is not sufficient, it is still possible to use Script.

To make it even easier, Pieter Wuille has also developed a ‘ policy language ‘. That is, as it were, an extra programming language on top of Miniscript. With this you can easily record the conditions for a smart contract, and then have them translated to Miniscript in the most efficient way.

This provides programmers of smart contracts with simpler building blocks to create decent and optimized smart contracts, without having to reinvent the wheel each time.

??????The thing about Miniscript is that it’s basically Script ?????? you have a ton of different ways to write ??????or,??????? a ton of ways to write ??????and??????? and some are more efficient than others . The policy language only has one ??????or,??????? one ??????and??????? and so forth, and Pieter [Wuille] has written this super optimized compiler which will convert that to Miniscript for you, and do it in the optimal way.???? ?????«£Andrew Poelstra, Director of Research Blockstream

An early version of Miniscript was already shared last week via a Bitcoin mailing list. That included implementations in the Rust and C++ programming languages. It is not yet known when a final version of Miniscript will be made available.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 Cryptocoin Budisma.net