<p>Bitcoin Core allows you to create transactions with up to 80 bytes of arbitrary data in an OP_RETURN output. You do this by using the raw transaction process (using <code>createrawtransaction</code> or <code>fundrawtransaction</code>) or the psbt process (using <code>walletcreatefundedpsbt</code>). For all of those commands, when you specify the outputs, you can specify one that is like: <code>{"data":"&lt;hex string&gt;"}</code> where <code>&lt;hex string&gt;</code> is the data you want to send as a hexadecimal string. This will create a transaction with an OP_RETURN output of 0 value with whatever data you specified in <code>&lt;hex string&gt;</code>. The transaction can then be signed and broadcast just like any other raw transaction or psbt.</p>

CC BY-SA 4.0
2019-07-21T00:24:08.903Z
2019-07-21T00:24:08.903Z
Ava Chow
<p>I am using Bitcoin Testnet's command line (and GUI). I am curious how, using my own computer and equipment (I already used a faucet) I could send a transaction easily. I tried <a href="https://github.com/coinspark/python-OP_RETURN" rel="nofollow noreferrer">https://github.com/coinspark/python-OP_RETURN</a> and it failed because it is a newer version of bitcoin. However, I think I could use the CLI to broadcast a message.</p>

<testnet><op-return>
How do I broadcast an OP_RETURN transaction using bitcoin cli
Number File
# How do I broadcast an OP_RETURN transaction using bitcoin cli

(Asked by: username_0 on 2019-07-21)

I am using Bitcoin Testnet's command line (and GUI). I am curious how, using my own computer and equipment (I already used a faucet) I could send a transaction easily. I tried <https://github.com/coinspark/python-OP_RETURN> and it failed because it is a newer version of bitcoin. However, I think I could use the CLI to broadcast a message.

**Tags:** testnet, op-return


---

## 1 answers

### Answer by username_1 on 2019-07-21. Score: 2

Bitcoin Core allows you to create transactions with up to 80 bytes of arbitrary data in an OP\_RETURN output. You do this by using the raw transaction process (using `createrawtransaction` or `fundrawtransaction`) or the psbt process (using `walletcreatefundedpsbt`). For all of those commands, when you specify the outputs, you can specify one that is like: `{"data":""}` where  is the data you want to send as a hexadecimal string. This will create a transaction with an OP\_RETURN output of 0 value with whatever data you specified in . The transaction can then be signed and broadcast just like any other raw transaction or psbt.


---

