Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 7E249900 for ; Wed, 12 Dec 2018 09:42:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ozlabs.org (ozlabs.org [203.11.71.1]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C09917C3 for ; Wed, 12 Dec 2018 09:42:17 +0000 (UTC) Received: by ozlabs.org (Postfix, from userid 1011) id 43FBfv6Rb4z9sBQ; Wed, 12 Dec 2018 20:42:15 +1100 (AEDT) From: Rusty Russell To: Pieter Wuille , Bitcoin Protocol Discussion , Bitcoin Dev In-Reply-To: References: Date: Wed, 12 Dec 2018 20:12:10 +1030 Message-ID: <87ftv3xerx.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Wed, 12 Dec 2018 17:12:38 +0000 Subject: Re: [bitcoin-dev] Safer sighashes and more granular SIGHASH_NOINPUT 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, 12 Dec 2018 09:42:18 -0000 Pieter Wuille via bitcoin-dev writes: > Here is a combined proposal: > * Three new sighash flags are added: SIGHASH_NOINPUT, SIGHASH_NOFEE, > and SIGHASH_SCRIPTMASK. > * A new opcode OP_MASK is added, which acts as a NOP during execution. > * The sighash is computed like in BIP143, but: > * If SIGHASH_SCRIPTMASK is present, for every OP_MASK in scriptCode > the subsequent opcode/push is removed. I'm asking on-list because I'm sure I'm not the only confused one. Having the SIGHASH_SCRIPTMASK flag is redundant AFAICT: why not always perform mask-removal for signing? If you're signing arbitrary scripts, you're surely in trouble already? And I am struggling to understand the role of scriptmask in a taproot world, where the alternate script is both hidden and general? I look forward to learning what I missed! Rusty.