I’m wanting to be able to create an ERC20 token that stores a 25 character long string with it. Just wondering if this is actually possible? Also if it is possible I’m gathering from the posts I’ve read similar to it you would need to pay additional gas for it, would that cost be expensive if I was to have a lot of tokens? (Eg. > 10,000 unique tokens)


No, the ERC20 token standard is for fungible tokens. This means that each token is identical to the other.

You may want to investigate the ERC721 standard which is still in development. This allows for non-fungible tokens.

This standard includes an interface for ERC721Metadata, which adds the tokenURI function, which should return the URI to metadata for any specific token (in a format provided in the aforementioned link). This is to minimise storing actual data on the ETH blockchain.

Although the ERC721 standard doesn't provide functionality for adding a string to each token, you could certainly add this functionality in yourself. Provided it was extra to the required ERC721 standard, and didn't require you to break any rules set out by the standard, your token would still be ERC721 compliant.

Whether this would require multiple transactions or a single transaction to apply all the strings to the different tokens would depend on how you chose to code it. But I suspect that no matter what, unless there were very strong repeating patterns in the strings, the gas cost would increase with more tokens.

  • How does something like cryptocritties store there genes of the kitties on the block chain then?
    – Matt
    Apr 7 '18 at 4:19
  • Although I am not overly familiar with cryptokitties or its inner workings, I believe the genes of the kitties are stored on chain as hexadecimal numbers. And I think they have to manually create each kitty. But in any case, I think the ERC721 token specification was originally inspired by cryptokitties, so this is your best bet if you're trying to do something similar. Apr 7 '18 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.