Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1RgN5W-00085F-Ju for bitcoin-development@lists.sourceforge.net; Thu, 29 Dec 2011 21:00:34 +0000 X-ACL-Warn: Received: from rhcavuit02.kulnet.kuleuven.be ([134.58.240.130] helo=cavuit02.kulnet.kuleuven.be) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1RgN5V-0000lH-E5 for bitcoin-development@lists.sourceforge.net; Thu, 29 Dec 2011 21:00:34 +0000 X-KULeuven-Envelope-From: sipa@ulyssis.org X-Spam-Status: not spam, SpamAssassin (not cached, score=-48.798, required 5, autolearn=disabled, DKIM_ADSP_CUSTOM_MED 0.00, FREEMAIL_FROM 0.00, KUL_SMTPS -50.00, NML_ADSP_CUSTOM_MED 1.20) X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: BD41C128083.A8238 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by cavuit02.kulnet.kuleuven.be (Postfix) with ESMTP id BD41C128083 for ; Thu, 29 Dec 2011 22:00:26 +0100 (CET) Received: from smtp.ulyssis.org (mail.ulyssis.student.kuleuven.be [193.190.253.235]) by smtps02.kuleuven.be (Postfix) with ESMTP id 8FB3FF3862 for ; Thu, 29 Dec 2011 22:00:26 +0100 (CET) Received: from wop.ulyssis.org (wop.intern.ulyssis.org [192.168.0.182]) by smtp.ulyssis.org (Postfix) with ESMTP id A661A10052 for ; Thu, 29 Dec 2011 22:00:26 +0100 (CET) Received: by wop.ulyssis.org (Postfix, from userid 615) id A4F4387C1AB; Thu, 29 Dec 2011 22:00:26 +0100 (CET) Date: Thu, 29 Dec 2011 22:00:26 +0100 X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Pieter Wuille To: bitcoin-development@lists.sourceforge.net Message-ID: <20111229210022.GA29974@ulyssis.org> References: <20111229190838.GA29609@ulyssis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111229190838.GA29609@ulyssis.org> X-PGP-Key: http://sipa.ulyssis.org/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Score: 1.2 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pieter.wuille[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-Headers-End: 1RgN5V-0000lH-E5 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: Thu, 29 Dec 2011 21:00:34 -0000 On Thu, Dec 29, 2011 at 08:08:38PM +0100, Pieter Wuille wrote: > On Thu, Dec 29, 2011 at 01:55:03AM -0500, roconnor@theorem.ca wrote: > > Gavin asked me to come up with an alternative to OP_EVAL, so here is my > > proposal. > > > > OP_CODEHASH Initial Proposal > > If we're again brainstorming about alternatives for OP_EVAL, I'll do my own. > > It is called OP_CHECKEDEVAL, and is specified as follows: I realized this may have been needlessly complicated. All is required to achieve the same properties (plus win half-verification by old clients) is a somewhat more restricted OP_EVAL which: * Does not touch the stack or altstack - it looks at the last (code-position wise) literal pushed (and not yet consumed by another OP_EVAL) on the stack and uses that as script to be executed. * Executes its subscript in an independent environment, which inherits only the main stack (this allows the outer script to hide information from the inner script by moving it temporarily to the alt stack). * OP_EVAL is an effective no-op for the execution state of the outer script, except for: * potentially causing failure (if the subscript doesn't parse or doesn't terminate succesfully) * popping an element from the literal-only stack A pay-to-script-hash becomes: OP_EVAL OP_HASH160 OP_EQUAL and is redeemed using [script input] <