Skip to main content
IPFS has traditionally been a fully public network, so anything you pin can be accessed by anyone if they have the CID. While this is a benefit for a majority of blockchain applications, there are still cases where true privacy is needed. This is why Pinata has built Private IPFS, a new service that allows you to keep content private and only share when authorized.

Private vs Public Network

Everything in the SDK and API have been separated by two networks: public and private. This means files and groups will be in separate resources and will be accessed by designating the network in either the SDK method or API route.

Uploading

// Uploads a file to Public IPFS
const publicUpload = await pinata.upload.public.file(file)

// Uploads a file to Private IPFS
const privateUpload = await pinata.upload.private.file(file)

Listing and Querying

// List public files
const files = await pinata.files.public.list()

// List private files
const files = await pinata.files.private.list()

Groups

// Create a public group
const group = await pinata.groups.public.create({
	name: "My Public Group",
});

// Create a private group
const group = await pinata.groups.private.create({
	name: "My Private Group",
});

Accessing Private Files

With Public IPFS you can simply access a file through an IPFS Gateway with a CID. Since Private IPFS does not announce to the public IPFS network the only way you can access them is with a temporary access link. This can be generated with either the SDK or the API and set to expire after a designated number of seconds.
const url = await pinata.gateways.private.createAccessLink({
	cid: "bafkreib4pqtikzdjlj4zigobmd63lig7u6oxlug24snlr6atjlmlza45dq", // CID of the file to access
	expires: 30, // Number of seconds the link is valid for
});

Monetizing Private Files

Want to get paid for access to your private content? Check out x402 Monetization, which allows you to attach payment requirements to private files using USDC on Base.

Example Apps

Pinata has built several example apps and tutorials you can reference to see how Private IPFS enables token gated experiences in blockchain and crpto contexts.

PinataCloud/concealmint-client

GitHub repo for CONCEALMINT, an app for creating and access Private NFTs