I'm assuming payment IDs are viewable publicly. Is there a way to encode an ASCII message in the payment ID and make it viewable publicly on the blockchain?
2 Answers
Old style 256-bit payment ids are not encrypted. New style 64-bit payment ids are encrypted such that only the recipient can view it.
Monero transactions also have a tx_extra field that you can put whatever extra information you want into, so you are not limited to a message length of 256 bits. Doing this would require you to modify the Monero wallet software unless someone else has already implemented this functionality in their own wallet software for you to use.
Since all blockchain viewers I know of will only display hex and not ascii representations of the tx_extra field, you will have to ask the recipients of messages to use a site such as this to view the hex as ascii characters https://www.rapidtables.com/convert/number/hex-to-ascii.html
Edit: as pointed out in the other answer in this thread, xmrchain.net will display the ASCII representation of the unencrypted 256-bit payment id field. However it will not display the ASCII representation of the entire tx_extra field, so if you create a custom tx_extra field then the recipient will still need to use a hex to ascii converter.
Putting messages into Monero transactions is not something that should be encouraged, since it makes certain transactions stand out on the blockchain as different to other transactions. If too many people start doing this, there would be a good argument for either preventing this functionality (via a consensus algorithm change) or for creating a special new transaction type purely for publishing messages where those special transactions would not ever be referenced by other regular transactions.
As you suspected, long form payment IDs are unencrypted (and deprecated), so they will appear in the clear on the blockchain. They are arbitrary data, so you can put any message you feel like. Long form payment IDs are 256 bits in length, which can fit 32 ASCII characters (you can fit more of them if you encode it in a non standard way, but that'd require readers to perform a decode step).
For convenience, xmrchain.net displays payment IDs as ASCII, eg:
https://xmrchain.net/tx/3fddc1797e0873bb8686e77555d69e88cb47cfc485f5155280b6fe5f284d0710
Since they're pretty much always not ASCII data, they display as gibberish, but there are a few known transactions using this field to carry ASCII. A related anecdote: most amusingly, the Shadow Brokers seemed to think this field was encrypted and asked people to place their email address there. I don't know whether anyone did though.
-
Ah thanks, I didn't notice that xmrchain had the ascii feature– knacccCommented Sep 15, 2018 at 18:53