Anthony Towns [ARCHIVE] on Nostr: π
Original date posted:2022-04-20 π Original message:On Wed, Apr 20, 2022 at ...
π
Original date posted:2022-04-20
π Original message: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
Published at
2023-06-07 23:07:24Event JSON
{
"id": "7ca48581707eab89ae8bfd3a8e10aa4f3f6457b38a0ad97547ef5c806fc113d9",
"pubkey": "f0feda6ad58ea9f486e469f87b3b9996494363a26982b864667c5d8acb0542ab",
"created_at": 1686179244,
"kind": 1,
"tags": [
[
"e",
"22a3ad61ac618e4cddbe45159911f56b4157e56398a7395c8636325af422c5e4",
"",
"root"
],
[
"e",
"2ceb31c858630b8446018562aa5aba4599c07da5b2076ef346032d7cb0ab83d6",
"",
"reply"
],
[
"p",
"4a9c50edfac56c5e90e382fdea7977edd0a5a46b6be7aad0461ae0075d9d2407"
]
],
"content": "π
Original date posted:2022-04-20\nπ Original message:On Wed, Apr 20, 2022 at 08:05:36PM +0300, Nadav Ivgi via bitcoin-dev wrote:\n\u003e \u003e I didn't think DROP/1 is necessary here? Doesn't leaving the 32 byte hash\n\u003e on the stack evaluate as true?\n\u003e Not with Taproot's CLEANSTACK rule. \n\nThe CLEANSTACK rule is the same for segwit and tapscript though? \n\nFor p2wsh/BIP 141 it's \"The script must not fail, and result in exactly\na single TRUE on the stack.\" and for tapscript/BIP 342, it's \"If the\nexecution results in anything but exactly one element on the stack which\nevaluates to true with CastToBool(), fail.\"\n\nCastToBool/TRUE is anything that's not false, false is zero (ie, any\nstring of 0x00 bytes) or negative zero (a string of 0x00 bytes but with\nthe high byte being 0x80).\n\nTaproot has the MINIMALIF rule that means you have to use exactly 1 or 0\nas the input to IF, but I don't think that's relevant for CTV.\n\nCheers,\naj",
"sig": "02d099448ba2ccc696e1e3c213a971b32aae9e267a2c02572e41b133a70d50987d519b0d37b8ee0fc558c7cffce102f24153bb8e2a9b50ec5caaef57003b0eb0"
}