<p>You are free to design your <code>scriptPubKey</code> for the Output Transaction as you wish. So just a <code>OP_RETURN</code> makes it unspendable.</p>

CC BY-SA 4.0
2019-10-05T13:33:54.453Z
2019-10-05T13:33:54.453Z
user674907
<p>It's storing data on bitcoin blockchain is not a good practice but is possible to create a transaction with a special script.</p>

<p>The transaction name is Transaction null data, a little introduction on this type of the transaction is <a href="https://learnmeabitcoin.com/glossary/nulldata" rel="nofollow noreferrer">here</a></p>

CC BY-SA 4.0
2019-10-05T13:31:54.540Z
2019-10-05T13:31:54.540Z
vincenzopalazzo
<p>Using Bitcoin for data storage is not recommended. However, the cheapest way to do so is by committing data into a custom P2WSH PUSHDATA script and spending it. When you spend this P2WSH output, script bytedata is declared in witness data. Since witness scripts are subject to a consensus limit of 10,000 bytes and a standardness limit of 3600 bytes, the ideal max script construction for storing 3574-bytes should be:</p>
<pre><code>&lt;514-bytes&gt; &lt;510-bytes&gt; &lt;510-bytes&gt; &lt;510-bytes&gt; &lt;510-bytes&gt; &lt;510-bytes&gt; &lt;510-bytes&gt; OP_2DROP OP_2DROP OP_2DROP OP_DROP OP_1
</code></pre>
<p>This construction compiles to a witness script of 3600-bytes. With a %75 discount in witness data, you end up paying for 900 vBytes to store 3574-bytes.</p>

CC BY-SA 4.0
2021-10-24T18:51:17.077Z
2021-10-24T18:59:16.823Z
2021-10-24T18:59:16.823Z
Burak
<p>Is it possible to send a transaction containing hashed values in the body of it to no one? I explain better. I would like to store data on bitcoin and I would need to send a transaction containing this value but not to any specific address. I could i do it?</p>

CC BY-SA 4.0
2019-10-05T16:01:34.750Z
Related: [How do I upload a file to a testnet blockchain](https://bitcoin.stackexchange.com/questions/90000/how-do-i-upload-a-file-to-a-testnet-blockchain/90001#90001). The process is similar.
Ugam Kamat
<transactions>
Send data to bitcoin blockchain
Bruce Wayne
# Send data to bitcoin blockchain

(Asked by: username_0 on 2019-10-05)

Is it possible to send a transaction containing hashed values in the body of it to no one? I explain better. I would like to store data on bitcoin and I would need to send a transaction containing this value but not to any specific address. I could i do it?

**Tags:** transactions

> **Comments:**
> **username_1**: Related: [How do I upload a file to a testnet blockchain](https://bitcoin.stackexchange.com/questions/90000/how-do-i-upload-a-file-to-a-testnet-blockchain/90001#90001). The process is similar.  

---

## 3 answers

### Answer by username_2 on 2019-10-05. Score: 1

You are free to design your `scriptPubKey` for the Output Transaction as you wish. So just a `OP_RETURN` makes it unspendable.


---

### Answer by username_3 on 2019-10-05. Score: 0

It's storing data on bitcoin blockchain is not a good practice but is possible to create a transaction with a special script.

The transaction name is Transaction null data, a little introduction on this type of the transaction is [here](https://learnmeabitcoin.com/glossary/nulldata)


---

### Answer by username_4 on 2021-10-24. Score: 0

Using Bitcoin for data storage is not recommended. However, the cheapest way to do so is by committing data into a custom P2WSH PUSHDATA script and spending it. When you spend this P2WSH output, script bytedata is declared in witness data. Since witness scripts are subject to a consensus limit of 10,000 bytes and a standardness limit of 3600 bytes, the ideal max script construction for storing 3574-bytes should be:
<514-bytes> <510-bytes> <510-bytes> <510-bytes> <510-bytes> <510-bytes> <510-bytes> OP_2DROP OP_2DROP OP_2DROP OP_DROP OP_1

This construction compiles to a witness script of 3600-bytes. With a %75 discount in witness data, you end up paying for 900 vBytes to store 3574-bytes.


---

