From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 41571A7F for ; Wed, 15 Nov 2017 18:02:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sender-of-o51.zoho.com (sender-of-o51.zoho.com [135.84.80.216]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A1C8E4E9 for ; Wed, 15 Nov 2017 18:02:57 +0000 (UTC) Received: from [10.8.0.103] (119246244201.ctinets.com [119.246.244.201]) by mx.zohomail.com with SMTPS id 1510768972558816.3077961889941; Wed, 15 Nov 2017 10:02:52 -0800 (PST) From: Johnson Lau Content-Type: multipart/alternative; boundary="Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B" Mime-Version: 1.0 (Mac OS X Mail 11.0 \(3445.1.6\)) Message-Id: <53A587C3-DAC1-4055-875F-96B61717ACE6@xbt.hk> Date: Thu, 16 Nov 2017 02:02:48 +0800 To: bitcoin-dev X-Mailer: Apple Mail (2.3445.1.6) X-ZohoMailClient: External X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [bitcoin-dev] Making OP_CODESEPARATOR and FindAndDelete in non-segwit scripts non-standard X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 18:02:58 -0000 --Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 In https://github.com/bitcoin/bitcoin/pull/11423 = I propose to make = OP_CODESEPARATOR and FindAndDelete in non-segwit scripts non-standard I think FindAndDelete() is one of the most useless and complicated = functions in the script language. It is omitted from segwit (BIP143), = but we still need to support it in non-segwit scripts. Actually, = FindAndDelete() would only be triggered in some weird edge cases like = using out-of-range SIGHASH_SINGLE. Non-segwit scripts also use a FindAndDelete()-like function to remove = OP_CODESEPARATOR from scriptCode. Note that in BIP143, only executed = OP_CODESEPARATOR are removed so it doesn=E2=80=99t have the = FindAndDelete()-like function. OP_CODESEPARATOR in segwit scripts are = useful for Tumblebit so it is not disabled in this proposal By disabling both, it guarantees that scriptCode serialized inside = SignatureHash() must be constant If we use a softfork to remove FindAndDelete() and OP_CODESEPARATOR from = non-segwit scripts, we could completely remove FindAndDelete() from the = consensus code later by whitelisting all blocks before the softfork = block. The first step is to make them non-standard in the next release. =20= --Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 In https://github.com/bitcoin/bitcoin/pull/11423 I = propose to make OP_CODESEPARATOR and FindAndDelete in non-segwit = scripts non-standard

I= think FindAndDelete() is one of the most useless and complicated = functions in the script language. It is omitted from segwit (BIP143), = but we still need to support it in non-segwit scripts. Actually, = FindAndDelete() would only be triggered in some weird edge cases like = using out-of-range SIGHASH_SINGLE.

Non-segwit scripts also use a = FindAndDelete()-like function to remove OP_CODESEPARATOR from = scriptCode. Note that in BIP143, only executed OP_CODESEPARATOR are = removed so it doesn=E2=80=99t have the FindAndDelete()-like function. = OP_CODESEPARATOR in segwit scripts are useful for Tumblebit so it is not = disabled in this proposal

By disabling both, it guarantees that scriptCode serialized = inside SignatureHash() must be constant

If we use a softfork to remove = FindAndDelete() and OP_CODESEPARATOR from non-segwit scripts, we could = completely remove FindAndDelete() from the consensus code later by = whitelisting all blocks before the softfork block. The first step is to = make them non-standard in the next release.


 
= --Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B--