Comment-to in the API

3

1

Sendfrom en senttoaddress both have [comment] and [comment-to] as arguments. Comment uses the script to put in a message, thus in a semi-standardized manner. Does comment-to encrypt the message with that public key? I'm kind of guessing in the dark without any explanation. (I'd suggest the tags API, RPC or JSON-RPC but I've no reputation)

Lodewijk

Posted 2012-01-12T13:21:38.377

Reputation: 1 447

With what public key?David Schwartz 2012-01-13T02:56:59.430

You could specify a target address for you comment. Simply encrypting it using the public key that that address is would make it possible only for the recipient to decode the message. But I'm not sure that's what this actually does, there's no documentation!Lodewijk 2012-01-14T17:41:32.147

2That wouldn't work for two reasons. First, you don't necessarily know the public key. A bitcoin address is not a public key, it's a hash. Second, the public key is useful only to validate signatures, you can't encrypt anything with it. (This isn't RSA, where the public key can be used to encrypt, it's ECDSA, where the public key can only validate signatures.)David Schwartz 2012-01-14T20:56:06.063

Thanks for clearing that up. Any idea what then the comment-to is for?Lodewijk 2012-01-14T21:49:34.367

Answers

12

comment and comment-to are both just stored as text with the transaction. The intent is that comment be used to store what the transaction is for, and comment-to be used to store the name of the person or organization to which you're sending the transaction.

Neither are stored anywhere besides your wallet (they're not sent with transactions), and neither are encrypted in any way.

gavinandresen

Posted 2012-01-12T13:21:38.377

Reputation: 3 254