Difference between revisions of "OP RETURN"

From Bitcoin Wiki
Jump to: navigation, search
(Remove garbage encouraging spam)
(Undo revision 62559 by Midnightmagic (talk))
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''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.
+
'''OP_RETURN''' is a [[script]] opcode used to mark a transaction output as invalid. Since the data after OP_RETURN are irrelevant to Bitcoin payments, arbitrary data can be added into the output after an OP_RETURN. Since any outputs with OP_RETURN are provably unspendable, OP_RETURN outputs can be used to [[Proof of burn|burn]] bitcoins.
 +
 
 +
Currently, the default Bitcoin client relays OP_RETURN transactions up to 80 bytes [https://github.com/bitcoin/bitcoin/search?utf8=%E2%9C%93&q=MAX_OP_RETURN_RELAY], but does not provide a way for users to create OP_RETURN transactions.
  
 
== Is storing data in the blockchain acceptable? ==
 
== 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.
+
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, the use of OP_RETURN continues unabated: while there is no global miner consensus to stop people from embedding arbitrary data in the blockchain if they want to, OP_RETURN is somewhat more efficient in terms of [http://i.imgur.com/VAGZWBK.png data bytes stored as a fraction of blockchain space consumed]. Compared to some other ways of storing data in the blockchain, OP_RETURN has the advantage of not creating bogus UTXO entries. [https://github.com/bitcoin/bitcoin/pull/5286 Discussion on GitHub pull request]
 +
 
 +
The creation of OP_RETURN outputs also destroys Bitcoins used in the outputs of OP_RETURN transactions, which contributes to future deflationary pressures.
  
 
From [https://bitcoin.org/en/release/v0.9.0#opreturn-and-data-in-the-block-chain Bitcoin Core release 0.9.0]:
 
From [https://bitcoin.org/en/release/v0.9.0#opreturn-and-data-in-the-block-chain Bitcoin Core release 0.9.0]:
Line 12: Line 16:
  
 
== OP_RETURN applications ==
 
== 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]]).
+
OP_RETURN is used for writing human-language messages, digital asset proof-of-ownership, and storing data. Its use has been proposed for P2P application discovery. See the "prefixes" table below.
  
 
== OP_RETURN prefixes ==
 
== OP_RETURN prefixes ==
Often, OP_RETURN transactions include a prefix to identify which "protocol" they belong to. Protocols wishing to claim OP_RETURN prefixes should use the standard [[Bitcoin Improvement Proposals]] process. Not all OP_RETURN transactions use prefixes.
+
Often, OP_RETURN transactions include a prefix to identify which protocol they belong to. There is no standardized method of claiming OP_RETURN prefixes, and not all OP_RETURN transactions use prefixes. At the time of writing, this wiki page is probably the most complete list of OP_RETURN prefixes. Note that this table is an attempt to catalog OP_RETURN prefixes that are already in use, *not* a system for reserving OP_RETURN prefixes! Protocols with no prefix do not use a prefix in OP_RETURN transactions.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Prefix !! Protocol
 +
|-
 +
|    || [https://play.google.com/store/apps/details?id=a.apkt Apekato]
 +
|-
 +
| SPK || [http://coinspark.org/developers/ CoinSpark]
 +
|-
 +
| DOCPROOF || [http://www.proofofexistence.com/ Proof of Existence]
 +
|-
 +
| CryptoTests- || [http://crypto-copyright.com/ Crypto Copyright]
 +
|-
 +
| CryptoProof- || [http://crypto-copyright.com/ Crypto Copyright]
 +
|-
 +
| BS || [http://blocksignit.com/ BlockSign]
 +
|-
 +
| OA || [https://github.com/OpenAssets/open-assets-protocol/blob/master/specification.mediawiki Open Assets]
 +
|-
 +
| STAMPD## || [http://stampd.io/ stampd]
 +
|-
 +
| Factom!! || [http://factom.org/ Factom]
 +
|-
 +
| FACTOM00 || [http://factom.org/ Factom]
 +
|-
 +
| Fa || [http://factom.org/ Factom]
 +
|-
 +
| FA || [http://factom.org/ Factom]
 +
|-
 +
| tradle || [http://tradle.io/ Tradle]
 +
|-
 +
| LaPreuve || [http://www.lapreuve.net/ LaPreuve]
 +
|-
 +
| hex:5888 || [http://blog.onename.com/blockstore-bitcoin/ Blockstore]
 +
|-
 +
| hex:5808 || [http://blog.onename.com/blockstore-bitcoin/ Blockstore]
 +
|-
 +
| id || [http://blog.onename.com/blockstore-bitcoin/ Blockstore]
 +
|-
 +
| BITPROOF || [https://bitproof.io/ Bitproof]
 +
|-
 +
| S1 || [https://stampery.co/ Stampery]
 +
|-
 +
| S2 || [https://stampery.co/ Stampery]
 +
|-
 +
| S3 || [https://stampery.co/ Stampery]
 +
|-
 +
| S4 || [https://stampery.co/ Stampery]
 +
|-
 +
| S5 || [https://stampery.co/ Stampery]
 +
|-
 +
| ASCRIBE || [https://www.ascribe.io/ Ascribe]
 +
|-
 +
| ProveBit || [https://github.com/thereal1024/ProveBit ProveBit]
 +
|-
 +
| EW  || [http://eternitywall.it/ Eternity Wall]
 +
|-
 +
| CC || [http://colu.co/ Colu]
 +
|-
 +
| omni || [http://www.omnilayer.org/ Omni Layer]
 +
|-
 +
| MG || [http://monegraph.com/ Monegraph]
 +
|-
 +
| RMBd || [https://app.remembr.io/ Remembr]
 +
|-
 +
| RMBe || [https://app.remembr.io/ Remembr]
 +
|-
 +
| ORIGMY || [http://originalmy.com/ OriginalMy]
 +
|-
 +
| BID || [http://bitpos.me/ Identity]
 +
|}
 +
 
 +
== External resources on OP_RETURN ==
 +
=== Viewing OP_RETURN ===
 +
* [http://coinsecrets.org/ coinsecrets.org]: An OP_RETURN transaction explorer]
 +
* [http://bitcoinstrings.com/ bitcoinstrings.com]: A site showing raw strings in Bitcoin transactions
  
 +
=== Explaining OP_RETURN ===
 +
* [https://github.com/coinspark/python-OP_RETURN python-OP_RETURN]
 +
* [http://bitcoin.stackexchange.com/questions/29554/explanation-of-what-an-op-return-transaction-looks-like StackExchange: Explanation of what an OP_RETURN transaction looks like]
 +
* [http://www.slideshare.net/coinspark/bitcoin-2-and-opreturns-the-blockchain-as-tcpip Metadata in the Blockchain: The OP_RETURN Explosion]
 +
* [http://wlangiewicz.com/blog/2014/10/24/how-to-put-custom-messages-into-bitcoin-blockchain-op-return/ How to Put Custom Messages Into Bitcoin Blockchain - OP_RETURN]
 
{{DISPLAYTITLE:OP_RETURN}}
 
{{DISPLAYTITLE:OP_RETURN}}

Revision as of 00:15, 17 July 2018

OP_RETURN is a script opcode used to mark a transaction output as invalid. Since the data after OP_RETURN are irrelevant to Bitcoin payments, arbitrary data can be added into the output after an OP_RETURN. Since any outputs with OP_RETURN are provably unspendable, OP_RETURN outputs can be used to burn bitcoins.

Currently, the default Bitcoin client relays OP_RETURN transactions up to 80 bytes [1], but does not provide a way for users to create OP_RETURN transactions.

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, the use of OP_RETURN continues unabated: while there is no global miner consensus to stop people from embedding arbitrary data in the blockchain if they want to, OP_RETURN is somewhat more efficient in terms of data bytes stored as a fraction of blockchain space consumed. Compared to some other ways of storing data in the blockchain, OP_RETURN has the advantage of not creating bogus UTXO entries. Discussion on GitHub pull request

The creation of OP_RETURN outputs also destroys Bitcoins used in the outputs of OP_RETURN transactions, which contributes to future deflationary pressures.

From Bitcoin Core release 0.9.0:

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.

OP_RETURN applications

OP_RETURN is used for writing human-language messages, digital asset proof-of-ownership, and storing data. Its use has been proposed for P2P application discovery. See the "prefixes" table below.

OP_RETURN prefixes

Often, OP_RETURN transactions include a prefix to identify which protocol they belong to. There is no standardized method of claiming OP_RETURN prefixes, and not all OP_RETURN transactions use prefixes. At the time of writing, this wiki page is probably the most complete list of OP_RETURN prefixes. Note that this table is an attempt to catalog OP_RETURN prefixes that are already in use, *not* a system for reserving OP_RETURN prefixes! Protocols with no prefix do not use a prefix in OP_RETURN transactions.

Prefix Protocol
Apekato
SPK CoinSpark
DOCPROOF Proof of Existence
CryptoTests- Crypto Copyright
CryptoProof- Crypto Copyright
BS BlockSign
OA Open Assets
STAMPD## stampd
Factom!! Factom
FACTOM00 Factom
Fa Factom
FA Factom
tradle Tradle
LaPreuve LaPreuve
hex:5888 Blockstore
hex:5808 Blockstore
id Blockstore
BITPROOF Bitproof
S1 Stampery
S2 Stampery
S3 Stampery
S4 Stampery
S5 Stampery
ASCRIBE Ascribe
ProveBit ProveBit
EW Eternity Wall
CC Colu
omni Omni Layer
MG Monegraph
RMBd Remembr
RMBe Remembr
ORIGMY OriginalMy
BID Identity

External resources on OP_RETURN

Viewing OP_RETURN

Explaining OP_RETURN