Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Rgvdx-0006DJ-4p for bitcoin-development@lists.sourceforge.net; Sat, 31 Dec 2011 09:54:25 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; envelope-from=joel.kaartinen@gmail.com; helo=mail-lpp01m010-f47.google.com; Received: from mail-lpp01m010-f47.google.com ([209.85.215.47]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Rgvdw-0002p4-B9 for bitcoin-development@lists.sourceforge.net; Sat, 31 Dec 2011 09:54:25 +0000 Received: by lami14 with SMTP id i14so7788935lam.34 for ; Sat, 31 Dec 2011 01:54:17 -0800 (PST) Received: by 10.152.146.99 with SMTP id tb3mr24547153lab.7.1325325257788; Sat, 31 Dec 2011 01:54:17 -0800 (PST) Received: from [91.153.84.115] (a91-153-84-115.elisa-laajakaista.fi. [91.153.84.115]) by mx.google.com with ESMTPS id on4sm33442324lab.7.2011.12.31.01.54.16 (version=SSLv3 cipher=OTHER); Sat, 31 Dec 2011 01:54:16 -0800 (PST) From: Joel Joonatan Kaartinen To: roconnor@theorem.ca In-Reply-To: References: <1325148259.14431.140661016987461@webmail.messagingengine.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 31 Dec 2011 11:54:13 +0200 Message-ID: <1325325253.2800.3.camel@mei> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (joel.kaartinen[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1Rgvdw-0002p4-B9 Cc: bitcoin-development@lists.sourceforge.net Subject: Re: [Bitcoin-development] Alternative to OP_EVAL X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 09:54:25 -0000 Wouldn't it work to restrict the number of executions of OP_EVAL allowed per transaction? That way it wouldn't allow for unlimited looping. If there's too many OP_EVAL executions during the transaction evaluation, just consider the transaction illegal. 3 would be enough for the purposes people have been planning for here I think. - Joel On Thu, 2011-12-29 at 11:42 -0500, roconnor@theorem.ca wrote: > On Thu, 29 Dec 2011, theymos wrote: > > > On Thu, Dec 29, 2011, at 01:55 AM, roconnor@theorem.ca wrote: > >> The number of operations executed is still bounded by the number of > >> operations occurring in the script. With the OP_EVAL proposal the > >> script language becomes essentially Turing complete, with only an > >> artificial limit on recursion depth preventing arbitrary computation > >> and there is no way to know what code will run without executing it. > > > > Even if OP_EVAL allowed infinite depth, you'd still need to explicitly > > specify all operations performed, since there is no way of looping. > > That's not true. Gavin himself showed how to use OP_EVAL to loop: > OP_PUSHDATA {OP_DUP OP_EVAL} OP_DUP OP_EVAL. > > Basically OP_DUP lets you duplicate the code on the stack and that is the > key to looping. I'm pretty sure from here we get get Turing completeness. > Using the stack operations I expect you can implement the SK-calculus > given an OP_EVAL that allows arbitrary depth. > > OP_EVAL adds dangerously expressive power to the scripting language. >