I am creating a bunch of NFTs using ERC721.
However I see that many other contracts just use centralized hosts to serve their metadata, which means one day these servers will be gone and so will the NFTs...
Eg. Bored Apes collection does it like this:
- https://us-central1-bayc-metadata.cloudfunctions.net/api/tokens/1
- https://us-central1-bayc-metadata.cloudfunctions.net/api/tokens/2
- ...
I wanted to upload the metadata to the IPFS, with the images as well, and it seems there is a service that already does that very easily: https://nft.storage/
However, there is still a problem...
From what I understood, this nft.storage solution still generates URLs like:
ipfs://bafyreib4pff766vhpbxbhjbqqnsh5emeznvujayjj4z2iu533cprgbz23m/metadata.json
Which means I need to store a big URI per NFT in my ERC721 contract (the bafyreib4pff766vhpbxbhjbqqnsh5emeznvujayjj4z2iu533cprgbz23m
part).
This will basically kill the project due to the high storage cost/gas fees on the ETH mainnet.
So my question is: Is there a way to generate links that share the same base URI, but then I am allowed to chose the suffix part? Eg. To me this would be the ideal scenario:
ipfs://<SAME HASH ON ALL URLs>/tokens/1.json
ipfs://<SAME HASH ON ALL URLs>/tokens/1.jpg
ipfs://<SAME HASH ON ALL URLs>/tokens/2.json
ipfs://<SAME HASH ON ALL URLs>/tokens/2.jpg
...
Is this possible?