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.

2 Answers2

2

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.

Lauri Peltonen
  • 29,391
  • 3
  • 20
  • 57
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.

William Entriken
  • 4,690
  • 15
  • 42