0
votes

Can someone please explain the specifics of how NFT metadata is stored (both on and off chain examples?) and how it's called by apps like Opensea or Decentlraland?

Additionally, would it be especially challenging to utilize dynamic metadata for an NFT, which updates regularly based on changing smart contract variables, which themselves change due to user interactions with the smart contracts? E.g. imagine an updatable "Countdown" NFT where the jpeg shows a picture of the integer "days until X", which updates each day as time passes but can also updated based on changing X in the NFT smart contacts... made this up on the spot but actually an interesting idea? :)

Is this doable? Are there storage challenges? Do apps call metadata repeatedly or would they call it once and never reflect updates?

1

1 Answers

0
votes

From my understanding you generally set a baseURI in a erc721 contract. And then if you have an auto incrementing token id. The first token will be the baseURI plus "1".

In other words: baseURI: "https://myserver.com/api/metadata", tokenId: 1

the token metadata is hosted at https://myserver.com/api/metadata/1

And that takes some storage off the chain, if every token has it's own unique url it adds a bit of unnecessary junk to the chain.