# Suggestion: Base64 Image in Token Info JSON

**URL:** <https://forums.counterparty.io/t/suggestion-base64-image-in-token-info-json/1495>\
**Category:** Counterparty\
**Created:** [September 8, 2015, 6:13pm UTC](https://forums.counterparty.io/t/suggestion-base64-image-in-token-info-json/1495 "2015-09-08T18:13:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [September 8, 2015, 6:13pm UTC](https://forums.counterparty.io/t/suggestion-base64-image-in-token-info-json/1495/1 "2015-09-08T18:13:35Z")

</div>

> 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](http://www.mydomain.com/foo.json)) as the description.

[http://counterparty.io/docs/enhanced\_asset\_info/](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](https://forums.counterparty.io/t/blockchain-validated-asset-metadata-bvam/1443)

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](http://www.rapidtables.com/web/tools/base64-decoder-encoder.htm).

![](https://canada1.discourse-cdn.com/flex004/uploads/counterpartytalk/original/1X/0bdb168ab60a5df87f0f87d25d3d1642fe626fe7.PNG)

---

<div class="post-metadata">

**Author:** ![something](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/something/32/240_2.png) [@something](https://forums.counterparty.io/u/something)\
**Post date:** [September 9, 2015, 2:40pm UTC](https://forums.counterparty.io/t/suggestion-base64-image-in-token-info-json/1495/2 "2015-09-09T14:40:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![loon3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/loon3/32/1018_2.png) [@loon3](https://forums.counterparty.io/u/loon3)\
**Post date:** [September 12, 2015, 3:15pm UTC](https://forums.counterparty.io/t/suggestion-base64-image-in-token-info-json/1495/3 "2015-09-12T15:15:07Z")

</div>

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](http://xcp.ninja/indextest.html)
