<p>Yes, the OP_RETURN output is part of the blockchain forever.</p>

<p>This is easy to show: the OP_RETURN and the message that follows is part of the transaction's output set, therefore changing the message changes the transaction ID, which in turn will change the hash of the block. If the message were to be deleted after a certain time, then new nodes on the network would fail to sync as they would not be able to validate that block. Therefore all full nodes will retain your message forever (as you mentioned, not in RAM, but buried deep in a file on your hard drive).</p>

<p>As for actually accessing the data, apart from the Blockchain.info API, I guess you could run a <a href="https://toshi.io/" rel="nofollow noreferrer">Toshi</a> node locally (on your own hardware). Since it uses PostgreSQL, you can just query the blockchain as you would any database. This way, you don't depend on any external API that could turn evil or shut down. The hard drive requirements, however, are enormous (even worse than a Bitcoin Core full node).</p>

CC BY-SA 3.0
2016-12-12T05:22:06.997Z
Thanks for the answer, that clears things up a lot. As for Toshi, that's a really interesting project, definitely going to look into it. It says that the Toshi service will be retired in a few days, and it looks like the API has a lot of bugs. Do you know of any similar self-hosted projects that allow the blockchain it to be queried in some way?
thanos
CC BY-SA 3.0
2016-12-12T03:16:20.937Z
2016-12-12T03:16:20.937Z
maservant
<p>I've been doing a lot of reading on OP_RETURN, and I want to understand something that still seems unclear. When we create a transaction with OP_RETURN (which I understand will not eternally pollute node's RAM as the transaction is not put into the UTXO database), is the OP_RETURN data replicated across the blockchain? </p>

<p>This answer from a related question here (<a href="https://bitcoin.stackexchange.com/questions/30752/blockchain-transaction-message-length-limit">Blockchain transaction message length limit</a>) states that the OP_RETURN is <em>not</em> part of the Bitcoin protocol, and the OP_RETURN data can only be accessed using blockchain.info, which doesn't make sense from what I've read, as the code to standardize the number of bytes for OP_RETURN messages is directly within the Bitcoin source-code, and therefore is part of the protocol, right? </p>

<p>TL;DR: I'm trying to make an application which utilizes OP_RETURN, and I would like to know if the OP_RETURN data exists on the blockchain forever, and can be retrieved using APIs other than blockchain.info.</p>

<transactions><blockchain><blockchain.info><protocol><op-return>
Do OP_RETURN messages persist on the blockchain?
thanos
# Do OP_RETURN messages persist on the blockchain?

(Asked by: username_0 on 2016-12-12)

I've been doing a lot of reading on OP\_RETURN, and I want to understand something that still seems unclear. When we create a transaction with OP\_RETURN (which I understand will not eternally pollute node's RAM as the transaction is not put into the UTXO database), is the OP\_RETURN data replicated across the blockchain?

This answer from a related question here ([Blockchain transaction message length limit](https://bitcoin.stackexchange.com/questions/30752/blockchain-transaction-message-length-limit)) states that the OP\_RETURN is *not* part of the Bitcoin protocol, and the OP\_RETURN data can only be accessed using blockchain.info, which doesn't make sense from what I've read, as the code to standardize the number of bytes for OP\_RETURN messages is directly within the Bitcoin source-code, and therefore is part of the protocol, right?

TL;DR: I'm trying to make an application which utilizes OP\_RETURN, and I would like to know if the OP\_RETURN data exists on the blockchain forever, and can be retrieved using APIs other than blockchain.info.

**Tags:** transactions, blockchain, blockchain.info, protocol, op-return


---

## 1 answers

### Answer by username_1 on 2016-12-12. Score: 3 | Accepted answer

Yes, the OP\_RETURN output is part of the blockchain forever.

This is easy to show: the OP\_RETURN and the message that follows is part of the transaction's output set, therefore changing the message changes the transaction ID, which in turn will change the hash of the block. If the message were to be deleted after a certain time, then new nodes on the network would fail to sync as they would not be able to validate that block. Therefore all full nodes will retain your message forever (as you mentioned, not in RAM, but buried deep in a file on your hard drive).

As for actually accessing the data, apart from the Blockchain.info API, I guess you could run a [Toshi](https://toshi.io/) node locally (on your own hardware). Since it uses PostgreSQL, you can just query the blockchain as you would any database. This way, you don't depend on any external API that could turn evil or shut down. The hard drive requirements, however, are enormous (even worse than a Bitcoin Core full node).

> **Comments:**
> **username_0**: Thanks for the answer, that clears things up a lot. As for Toshi, that's a really interesting project, definitely going to look into it. It says that the Toshi service will be retired in a few days, and it looks like the API has a lot of bugs. Do you know of any similar self-hosted projects that allow the blockchain it to be queried in some way?  

---

