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

_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev

Reply via email to