<p>Nothing prevents you to send bitcoins to one of your own addresses. I guess I'd just create a new address on my node with <code>bitcoin-cli getnewaddress</code>, and then create a transaction with 2 outputs :</p>

<ul>
<li>one to the address I just got with my whole input amount (minus mining fees)</li>
<li>another to a "dummy" address (can be one you generated with the same method, you can't spend it anyway!) with OP_RETURN + [your_data], and of course 0 as amount</li>
</ul>

<p>As for the exact way to do this, the post you linked too seems like it could work, but I never tested it myself. The idea is to create the transaction first with the <code>createrawtransaction</code> method from bitcoin-cli, and then modify a piece of the data with yours.</p>

<p>As I said I never did that, I highly suggest you try it out on testnet first, there are many things that could just go wrong.</p>

CC BY-SA 4.0
2019-10-28T11:08:48.847Z
Why the need for the dummy address?
Lance Pollard
CC BY-SA 4.0
2019-10-28T11:13:54.223Z
If you use the `createrawtransaction` method, you need to give it an address to add an ouput. But actually you're right, there's no address in a OP_RETURN output, it's precisely what you will remove when you will put your own data in. See [this transaction](https://blockstream.info/tx/4680112da6af209927ec5d6afdc564a01db8d1e96d5619c61dfc1832ae914606?expand) for example, the 2 OP_RETURN output indeed don't have any addresses associated
Sosthène
CC BY-SA 4.0
2019-10-28T11:05:46.447Z
2019-10-28T11:05:46.447Z
Sosthène
<p>You send the change (any amount left over from your input after the fee) to any address you own. You can send it to the same address that is initiating the transaction, or to any other address in your wallet.</p>

CC BY-SA 4.0
2019-10-28T11:10:47.260Z
Do I need a second dummy address, as other examples sometimes show?
Lance Pollard
CC BY-SA 4.0
2019-10-28T11:16:04.460Z
The example only calls it that so that you know to replace it with an address you own. Any address from  your wallet will work.
Raghav Sood
CC BY-SA 4.0
2019-10-28T11:03:37.567Z
2019-10-28T11:03:37.567Z
Raghav Sood
<p>I simply want to store one small string in the blockchain. That's it. I am reading <a href="https://bitcoin.stackexchange.com/questions/25224/what-is-a-step-by-step-way-to-insert-data-in-op-return">here</a> a step by step guide but there is little in terms of explanation beyond the code snippets. What I would like to know is if essentially the problem is this...</p>

<p>There are two parties: me and someone else. I need to somehow get that "someone else's" address, and can figure out the rest from there.</p>

<p>But the main problem is, I don't have any "someone else" I would like to send the money to (or even need to send money to). I simply want to place something in the blockchain.</p>

<p>How are people doing this in their tutorials? Who are they sending the money to? Are they just creating a "dummy transaction" against a "dummy address" of some sort, and then getting a refund of the money? That way it seems the data would still be in the blockchain, but then no money would be spent (other than a potential processing tax fee).</p>

<p>If so, how do I do that? Am I supposed to setup two bitcoin networks, and send data from one to the other? That is, create a transaction of sending money from one to the other? Or perhaps even easier (though not possible?), I can get two addresses from my bitcoin node, and then send money from one of those addresses to another. Is that possible?</p>

CC BY-SA 4.0
2019-10-28T15:38:44.950Z
Why do you want to store data on the blockchain? It is not designed for that. OP_RETURN is for attaching data to transactions. If you have no transaction to make, what do you need to store along with it? Many of your misunderstandings seem to based on the fact that you're trying to do something the system wasn't designed for.
Pieter Wuille
<transactions><address>
Who do I send money to if I want to create an OP_RETURN transaction
Lance Pollard
# Who do I send money to if I want to create an OP_RETURN transaction

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

I simply want to store one small string in the blockchain. That's it. I am reading [here](https://bitcoin.stackexchange.com/questions/25224/what-is-a-step-by-step-way-to-insert-data-in-op-return) a step by step guide but there is little in terms of explanation beyond the code snippets. What I would like to know is if essentially the problem is this...

There are two parties: me and someone else. I need to somehow get that "someone else's" address, and can figure out the rest from there.

But the main problem is, I don't have any "someone else" I would like to send the money to (or even need to send money to). I simply want to place something in the blockchain.

How are people doing this in their tutorials? Who are they sending the money to? Are they just creating a "dummy transaction" against a "dummy address" of some sort, and then getting a refund of the money? That way it seems the data would still be in the blockchain, but then no money would be spent (other than a potential processing tax fee).

If so, how do I do that? Am I supposed to setup two bitcoin networks, and send data from one to the other? That is, create a transaction of sending money from one to the other? Or perhaps even easier (though not possible?), I can get two addresses from my bitcoin node, and then send money from one of those addresses to another. Is that possible?

**Tags:** transactions, address

> **Comments:**
> **username_1**: Why do you want to store data on the blockchain? It is not designed for that. OP_RETURN is for attaching data to transactions. If you have no transaction to make, what do you need to store along with it? Many of your misunderstandings seem to based on the fact that you're trying to do something the system wasn't designed for.  

---

## 2 answers

### Answer by username_2 on 2019-10-28. Score: 1 | Accepted answer

Nothing prevents you to send bitcoins to one of your own addresses. I guess I'd just create a new address on my node with `bitcoin-cli getnewaddress`, and then create a transaction with 2 outputs :

* one to the address I just got with my whole input amount (minus mining fees)
* another to a "dummy" address (can be one you generated with the same method, you can't spend it anyway!) with OP\_RETURN + [your\_data], and of course 0 as amount

As for the exact way to do this, the post you linked too seems like it could work, but I never tested it myself. The idea is to create the transaction first with the `createrawtransaction` method from bitcoin-cli, and then modify a piece of the data with yours.

As I said I never did that, I highly suggest you try it out on testnet first, there are many things that could just go wrong.

> **Comments:**
> **username_0**: Why the need for the dummy address?  
> **username_2**: If you use the `createrawtransaction` method, you need to give it an address to add an ouput. But actually you're right, there's no address in a OP_RETURN output, it's precisely what you will remove when you will put your own data in. See [this transaction](https://blockstream.info/tx/4680112da6af209927ec5d6afdc564a01db8d1e96d5619c61dfc1832ae914606?expand) for example, the 2 OP_RETURN output indeed don't have any addresses associated  

---

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

You send the change (any amount left over from your input after the fee) to any address you own. You can send it to the same address that is initiating the transaction, or to any other address in your wallet.

> **Comments:**
> **username_0**: Do I need a second dummy address, as other examples sometimes show?  
> **username_3**: The example only calls it that so that you know to replace it with an address you own. Any address from  your wallet will work.  

---

