Another benefit of the CIP proposal is the potential to reduce the total count of uploads to IPFS with minimal impact on the Cardano chain.
A user has a jpg nft set with 3 attributes each with 3 traits (total 9 traits). This would allow for 27 unique nfts
hats: tophat, cap, bald
eyes: sunglasses, sad, happy
body type: ape, fish, turtle
Instead of uploading 27 ipfs images the user uploads the 9 trait images.
What would this look like in the meta?
First lets build our references
"tophat" : "ipfs link to tophat ",
"cap" : "ipfs link to cap !",
"bald" : "ipfs link to bald!",
"sunglasses" : "ipfs link to sunglasses!",
"sad" : "ipfs link to sad!",
"happy" : "ipfs link to happy!",
"ape" : "ipfs link to ape!",
"fish" : "ipfs link to fish!",
"turtle" : "ipfs link to turtle!",
Lets builld a nft of a sad fish wearing a tophat
We would need define a tag ‘type’ in references to tell the viewing application that the jpegs are using ipfs or links and need to be overlaid.
Before finalizing this CIP I would like to come up with other types that could be added to the standard. For example here are some types:
||data is stored at ipfs *probably deprecated by url
||data is found at url
||data is found at api get request
||data is directly in payload as utf-8
||data is in base 64 encoded in payload
||assume data is raw and using the defined media type
1 potential issue is that jpegs don’t overlap naturally. To solve this.
The client side should notice that there are more than 1 references defined and overlay each jpeg in the exact order defined in src. For example we used fish, sad, tophat… thus the client would render the fish, then the sad eyes then finally the tophat.
Obviously this scales if you have 4 attributes each with 10 traits (40 traits total) you can generate 10,000 unique nfts using only 40 ipfs uploads and the referencing method.
We could even define a way to define failbacks… by adding another tag like ‘src’ that points to the failback image if ipfs is corrupt
What if the link fails? Will I lose 10k nfts with hat type X… Not if you use the ‘backup’ (fallback) option.
More details here, in this commit