<p>That's correct, you'd need to create two separate outputs. 
<code>OP_RETURN</code> and payment outputs are two different output types that cannot be combined.
I don't know what you're trying to do, but generally, it should be unnecessary to provide a comment with a payment. All the payment related communication would already have been done out of band with the recipient finally providing an invoice address. Given the payer sending the payment to that invoice address, the payment is clearly associated with the invoice.</p>

<p>Note that any bitcoins included in the <code>OP_RETURN</code> output are burned and become unspendable. (H/T Jose Fonseca)</p>

CC BY-SA 4.0
2019-10-23T16:18:42.803Z
My idea was for an on chain tipping system.  I want to send your public address 0.00001 btc for this cool answer.  I also want some way of you tracing it back to me and/or me telling you which answer it was i'm tipping for.  It's only polite.  And, it seems, impossible.
ThirdPrize
CC BY-SA 4.0
2019-10-23T16:47:10.573Z
@ThirdPrize It's not impossible at all.  You can simply use `OP_RETURN` as indicated, but it is generally unnecessary.  Addresses should [not be reused](https://bitcoin.stackexchange.com/a/44246/13440) so the recipient should give you a unique address.  If you send bitcoins, they know it was you.  A third option is to [sign a message using the private key](https://bitcoin.stackexchange.com/a/21651/13440) corresponding to the address you are sending from (if it is just one address).  Then send that to the person you want to prove the payment to (via email, etc).
Jonathan Cross
CC BY-SA 4.0
2019-10-23T21:39:13.810Z
Yeah, I agree with Jonathan. The message could just be posted off-chain and each post could have a separate address. Also, note that 1,000 sats are less than one magnitude greater than the cost of spending 1,000 sats. Transaction fees are likely cost-prohibitive for on-chain tipping (at least on Bitcoin).
Murch
CC BY-SA 4.0
2019-10-23T14:43:09.413Z
2019-10-23T14:43:09.413Z
Murch
<p>I am using NBitcoin to write some code.  I want to send some bitcoin to an address AND include a message with it.  The message could say who the payment came from or why it was sent.  According to the demos, a txOut can have a destination or a message but not both.  Both are stored in the ScriptPubKey.  </p>

<p>Edit.
Someone suggested I could use two Outputs, one for the payment and one for the message, but that doesn't seem to suggest there is a link between the two.</p>

CC BY-SA 4.0
2019-10-22T15:08:14.117Z
What do you mean with "message"? Are you talking about an `OP_RETURN`?
Murch
CC BY-SA 4.0
2019-10-22T18:28:41.223Z
I mean this 
 https://programmingblockchain.gitbook.io/programmingblockchain/bitcoin_transfer/spend_your_coin#message-on-the-blockchain a note relating to that payment.
ThirdPrize
CC BY-SA 4.0
2019-10-22T21:26:51.557Z
Okay, I had a look and what you linked appears to refer to an `OP_RETURN`, so I added the tag. What you state is correct, you can either send an amount to an address in an output, or send an `OP_RETURN`. You would need to create two outputs, one to send the bitcoins, one to create the `OP_RETURN`. Was that your question? Could you please edit your question post to clarify what your question is?
Murch
CC BY-SA 4.0
2019-10-23T02:19:42.237Z
**Warning**: Make sure to include the amount in a different output than the message. Do not include the amount you wish to send in the OP_RETURN output or you'll burn all the BTC in that output.
Jose Fonseca
CC BY-SA 4.0
2019-10-23T09:45:04.557Z
Edited.  So there is no way of including a comment in an payment?  That's a bit naff.
ThirdPrize
<transactions><op-return><nbitcoin>
Send payment and message at the same time
ThirdPrize
# Send payment and message at the same time

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

I am using NBitcoin to write some code. I want to send some bitcoin to an address AND include a message with it. The message could say who the payment came from or why it was sent. According to the demos, a txOut can have a destination or a message but not both. Both are stored in the ScriptPubKey.

Edit.
Someone suggested I could use two Outputs, one for the payment and one for the message, but that doesn't seem to suggest there is a link between the two.

**Tags:** transactions, op-return, nbitcoin

> **Comments:**
> **username_1**: What do you mean with "message"? Are you talking about an `OP_RETURN`?  
> **username_0**: I mean this   https://programmingblockchain.gitbook.io/programmingblockchain/bitcoin_transfer/spend_your_coin#message-on-the-blockchain a note relating to that payment.  
> **username_1**: Okay, I had a look and what you linked appears to refer to an `OP_RETURN`, so I added the tag. What you state is correct, you can either send an amount to an address in an output, or send an `OP_RETURN`. You would need to create two outputs, one to send the bitcoins, one to create the `OP_RETURN`. Was that your question? Could you please edit your question post to clarify what your question is?  
> **username_2**: **Warning**: Make sure to include the amount in a different output than the message. Do not include the amount you wish to send in the OP_RETURN output or you'll burn all the BTC in that output.  
> **username_0**: Edited.  So there is no way of including a comment in an payment?  That's a bit naff.  

---

## 1 answers

### Answer by username_1 on 2019-10-23. Score: 0 | Accepted answer

That's correct, you'd need to create two separate outputs.
`OP_RETURN` and payment outputs are two different output types that cannot be combined.
I don't know what you're trying to do, but generally, it should be unnecessary to provide a comment with a payment. All the payment related communication would already have been done out of band with the recipient finally providing an invoice address. Given the payer sending the payment to that invoice address, the payment is clearly associated with the invoice.

Note that any bitcoins included in the `OP_RETURN` output are burned and become unspendable. (H/T username_2 username_2)

> **Comments:**
> **username_0**: My idea was for an on chain tipping system.  I want to send your public address 0.00001 btc for this cool answer.  I also want some way of you tracing it back to me and/or me telling you which answer it was i'm tipping for.  It's only polite.  And, it seems, impossible.  
> **username_3**: @username_0 It's not impossible at all.  You can simply use `OP_RETURN` as indicated, but it is generally unnecessary.  Addresses should [not be reused](https://bitcoin.stackexchange.com/a/44246/13440) so the recipient should give you a unique address.  If you send bitcoins, they know it was you.  A third option is to [sign a message using the private key](https://bitcoin.stackexchange.com/a/21651/13440) corresponding to the address you are sending from (if it is just one address).  Then send that to the person you want to prove the payment to (via email, etc).  
> **username_1**: Yeah, I agree with username_3. The message could just be posted off-chain and each post could have a separate address. Also, note that 1,000 sats are less than one magnitude greater than the cost of spending 1,000 sats. Transaction fees are likely cost-prohibitive for on-chain tipping (at least on Bitcoin).  

---

