0

I have three questions:

  1. what is the size limit for url field of ERC-721 NFT metadata.
  2. can that url be changed by some smart contract.
  3. can that url and token id be discovered/visible by over smart contracts that operate without token owner awareness.

Thanks in advance for any clarifications.

1

Answers:

  1. The size limit is only the transaction/block size limit. Based on calculations (https://ethereum.stackexchange.com/a/1110/31933) you can fit "780kB (about 3 million gas)" in a block. Nowadays gas limit is about 15 million, so 5 * 780kB = about 4 MB. So you can have a url of about 4 MB - that's a lot of characters.

  2. It can only be changed if the contract has functionality to change it. So it depends on the implementation

  3. This also depends on implementation. I think usually the URL is internal, so other contracts can't see it. But other contracts can query balances and owners of certain tokens, since those are public.

4
  • Thank you for your answer, Lauri. Did I understand correct that processing of such NTF will cost a lot or it doesn't affect transaction price?
    – Max Thraex
    Sep 16 at 11:07
  • Adding data to the blockchain costs quite much, but after it's there, using it doesn't cost that much Sep 16 at 11:52
  • So the only mint NFT operation will be expensive?
    – Max Thraex
    Sep 16 at 13:40
  • Whichever transaction adds the data, pays for it. Sep 16 at 15:04
1

The string size is limited only by the size of strings returnable from transactions.

Because of the Yellow Paper, you will need to store those values in memory before returning, you are limited only by the memory-expansion function.

If you want the strings to be meaningful, the limit is much less.


The contract can change URLs.


Other contracts can query URLs.

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.