Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 541BEF85 for ; Wed, 12 Dec 2018 20:01:07 +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 E52FE708 for ; Wed, 12 Dec 2018 20:01:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1544644857; cv=none; d=zoho.com; s=zohoarc; b=CSe1ntS/nAu3NmJX9SZ3teZTpqvuV8/FwcvMdE+7RRSlTxpflQu8jZkTo4Cq1HGFsnmb1hZ8U3Xtt756lTDJUMroO6tczzrN3pRxuSn/5JweyR5n9Y3TttE88rFlyF41WirovZxUXb5mIxL2ju9aKv9jOCokThEFaattw+oIZKo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1544644857; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=VHbEZFqRN+SPjYNOq7iUTpoZoUe77AfBKrc4MY07QWE=; b=SM0IbkOLEWXoImKa3K5GekJvoR/cUrhRujhdMY0Gc4VNqE2ISVWkgnjkdpML/lWq4ZbieWYBWwUkJSv9oqKqMfShWB6NWhiLKZJYjPBqzNhxLZ5we6+uhZJRrPaJRsfW52gxtmUbJGk2j0j1DQKNdhK3JQR2pIKCpFF/BMt7hZk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=xbt.hk; spf=pass smtp.mailfrom=jl2012@xbt.hk; dmarc=pass header.from= header.from= Received: from [10.8.0.105] (n218103234118.netvigator.com [218.103.234.118]) by mx.zohomail.com with SMTPS id 1544644854417547.3091275917728; Wed, 12 Dec 2018 12:00:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) From: Johnson Lau In-Reply-To: <87ftv3xerx.fsf@rustcorp.com.au> Date: Thu, 13 Dec 2018 04:00:50 +0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87ftv3xerx.fsf@rustcorp.com.au> To: Rusty Russell , bitcoin-dev X-Mailer: Apple Mail (2.3445.100.39) X-ZohoMailClient: External 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: Thu, 13 Dec 2018 22:09:29 +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 20:01:07 -0000 > On 12 Dec 2018, at 5:42 PM, Rusty Russell via bitcoin-dev = wrote: >=20 > 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. >=20 > I'm asking on-list because I'm sure I'm not the only confused one. >=20 > Having the SIGHASH_SCRIPTMASK flag is redundant AFAICT: why not always > perform mask-removal for signing? Because a hardware wallet may want to know what exact script it is = signing? Masked script has reduced security, but this is a tradeoff with = functionality (e.g. eltoo can=E2=80=99t work without masking part of the = script). So when you don=E2=80=99t need that extra functionality, you go = back to better security However, I=E2=80=99m not sure if there is any useful NOINPUT case with = unmasked script. >=20 > If you're signing arbitrary scripts, you're surely in trouble already? >=20 > And I am struggling to understand the role of scriptmask in a taproot > world, where the alternate script is both hidden and general? It makes sure that your signature is applicable to a specific script = branch, not others (assuming you use the same pubkey in many branches, = which is avoidable) >=20 > I look forward to learning what I missed! > Rusty. > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev