I'm trying to implement an ERC721 smart contract with some NonFungible token. Some attribute will never change, about "layout/traits" composition, and others will evolve like XP.
For that, it's simple. I just have to upload metadata files into an IPFS bucket and put CID into my contract as constant variable (so even me, the owner of the contract, will not be able to update them).
In this case, the
tokenURI will be simple and always return the same result.
I read about updatable metadata, and 2 solutions exists:
- Re-upload another metadata file in IPFS and update the smart-contract to link another URI for the concerned token.
- Use a centralised database to store all variables and generate the metadata file on requests.
Both solutions will works fine, but owner of my NFTs will have to trust me, and i could update attributes as I want (even decide to transform an extremely rare NFT to a basic one..)
Solutions to have Immutable and Updatable attributes ?
Do we know something who can assure both features ?
I add some ideas, but each one have issues:
I add an idea where the smart contract could look for both Json (immutable data from IPFS and updatable data from centralized server) and send a merged version of the, but I don't think this is possible. I never ear about a Solidity file fetcher or even JSON parser.
Generate 2 tokens linked each other
When a user will mint a token, I'll in fact mint 2. The first one is related to rarities and immutable data on IPFS and the second one contain only attributes like XP from my centralised server. This solution look good but opensea (and others) will not be able to link them together, So will only retrieve data from a single one. Even worse, a user will be able to sell only one of the both token (Or I just make the first salable ? but will not fix the first issue)
Any other solution ?
I may miss something during my search ?
If anyone have any idea, I'll be glad to ear.