[Simplicity] Translating a Simplicity Dialect to MAST-enabled Bitcoin SCRIPT
ZmnSCPxj
ZmnSCPxj at protonmail.com
Thu Nov 29 21:25:26 AEDT 2018
Good morning list,
From my understanding, Simplicity describes a family of languages which are effectively total (provably terminating) and not partial (may crash).
This prevents arbitrary looping, requiring bounds on recursion.
Now, due to the fact that total languages assuredly terminate, it is possible to completely analyze a program written in a total language.
In particular, it is possible to speculatively execute every possible branch of a total program.
If we import certain Bitcoin SCRIPT operations (signature checks and such) as primitives (jets?) of a Simplicity dialect, it seems to me possible to translate each possible execution of a total program written in this Simplicity dialect to a simple branchless Bitcoin SCRIPT.
Scripts would verify that the correct branch is being executed with given inputs, by use of `OP_VERIFY` on operations on those inputs.
(although we probably need to reenable some of the bit-manipulation operations in Bitcoin SCRIPT)
We can then commit all such SCRIPTs in a single MAST, or possibly just store each SCRIPT and a Graftroot signature (Graftroot has the tremendous advantage of low overhead, requiring O(1) information to select a branch, compared to O(log N) for MAST).
Then a Simplicity interpreter can simply execute using given inputs, and determine which of the branches will run, and provide the SegWit `witness` stack to claim a TXO.
Am I right in thinking that this is the eventual way that Simplicity will reach the Bitcoin blockchain?
Finally: first post.
Regards,
ZmnSCPxj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/simplicity/attachments/20181129/dd48496f/attachment.html>
More information about the Simplicity
mailing list