bitcoin-dev
Simplicity: An alternative to Script
Posted on: October 30, 2017 23:29 UTC
In a recent bitcoin-dev email thread, Matt Corallo asks how to deal with "jets" in Bitcoin and proposes that discounted jets be used for scripting.
There are many ways to use simplicity, an inherent feature of the language, which could involve defining a collection of high-level operations and combinators at the level of things in Bitcoin Script and making an interpreter that implements these operations as discounted jets and ONLY these operations at all. This would functionally create a system like Bitcoin Script but with a pretty much perfectly rigorous formal specification and highly amenable to the formal analysis of smart contracts written in it.To make simplicity useful, a good collection of high-level functions and mid-level functions would be needed to make a wide space of useful but general software possible and high performance. However, this requires enough experience with simplicity to know what the requisite collection of operations would be. One challenge is not having a clear mental model for how nominal validation costs are allowed to be before there is a negative impact. There are three related ideas around consensus discounted jets: script-root jetted or not in an implementation, known and standard in the P2P network, and a particular jet discounted and what are the discounts. A script-versioning mechanism can provide a straightforward way to upgrade discounted cost tables in a compatible way. Another potential tool is the idea of sunsetting cost limits that sunset, where after a certain amount of time, the limits go away with an assumption that updated limits have been softforked in that activate at that time and themselves expire in N years. However, these options exist independently of simplicity. Simplicity is a rigorous base from which we could potentially use to build whatever future direction of script we like out of, by itself it doesn't mandate a particular depth or level of adoption. To get there we'll have to prove in practice that this is workable, Roconnor's SHA2 implementation in simplicity is proven to implement the same function that a C implementation implements, but there will need to be more.