0

I've been studying on how devs usually go about handling the metadata for NFT collections and from what I've seen, this reply on this post sums up the whole process:

Best way to set metadata in ERC721 contract on production

My problem is I'm creating a platform where I'm generating NFT's on demand, where the metadata will be created by the users choices, which means that I can't pre upload a folder with all of the NFT's metadata into IPFS.

I thought about creating a script that would use Pinata and upload the NFT's metadata into IPFS as they were being created and posteriorly minted, but if I initially create a folder with 1 NFT's metadata, I'm not able to add any others in the future since IPFS folders are immutable, as far as I saw.

The only option that I thought of would be to, instead have something like a baseURI + tokenID as my IPFS link, I would basically have one baseURI for each NFT's metadata that I would simply upload into IPFS, meaning I would have something like:

https://gateway.pinata.cloud/ipfs/QmfNbehKNVHW888uvFN5ybxtKmmbKRvz3FEw8am5VCTu32

instead of

https://gateway.pinata.cloud/ipfs/QmfNbehKNVHW888uvFN5ybxtKmmbKRvz3FEw8am5VCTu32/1

where each NFT would basically have a different baseURI, that wouldn't really be called baseURI, just using the term as this would be the baseURI if we were using the tokenID in the front.

Would this work? Is there any other way I can actually have a folder that I can update on each token minted?

1 Answer 1

0

There are some people who have done individual token URIs for each NFT rather than having a base uri but you are still in the same boat. Where using a base URI might come in handy is if you have a special function on the NFT contract that allows you to update the base URI and effectively the entire collection if you need to. The only downside is that this can't be done super repeatedly because of gas fees. Most people who want to update things multiple times a day might compromise and use a centralized server.

Also I will add you may want to use the IPFS protocol URI when refencing the CID like so:

ipfs://CID

You can read more about the pros and cons of each approach here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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