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.
OP_RETURN
?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 anOP_RETURN
. You would need to create two outputs, one to send the bitcoins, one to create theOP_RETURN
. Was that your question? Could you please edit your question post to clarify what your question is?