NFT Storage logo

Free Storage for NFTs

Free decentralized storage and bandwidth for NFTs on IPFS logo IPFS and Filecoin logo Filecoin.

#About

nft.storage is a brand new service in BETA, built specifically for storing off-chain NFT data. Data is stored decentralized on IPFS and Filecoin.

#Store

Just upload your data and you'll receive an IPFS hash of the content (a CID) that can be used in on-chain NFT data as a pointer to the content.

Filecoin provides long term storage for the data ensuring that even if nft.storage is attacked or taken down the NFT data persists!

diagram of storage with nft.storage

#Retrieve

NFT data stored by nft.storage can be accessed from the decentralized IPFS network from any peer that has the content. CIDs reference immutable content so you can be sure the content you access is the content referenced in the NFT.

The data can be fetched directly in the browser using Brave, or via a public IPFS gateway, or by using IPFS Desktop or the IPFS command line.

diagram of retrieval with nft.storage
diagram of storage and retrieval with nft.storage

#Store

Just upload your data and you'll receive an IPFS hash of the content (a CID) that can be used in on-chain NFT data as a pointer to the content.

Filecoin provides long term storage for the data ensuring that even if nft.storage is attacked or taken down the NFT data persists!

#Retrieve

NFT data stored by nft.storage can be accessed from the decentralized IPFS network from any peer that has the content. CIDs reference immutable content so you can be sure the content you access is the content referenced in the NFT.

The data can be fetched directly in the browser using Brave, or via a public IPFS gateway, or by using IPFS Desktop or the IPFS command line.

#Getting started

  1. Step 1

    Register an nft.storage account so that you can create API access keys.

    arrow down
  2. Step 2

    Create an API access key and note it down.

    arrow down
  3. Step 3

    Choose a method to get your NFT data stored:

#JS Client Library

Install the JS library:

npm install nft.storage

Use the client in Node.js or the browser:

import { NFTStorage, Blob } from 'nft.storage'

const apiKey = 'YOUR_API_KEY'
const client = new NFTStorage({ token: apiKey })

const content = new Blob(['hello world'])
const cid = await client.storeBlob(content)
console.log(cid)

The client can also store directories:

const cid = await client.storeDirectory([
  new File(['hello world'], 'content.txt'),
  new File([JSON.stringify({ owner: '@lucky' })], 'metadata.json')
])

View the full library reference docs.

#Raw HTTP Request

Configure your HTTP client and set the Authorization header:

"Authorization": "Bearer YOUR_API_KEY"

Submit a HTTP POST request to nft.storage/api/upload, passing the file data in the request body. e.g.

curl -X POST --data-binary @art.jpg -H 'Authorization: Bearer YOUR_API_KEY' https://nft.storage/api/upload

Successful requests will receive a HTTP 200 status and application/json response like:

{
  "ok": true,
  "value": { "cid": "bafy..." }
}

Check the API Docs for information on uploading multiple files and the other available endpoints.

#Configure as a Remote Pinning Service

You can use nft.storage as a remote pinning service in IPFS.

ipfs pin remote service add nft.storage https://nft.storage/api YOUR_API_KEY

Use the --help option for information on other remote pinning service commands:

ipfs pin remote --help

#FAQ

#How long will data be stored on nft.storage?

Off-chain NFT data can be stored for FREE on IPFS for as long as this service continues. nft.storage will also use other storage mediums, like Filecoin, to ensure data is persisted longer. If this service is discontinued, 90 days notice will allow users to transition their data to other storage methods. See the Terms of Service for details.