Suggestion: Base64 Image in Token Info JSON

When initially setting or changing your asset’s (token’s) description, you can enable enhanced functionality (such as an token image and a longer description) by providing a URL to a specially formatted .json file (e.g. http://www.mydomain.com/foo.json) as the description.

http://counterparty.io/docs/enhanced_asset_info/

A link to a 48x48 PNG image can optionally be included in the JSON file. How about also allowing a base64 string representation of the image directly in the JSON?

The advantages are

  • No need to upload the image somewhere
  • Servers won’t need to crawl image urls
  • Image will be immutable with BVAM

The disadvantage is that the base64 string will add about 9000 characters to the JSON file. May be confusing when viewing in a text editor.

Base64 image strings can be encoded online, e.g. here.

Yes, that simplifies things.

Format for Enhanced Asset Info would have to be changed, maybe at the same time with BVAM, and then hopefully the both would pass.

Perhaps a “version” field could be added to JSON format to inform Counterblock how to parse the file.

You could shorten the length a bit more by taking the hash of the string representation of the image. I started working on that here, http://xcp.ninja/indextest.html