<div>Good morning list,<br></div><div><br></div><div>From my understanding, Simplicity describes a family of languages which are effectively total (provably terminating) and not partial (may crash).<br></div><div>This prevents arbitrary looping, requiring bounds on recursion.<br></div><div><br></div><div>Now, due to the fact that total languages assuredly terminate, it is possible to completely analyze a program written in a total language.<br></div><div>In particular, it is possible to speculatively execute every possible branch of a total program.<br></div><div><br></div><div>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.<br></div><div>Scripts would verify that the correct branch is being executed with given inputs, by use of `OP_VERIFY` on operations on those inputs.<br></div><div>(although we probably need to reenable some of the bit-manipulation operations in Bitcoin SCRIPT)<br></div><div>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).<br></div><div><br></div><div>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.<br></div><div><br></div><div>Am I right in thinking that this is the eventual way that Simplicity will reach the Bitcoin blockchain?<br></div><div><br></div><div>Finally: first post.<br></div><div><br></div><div>Regards,<br></div><div>ZmnSCPxj<br></div>