If transaction hashes only are stored in blocks, then where is OP_RETURN data stored?

An answer to a previous question and the whitepaper both agree that blocks don’t store full transactions, but rather, transaction hashes.

So then, what if I add data in OP_RETURN, say, the text “Hello, world!” Isn’t that a transaction output, or at least contained in an output, and therefore part of a transaction?

If not, or if so and only transaction hashes, not transactions themselves persist, then how does the OP_RETURN data stay on the blockchain?

Submit an answer See answers Share on Twitter Share on Facebook
Accepted Answer

Accepted: Miners are not required to store OP_RETURN data

Technically miners only need to store transactions that are part of the current UTXO (unspent transaction output) set. Since the OP_RETURN outputs aren’t spendable they are not required to store them in order to validate new transactions.

Those outputs are part of the blockchain, but since nobody is actually required to store them there is no guarantee that they will be generally available in the future. It is up to people that rely on that data to make sure those transactions get permanently stored.

The assumption is that businesses will emerge that will provide long term storage solutions and you will need to pay them for their services. They could charge per read request, you could pay them to store a transaction for a given amount of time, … One obvious candidate are block explorers (as mentioned by Liam Missin of WhatsOnChain in his CoinGeek Seoul talk).

But where on the blockchain is it stored?

“Those outputs are part of the blockchain” - but, where, in the blocks, as extra branches of Merkle trees?

You are creating this answer as an anonymous user. If you log in we will be able to store the draft as you write it.

Submit an Answer

By swiping I acknowledge that the answer will be immutably stored on the Bitcoin SV blockchain forever and that I take full responsibility for any legal or other consequences that might be related to that.
Made with in Slovenia.