Leaf Version as Flags

The leaf version must be even which reduces the number of flags to 7, and it cannot be 0x50 (01010000) because that’s the starting byte for the annex. Further restrictions are desirable if we want to support some forms of static analysis, see footnote in BIP341. Given all this, if we ever really need a flag it’s probably better to implement it using OP_SUCCESSx.

1 Like