On Chain Data
Overview
Chia’s NFT standard stands out as one of the best, offering robust features like the ability to include additional data and metadata URLs as backups in case the original URLs become inaccessible. But what happens if the final URL goes offline without you noticing? Did you ensure a copy of the original image and its metadata is safely stored elsewhere? If not, you could be out of luck.
To solve this, we designed a system that securely stores both the exact image and all the associated metadata directly on the blockchain, while keeping NFTs efficient and flexible. Embedding the entire image in the NFT itself, such as through a data URI, isn’t practical — especially as transactions on Chia will increasingly require fees. Including all of that data in every transaction would quickly become unsustainable.
Instead, we embedded the image data and metadata in a structured sequence of blockchain transactions that are easy to follow. Here’s how it works:
- First, we created transactions to store all the image data, with each chunk linked in order.
- After all the image data was stored, we created a single transaction containing a bulk list of metadata objects, where each object represents the metadata for one NFT.
- Finally, we minted the NFTs themselves, linking them directly to the stored images and metadata.
This setup ensures a straightforward and organized connection between the NFTs and their data. Even if external links to the image or metadata are lost, you can always trace back through the NFT’s history to recover both the image data and metadata. This design guarantees your NFTs remain secure, accessible, and verifiable.