In rust-bitcoin, opcodes past the 0xba
opcode are named as such: OP_RETURN_187
, OP_RETURN_188
, …, OP_RETURN_254
. Their description is all the same: Synonym for OP_RETURN. The definition for OP_RETURN is Fail the script immediately. (Must be executed.)., which implies (if I understand correctly) that a script that contains an OP_RETURN in an unexecuted branch of an OP_IF statement is not made invalid by the sole presence of the opcode.
Yet in the Bitcoin Core codebase, those opcodes are not even defined in the opcode enum, and a line defines the maximum value that an opcode can be to be 0xb9
. Together these two mean that I’m not quite sure what to make of these opcodes… are they valid? Not valid? Can they be used as rust-bitcoin implies, or not used as Bitcoin Core implies? I assume there is more to this story, but just looking at the codebases as is I wasn’t able to get a feel for how to describe these opcodes.
Also implied in this question is: if they are indeed synonyms to OP_RETURN as rust-bitcoin indicates, can they be used interchangeably and in place of OP_RETURN the way it is used for storing data?