I use sendrawtransaction to submitt my transaction and I want to put comment or comment-to in transaction like sendtoaddress fields that store in the wallet and not sent with transactions. I think the "data": "hex" field in createrawtransaction is for this, but I can not use that.

I use the following list as recipients field in createrawtransaction, but I get error: bitcoinrpc.authproxy.JSONRPCException: -8: Invalid parameter, key-value pair must contain exactly one key

 [{'mowMh2bocyV97NUP9vqVsuCPcJ2XhJUuoH': Decimal('0.000123'),
 '2NAJPzU1pVTcNABNrdrD336eRWRrbKBBuSe': Decimal('0.03149347')},
 {'data': 'happy birthday'}]

How to use that? Is there any good idea to do this?


data is meant for OP_RETURN outputs.

You cannot add comments using sendrawtransaction.

  • Do you have any idea to put comment? – H.Mohseni Sep 15 '19 at 11:47
  • Use sendtoaddress, or keep a map of txid:comment in an outside database. – Raghav Sood Sep 15 '19 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.