How do I broadcast an OP_RETURN transaction using bitcoin cli 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.
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":"&lt;hex string&gt;"} where &lt;hex string&gt; 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 &lt;hex string&gt;. The transaction can then be signed and broadcast just like any other raw transaction or psbt.