Monday, December 23, 2024

script – OP_DROP vs OP_RETURN

OP_RETURN is simply restricted to 80 bytes by Bitcoin Core’s default standardness guidelines. Some individuals enhance this restrict utilizing the -datacarriersize possibility. Different individuals have been working Peter Todd’s “Libre Relay” patch that removes this and different standardness limits, and routinely connects to different nodes working the patch. Consequently, many transactions that exceed this restrict have been mined these days, so that you won’t want to plot a method round it.

Furthermore, OP_RETURN is one in all solely a handful of ordinary output script templates. Placing <knowledge> OP_DROP into the output script will make it non-standard by Bitcoin Core’s (and most different implementations’) guidelines. What you really want is to place it right into a script that is revealed in an enter, i.e. a P2WSH witness script or a P2TR leaf script. Doing it this manner additionally means your knowledge makes use of the low cost on witness knowledge.

Nevertheless, <knowledge> OP_DROP remains to be barely suboptimal if you happen to’re trying to push something massive. The biggest push dimension allowed by consensus guidelines is 520 bytes, so that you’d want to separate your knowledge into chunks of 520 bytes like <knowledge> OP_DROP <knowledge> OP_DROP ..., requiring a number of drop opcodes. A extra environment friendly method is OP_FALSE OP_IF <knowledge> <knowledge> ... OP_ENDIF, generally often called the “inscription envelope” because it was popularized by ordinal inscriptions. (Be aware that there is presently a motion to make this particular sample non-standard by default. How possible it’s to succeed I’ll depart as an train for the reader.)

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles