Storing data to asset

For the DeadFish parody, I've created a singleton asset with the base64 picture data stored in the description of the asset.
As the asset description allows only 1kb, I was wondering if there's another permanent data field I could bound to an asset to store more than 1kb.

You don't need it to be permanent, it can be a prunable transaction. For example, a tagged data (data cloud) transaction. You can first upload the picture and then store the full hash of the transaction on the asset description effectively linking both together.

1 Like

Hi Sergi! That's a good idea! Was just testing the other way around, which is adding to the data cloud description the asset ID of the "owner".
But I like your way more. :slight_smile: or maybe both so there is a link in both ways.
But if the transaction is prunable, that means that only the creation transaction is pruned, not the data itself, right?

Adding the asset id to the data cloud transaction won't work. Anyone would be able to do so. I could upload a malicious image and add the asset ID to the data cloud description.

Prunable transactions mean the data payload is removed from non-archival nodes, but the transaction itself (the metadata if you want) is kept there along with the hash of the data, the signature, etc. So all nodes could validate the block this transaction is included in.

To validate the transaction itself you could retrieve the pruned data from an archival node and verify the hash matches. You don't need to worry about that, it's automatically done (that's what the retrieve=true parameter on the API calls does).

Yes, that's right. I mean someone could add the full hash of the original image to a fake asset but then my application will not consider that and my deadfish bot anyway has asset approval model for all transactions regarding the asset transfer.
Ok, thanks! :slight_smile:

1 Like