<div dir="ltr">Mr. Garzik,<div><br></div><div>Thank you for the prompt response.  I should have explained my proposal a little better.<br><br>First of all, this is not Turing completeness, nor is it pseudo-complete in the sense of Ethereum&#39;s gas economics.</div><div><br></div><div>Instead, whenever a function call is encountered, the transaction is validated and can be included in a block.  The code actually halts many times.  A new transaction is then produced with the 2 stacks stored in the transaction data (so that the 2 stacks are saved and execution can be continued later).  When OP_RETURN_FROM_CALL_AND_CONTINUE is encountered, the top value of the Return stack is popped and execution continues from that location until validation/invalidation is reached.  It&#39;s not necessary to check the code to see that it has no infinite loops because any transaction with infinite loops will run out of BTC with which to fund the transaction fees of additional function calls.<br><br>To reiterate the most important point:  Execution halts every time a function call is encountered and the transaction can be included in a block.  A new transaction is then produced that can (if included in a block) continue execution.<br><br><br>Luke Durback</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 9, 2015 at 11:03 PM, Jeff Garzik <span dir="ltr">&lt;<a href="mailto:jgarzik@gmail.com" target="_blank">jgarzik@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">There is no need for a BIP draft.  &quot;Turing complete&quot; is just a fancy, executive-impressing term for &quot;it can run any computer program&quot;, or put even more simply, &quot;it can loop&quot;<div><br></div><div>Furthermore, the specification of such a language is trivial.  It is the economics of validation that is the complex piece.  Proving whether or not a program will halt as expected - The Halting Problem - is near impossible for most complex programs.  As a result, your proof is... running the program.  That produces enormous validation consequences and costs for generic-execution scripts when applied to a decentralized network of validation P2P nodes.</div><div><br></div><div>If you need that capability, it is just as easy to use a normal C/C++/etc. computer language, with your preferred algorithm libraries and development tools.</div><div><br></div><div>See <a href="https://github.com/jgarzik/moxiebox" target="_blank">https://github.com/jgarzik/moxiebox</a> for a working example of provable execution.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Dec 10, 2015 at 9:35 AM, Luke Durback via bitcoin-dev <span dir="ltr">&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hello Bitcoin-Dev,<br></div><div><br></div><div>I hope this isn&#39;t out of line, but I joined the mailing list to try to start a discussion on adding opcodes to make Script Turing Pseudo-Complete as Wright suggested is possible.</div><div><br></div><div>---</div><div><br></div><div>In line with Wright&#39;s suggestion, I propose adding a return stack alongside the, already existing, control stack.</div><div><br></div><div>The principle opcodes (excluding conditional versions of call and return_from) needed are</div><div><br></div><div>OP_DEFINITION_START FunctionName:  The code that follows is the definition of a new function to be named TransactionSenderAddress.FunctionName.  If this function name is already taken, the transaction is marked invalid.  Within the transaction, the function can be called simply as FunctionName.</div><div><br></div><div>OP_DEFINITION_END:  This ends a function definition</div><div><div><br></div><div>OP_FUNCTION_NAME FunctionName:  Gives the current transaction the name FunctionName (this is necessary to build recursive functions)</div></div><div><br></div><div>---</div><div><br></div><div>OP_CALL Namespace.FunctionName Value TransactionFee:  This marks the transaction as valid.  It also pushes the current execution location onto the return stack, debits the calling transaction by the TransactionFee and Value, and creates a new transaction specified by Namespace.FunctionName with both stacks continued from before (this may be dangerous, but I see no way around it) with the specified value.</div><div><br></div><div>OP_RETURN_FROM_CALL_AND_CONTINUE:  This pops the top value off the return stack and continues from the specified location with both stacks in tact.</div><div><br></div><div>---<br></div><div><br></div><div>It would also be useful if a transaction can create another transaction arbitrarily, so to prepare for that, I additionally propose</div><div><br></div><div>OP_NAMESPACE:  Pushes the current namespace onto the control stack<br><br>This, combined with the ability to make new transactions arbitrarily would allow a function to pay its creator.</div><div><br></div><div><br></div><div><br></div><div>I understand that this isn&#39;t all that is needed, but I think it&#39;s a start.  I hope this proposal has met you all well,</div><div><br></div><div>Luke Durback</div></div>
<br></div></div>_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>