Debate: 64 bytes in OP_RETURN VS taproot OP_FALSE OP_IF OP_PUSH



Summary:

In a discussion on the Bitcoin-dev mailing list, Christopher Allen asked whether it is better to use a traditional OP_RETURN or a spent taproot transaction when placing a 64-byte message into the Bitcoin blockchain. Peter Todd suggested using OpPush and OpDrop for this purpose, but Andrew Poelstra pointed out that OpPush has a limit of 520 bytes (80 bytes by standardness in Taproot), so if multiple pushes are needed, it's more efficient to use FALSE IF ... ENDIF since this avoids repeated drops. However, for 64 bytes, the limit isn't relevant, so OpPush and OpDrop should be sufficient. The MAX_SCRIPT_ELEMENT_SIZE check in script/interpreter.cpp applies to all scripts regardless of standardness at script execution.


Updated on: 2023-06-16T04:14:29.556255+00:00