Difference between revisions of "OP RETURN"

Line 5: Line 5:
 
=== Storing data on-chain ===
 
=== Storing data on-chain ===
 
The Genesis upgrade re-enables the original functionality of the push data opcodes such that OP_RETURN is no longer the only means of pushing data onto the stack. Given this, the push data opcodes should be used in lieu of OP_RETURN.
 
The Genesis upgrade re-enables the original functionality of the push data opcodes such that OP_RETURN is no longer the only means of pushing data onto the stack. Given this, the push data opcodes should be used in lieu of OP_RETURN.
 +
{{DISPLAYTITLE:OP_RETURN}}

Revision as of 17:29, 6 January 2020

OP_RETURN is a script opcode used to end the script and return the top value on the stack. This opcode is analogous to the return function in programming languages. The OP_RETURN opcode has a controversial history(link) in Bitcoin and as a result has been primarily used as a means of storing data on the blockchain.

The Genesis upgrade in February 2020 restores the original functionality of the opcode. This will not impact the ability to store arbitrary data, as it is advised to now use OP_FALSE OP_RETURN in scripts that still seek to do so.

Storing data on-chain

The Genesis upgrade re-enables the original functionality of the push data opcodes such that OP_RETURN is no longer the only means of pushing data onto the stack. Given this, the push data opcodes should be used in lieu of OP_RETURN.