Released in August 2019 by Bitcoin developer Pieter Wuille, Bitcoin Miniscript aims to improve Bitcoin’s programmability without compromising security through the addition of an improved scripting compiler.
The goal is to make programmers’ lives easier and to allow for more/better functionality.
Bitcoin’s lack of programmability
The developer that makes code and possible states simpler is doing so to reduce the attack surface.
The developer that makes code and possible states more complex is either inexperienced or following orders.
BTC is simplifying (miniscript).
ETH is growing more complex (ETH 2.0).
— Jimmy Song (송재준) (@jimmysong) August 21, 2019
One of the key security aspects of Bitcoin (besides its massive energy requirements and vast decentralised network) is the fact it was developed in a non-Turing complete way, meaning it lacks programmability and doesn’t run loops or complex programs.
The less programmability a program has, the less chance you have of encountering errors, bugs, or issues.
In addition, it’s harder to break the code given less people know how to code in it.
As Bitcoin developer and educator Jimmy Song has said during his weekly podcast, ‘Off Chain with Jimmy Song’:
“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.”
As explained by Blockstream on GitHub – a company focused on improving Bitcoin and creating products over the Bitcoin network – there are some advantages to using a more user-friendly scripting language:
“Miniscript is a language for writing (a subset of) Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing, and more.”
Blockstream adds that Bitcoin is designed for the implementation of spending conditions consisting of various combinations of signatures, hash locks, and time locks. Yet despite being limited in functionality, it is still highly nontrivial to:
- Given a combination of spending conditions, find the most economical script to implement it.
- Given two scripts, construct a script that implements a composition of their spending conditions (for example, a multisig where one of the “keys” is another multisig).
- Given a script, find out what spending conditions it permits.
- Given a script and access to a sufficient set of private keys, construct a general satisfying witness for it.
- Given a script, be able to predict the cost of spending an output.
- Given a script, know whether particular resource limitations like the ops limit might be hit when spending.
Blockstream concludes that Miniscript functions as a representation for scripts that makes the operations listed above possible. It has a structure that allows composition and is easy to statically analyse for various properties like the spending conditions, correctness, security properties, and malleability.
Finally, compatible scripts can easily be converted to Miniscript form – avoiding the need for additional metadata.
Disclaimer: The views and opinions expressed by the author should not be considered as financial advice. We do not give advice on financial products.