Can I associate a message with a wallet or transaction on the blockchain?

I’m playing with the idea of cold storage that might be recovered by somebody who isn’t me. I want to store it in a durable way (cryptosteel or similar), but I’d like to also store a message along with it. Rather than buying a second cryptosteel for the message, I’d rather store it on the blockchain and associate it with the stored wallet.

My first thought was to enclose the message in the amounts of the first several transactions on the wallet, but that might be a bit over-engineered if I can somehow inject arbitrary data into the blockchain.

I’ve heard of this kind of thing on other platforms, but I’m having trouble finding anything about it for Cardano. Can I store messages on the blockchain associated with a wallet somehow?

You can encode arbitrary data into a Cardano address, and could associate it with the wallet by sending a small amount of ADA to it.
The person recovering the wallet would have to know where to look and how to decode the message though.
I wrote a Python script to easily generate addresses containing arbitrary data, and another to search for and decode data in a given address. Note that funds sent to the address can’t be sent back, so only send the minimum (0.000001 ADA).

2 Likes

This is exactly what I was hoping to find. Thank you.

1 Like

I believe the recent update is intended to prevent this.

3 Likes

It appears that the update has only reduced the size limit for addresses, so it’s still possible to upload data under 10KB. That should be more than enough room for a message :slight_smile:

I should probably mention that the message would be public and accessible by anyone, so don’t include any private information, unless you plan to encrypt it first.

1 Like

I had assumed so, but thanks. And yeah, 10kb is worlds beyond what I need. I’m imagining something like: “This wallet’s recovery seed is also the password for password manager X with user Y”–just a few bytes and secrets not included.

Since it seems that an update was made to put a cap on this, it makes me wonder: is doing this somehow being a bad citizen? I imagine transaction fees are somehow appropriate to offset the load on the system…

This is part of a scavenger hunt designed to promote computer literacy among high schoolers, if there’s a moral hazard in here somewhere I ought to make it explicit–they’ll find a way to abuse it otherwise.

is doing this somehow being a bad citizen?

I don’t think so. I think the concern was that someone would upload something illegal, if you’re not doing that then I can’t see how it would be a problem. As you said, you pay the transaction fees for the data you include in the transaction.

This is part of a scavenger hunt designed to promote computer literacy among high schoolers, if there’s a moral hazard in here somewhere I ought to make it explicit–they’ll find a way to abuse it otherwise.

That’s awesome, sounds like a fun way to learn about crypto and scripting.
I’m sure there’s still plenty of ways you could abuse 10KB. I think the only way to prevent abuse would be at the protocol level, unfortunately. Hopefully IOHK can figure something out. The attributes in a HD wallet address are encrypted though, so I’m not sure if there’d be a way to tell legitimate data from anything else.

1 Like