Upload to IPFS

What is IPFS?

In general, blockchains do not store large quantities of data (onchain) because it is quite expensive. Instead of storing the content of your image or video on the blockchain, you’ll want to store the content on IPFS (offchain) to be decentralized, and provide the IPFS URI to your content in the metadata of the NFT token.

The easiest way to upload your content to IPFS is through the use of Pinata, a 3rd party IPFS storage company.

Pinning Your Collection on Pinata

Create an account

Visit the Pinata website

Click on Try For Free button which will take you to a registration page, fill all the details. A confirmation code will be sent to your mail, which you will use to confirm your account. You will be redirected to dashboard on successful registration

Upload Files

You can upload either a file or folder containing all your arts.

For a file: Click on the upload button > File > Select File > Enter file name > upload.

For a folder: Click on the upload button > Folder > Select a folder to upload > Enter folder name > >upload.

On successful upload a success message will display, and the new added file will display in dashboard.

Files Break Down

Now your file has been fully uploaded clicking on the file name will open the file in new tab, where you will see the newly uploaded file. You can see on your screen:

CID — hash of the file uploaded (the one we will use for our metadata) More — give more controls like edit name, delete file and share.

You can now access your new file on IPFS link using https://gateway.pinata.cloud/ipfs/CID.

In case of folders you can now access your new files on IPFS link using https://gateway.pinata.cloud/ipfs/CID/numberOfFile.

Replace the CID with your file CID, congratulations you just uploaded your first file on IPFS.

NFT MetaData

For NFTS - you will have to upload two folders. A folder containing all the jsons metadata of your collection. Another folder containing the images like the picture above.

Metadata is a JSON file which allows applications like OpenSea, Rarible and other Marketplace to pull in the data for digital assets and easily display them in-app. Though different platform have their meta data standard, here is a link to opensea standard.

The metadata should look like this for a single file:

"name" : // Collection Name
"description": // Description of your collection
"image" : // URL to image on IPFS
"name" : "My First Upload",
"description": "my first upload",
"image" : "ipfs://QmYmfHMJiEipeXC94iGHPixR4jcDDUP4CcQNTiFWMk6iNb/1.png"

Well done!

You have successfully uploaded your collection to IPFS and are ready to use it in your contract.

Last updated