Difference between revisions of "OP RETURN"

Line 1: Line 1:
=DISCLAIMER==
+
'''OP_RETURN''' is a [[Opcodes_used_in_Bitcoin_Script|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.
This is a direct copy of https://en.bitcoin.it/w/index.php?title=OP_RETURN&action=edit and may need to be edited extensively
 
 
 
'''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 will restore 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 do so.
 
 
 
'''OP_RETURN''' is a [[script]] opcode used to mark a transaction output as invalid. Since any outputs with OP_RETURN are provably unspendable, OP_RETURN outputs can be used to [[Proof of burn|burn]] bitcoins.
 
 
 
== Is storing data in the blockchain acceptable? ==
 
Many members of the Bitcoin community believe that use of OP_RETURN is irresponsible in part because Bitcoin was intended to provide a record for financial transactions, not a record for arbitrary data. Additionally, it is trivially obvious that the demand for external, massively-replicated data store is essentially infinite. Despite this, OP_RETURN has the advantage of not creating bogus UTXO entries, compared to some other ways of storing data in the blockchain.
 
 
 
From [https://bitcoin.org/en/release/v0.9.0#opreturn-and-data-in-the-block-chain Bitcoin Core release 0.9.0]:
 
<blockquote>
 
This change is not an endorsement of storing data in the blockchain. The OP_RETURN change creates a provably-prunable output, to avoid data storage schemes – some of which were already deployed – that were storing arbitrary data such as images as forever-unspendable TX outputs, bloating bitcoin's UTXO database.
 
 
 
Storing arbitrary data in the blockchain is still a bad idea; it is less costly and far more efficient to store non-currency data elsewhere.
 
</blockquote>
 
 
 
== OP_RETURN applications ==
 
OP_RETURN can be used for digital asset proof-of-ownership, and has at times been used to convey additional information needed to send transactions (see [[stealth address]]).
 
  
 +
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 seek to do so.
  
 
{{DISPLAYTITLE:OP_RETURN}}
 
{{DISPLAYTITLE:OP_RETURN}}

Revision as of 17:21, 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 seek to do so.