How to Store NFT Off-chain Data on Crust

Crust Network
Jun 7 · 5 min read

TL;DR

* NFT off-chain metadata is generally some media files, such as pictures, videos, etc. These files are suitable for storage using IPFS.

* NFT trading platform uses the Crust network to store files, which can ensure accessibility, security and decentralization of the files stored on the IPFS network.

* Crust provides free storage space for early-stage developers. For more details, please visit: http://fs.crust.network/

* NFT trading platform can flexibly customize a more appropriate Crust storage order strategy according to the features of media files on the platform, such as the file size and creation frequency.

The Problem

When the above link becomes the only way to access the NFT media files, the service provider can easily modify or delete the files on the server, thus no one can guarantee that the NFT media files will not be tampered with. On the other hand, if the centralized server is shut down without any reason, or the file is damaged, the NFT metadata will be lost forever.

The Solution

Crust provides accessibility guarantees for the files stored on the IPFS network. Users can store files on the Crust network in a decentralized manner, so that the files can be stored reliably on the IPFS network for a long time.

The following process introduce how the NFT trading platform store the files to the IPFS network through Crust network:

NFT Data Storage Process Based on Crust Network

During the NFT creation process, users need to upload media files, such as pictures and videos corresponding to the NFT to the platform server. (The storage of media files on the NFT trading platform we mentioned here is a kind of cache. After the files are stored on the Crust network in step 3, the NFT media files cached on the platform can be deleted);

2. NFT trading platform upload the media files on the IPFS network

After receiving the users’ files, the NFT trading platform needs to upload them on the IPFS network. If the platform has a local IPFS service, they can upload the local IPFS directly. If not, they can upload the files to IPFS through Gateway.

3. NFT trading platform initiates a storage order on the Crust network

Once the NFT media files are saved on the IPFS network, you will get a CID. Through this CID, you can initiate a storage order on the Crust network. The Crust network node will monitor the storage order and pull the NFT media files corresponding to the order. On average, each order file will be distributed and stored on the Crust network, and finally will be saved on the majority of IPFS nodes.

4. Write the IPFS link corresponding to the NFT in the NFT MetaData

When the media files are stored into the Crust network, users can access these files in the form of IPFS Gateway + file CID. For example, file QmUmfSj43T9fsPSaEgGcrgHH5Wq8KFv48oVXnfY4FXDJZt can be accessed through the link https://ipfs.decoo.io/QmUmfSj43T9fsPSaEgGcrgHH5Wq8KFv48oVXnfY4FXDJZt.

https://decoo is a public Gateway, which can be replaced https://gateway.ipfs.io/, the Gateway provided by the official IPFS or any other public Gateway.

5. NFT trading platform can delete the local cached media files

When the media files are stored on the Crust network, their accessibilities and accessibilities have been guaranteed. Therefore, the NFT trading platform can delete the media files that have been saved by the Crust network.

Some details that can be optimized

For NFT trading platforms that have not applied for free storage space, it is necessary to ensure that there is enough CRU balance to pay for the storage of new files.

It is recommended that developers choose the suitable storage order strategy, thereby reducing the number and costs of storage orders.

We provide free storage service for early developers, but in the long run, we recommend that developers adapt to local conditions and flexibly customize a more appropriate Crust storage order strategy according to the features of media files on the platform, such as the file size and creation frequency.

For example, compared to placing a storage order in Crust for each small file, the NFT trading platform can cache multiple media files in a folder locally, and initiate a storage order for this folder, which can effectively reduce the storage order number, thereby reducing the order fees. Although multiple media files exist in one storage order, each file can still be accessed through its own CID.

The Advantages of NFT Storage on Crust

Users will get multi-point acceleration when accessing NFT media files. As we mentioned above, there are more than 100 copies of NFT media files in the Crust network. When users retrieve files directly through IPFS, they can get multiple transmissions from multiple copy nodes, which increases the download speed.

Based on IPFS, it ensures that NFT media files cannot be tampered with. The feature of IPFS content addressing ensures the correspondence between CID (content ID) and specific data, and ensures that the accessed content cannot be forged.

Website | Twitter | Facebook | Telegram | Discord | Subreddit

CrustNetwork

Decentralized Cloud Blockchain Technology