Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id AF6E1C002C for ; Thu, 21 Apr 2022 02:36:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 88D2141A5E for ; Thu, 21 Apr 2022 02:36:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -1.901 X-Spam-Level: X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d0yvv1dM6EAy for ; Thu, 21 Apr 2022 02:36:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from azure.erisian.com.au (azure.erisian.com.au [172.104.61.193]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8CDF241A5D for ; Thu, 21 Apr 2022 02:36:13 +0000 (UTC) Received: from aj@azure.erisian.com.au (helo=sapphire.erisian.com.au) by azure.erisian.com.au with esmtpsa (Exim 4.92 #3 (Debian)) id 1nhMft-0000Sp-3G; Thu, 21 Apr 2022 12:36:10 +1000 Received: by sapphire.erisian.com.au (sSMTP sendmail emulation); Thu, 21 Apr 2022 12:36:00 +1000 Date: Thu, 21 Apr 2022 12:36:00 +1000 From: Anthony Towns To: Nadav Ivgi , Bitcoin Protocol Discussion Message-ID: <20220421023600.GA6083@erisian.com.au> References: <20220420023107.GA6061@erisian.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score-int: -18 X-Spam-Bar: - Subject: Re: [bitcoin-dev] CTV Signet Parameters X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 02:36:14 -0000 On Wed, Apr 20, 2022 at 08:05:36PM +0300, Nadav Ivgi via bitcoin-dev wrote: > > I didn't think DROP/1 is necessary here? Doesn't leaving the 32 byte hash > on the stack evaluate as true? > Not with Taproot's CLEANSTACK rule. The CLEANSTACK rule is the same for segwit and tapscript though? For p2wsh/BIP 141 it's "The script must not fail, and result in exactly a single TRUE on the stack." and for tapscript/BIP 342, it's "If the execution results in anything but exactly one element on the stack which evaluates to true with CastToBool(), fail." CastToBool/TRUE is anything that's not false, false is zero (ie, any string of 0x00 bytes) or negative zero (a string of 0x00 bytes but with the high byte being 0x80). Taproot has the MINIMALIF rule that means you have to use exactly 1 or 0 as the input to IF, but I don't think that's relevant for CTV. Cheers, aj