Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ redirects:
builder-cookbook/dapps/oracles: build/cookbook/README.md
builder-cookbook/overview: build/cookbook/README.md
builder-cookbook/table-of-contents: build/cookbook/README.md
builder-cookbook/filecoin-pin/dapp-demo: build/cookbook/filecoin-pin/dapp-demo.md
builder-cookbook/filecoin-pin/erc-8004-agent-registration: build/cookbook/filecoin-pin/erc-8004-agent-registration.md
builder-cookbook/filecoin-pin/filecoin-pin-cli: build/cookbook/filecoin-pin/filecoin-pin-cli.md
builder-cookbook/filecoin-pin/github-action: build/cookbook/filecoin-pin/github-action.md
builder-cookbook/filecoin-pin/faq: build/cookbook/filecoin-pin/faq.md
builder-cookbook/filecoin-pin: build/cookbook/filecoin-pin/README.md
community: getting-started/community/forums-and-FIPs.md
community/chat-and-discussion-forums: getting-started/community/forums-and-FIPs.md
community/contribute/contribution-tutorial: getting-started/community/ways-to-contribute.md
Expand Down
6 changes: 6 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@
* [Cookbook](build/cookbook/README.md)
* [Store data](build/cookbook/store-data.md)
* [Retrieve data](build/cookbook/retrieve-data.md)
* [Filecoin Pin](build/cookbook/filecoin-pin/README.md)
* [Filecoin Pin CLI](build/cookbook/filecoin-pin/filecoin-pin-cli.md)
* [Filecoin Pin GitHub Action](build/cookbook/filecoin-pin/github-action.md)
* [Filecoin Pin dApp Demo](build/cookbook/filecoin-pin/dapp-demo.md)
* [Filecoin Pin for ERC-8004 Agents](build/cookbook/filecoin-pin/erc-8004-agent-registration.md)
* [FAQ](build/cookbook/filecoin-pin/faq.md)

## Reference

Expand Down
2 changes: 1 addition & 1 deletion book.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"structure": {
"readme": "WELCOME.md"
},
"plugins": ["filecoin", "-highlight"]
"plugins": ["filecoin", "-highlight", "-search", "-lunr"]
}
1 change: 1 addition & 0 deletions build/cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Practical recipes for building on Filecoin. Each recipe focuses on a specific ta

* [Store data](store-data.md) — recipes for programmable storage of public or private data on Filecoin
* [Retrieve data](retrieve-data.md) — recipes for fetching stored data from the network
* [Filecoin Pin](filecoin-pin/README.md) — recipes for using Filecoin Pin to store and retrieve data on Filecoin Onchain Cloud

[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/build/cookbook/overview)
40 changes: 40 additions & 0 deletions build/cookbook/filecoin-pin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
description: Pin IPFS content to Filecoin using familiar IPFS tools and workflows.
---

# Filecoin Pin

## Status

Filecoin Pin is currently **alpha software** running on the Filecoin Calibration testnet. As of 2025-10-15, it is undergoing active development and not yet recommended for production use. Please register for updates and GA announcement at [filecoin.cloud](https://filecoin.cloud/).

## What is Filecoin Pin?

Filecoin Pin is a fully decentralized persistence layer for IPFS content using the global network of Filecoin storage providers with cryptographic guarantees.

When you use Filecoin Pin, your IPFS files gain:

* **Verifiable persistence** - Storage providers must cryptographically prove daily that they continue to store and serve your data
* **Economic incentives** - You only pay when storage proofs are successfully delivered and verified onchain
* **Decentralized infrastructure** - Your data can be stored across a global network of independent storage providers
* **Sovereign data** - Choose your providers, audit storage proofs and payments onchain, with no dependency on a single company
* **Seamless IPFS integration** - Continue using standard [IPFS Mainnet](https://docs.ipfs.tech/concepts/glossary/#mainnet) tooling like Kubo, Helia, and IPFS HTTP Gateways while gaining Filecoin's persistence guarantees

## Who is Filecoin Pin for?

Filecoin Pin is designed for developers building on IPFS who need trustless, economically-incentivized persistence for their content. Whether you're building dApps, workflows, websites, AI agents, or other applications, Filecoin Pin provides the missing persistence layer for IPFS.

## How to Get Started

Get started using Filecoin Pin today with:

1. [Filecoin Pin CLI](filecoin-pin-cli.md) - Upload new or existing IPFS files directly to Filecoin via the command line. Perfect for developers who want to integrate Filecoin storage into scripts, workflows, or local development environments.
2. [Filecoin Pin GitHub Actions](github-action.md) - Use GitHub Actions to automatically publish websites or build artifacts to IPFS and Filecoin as part of your CI/CD pipeline. Ideal for static websites, documentation sites, and automated deployment workflows.
3. [Filecoin Pin dApp Demo](dapp-demo.md) - Run or fork a simple demo dApp that demonstrates Filecoin Pin in a browser-based application. Great for understanding how to integrate Filecoin Pin into web applications.
4. [Filecoin Pin for ERC-8004 Agents](erc-8004-agent-registration.md) - Learn how to register a trustless autonomous agent on the ERC-8004 Identity Registry with verifiable persistent storage for agent metadata using Filecoin Pin.

## Learn More

* **[FAQ](faq.md)** - Common questions about Filecoin Pin
* **[Filecoin Pin GitHub Repository](https://github.com/filecoin-project/filecoin-pin)** - Source code and technical documentation
* **[Community and Support](https://github.com/filecoin-project/filecoin-pin?tab=readme-ov-file#community-and-support)** - Join the community for real-time developer support and updates.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions build/cookbook/filecoin-pin/dapp-demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
description: See an example of Filecoin Pin working end to end within a web context.
---

# Filecoin Pin dApp Demo

## What You'll Build

In this walkthrough, you’ll build a simple drag-and-drop file uploader that:

* Stores IPFS files directly on Filecoin with built-in payments, all in browser!
* Tracks real-time upload progress through each step
* Retrieves data easily from IPFS Mainnet and the underlying Filecoin Service Provider
* Verifies persistent storage with on-chain Filecoin proofs
* Multi-user support with session-based authentication
* Seamlessly integrates with React, TypeScript, and Vite

## Walkthrough Recording

{% embed url="<https://www.youtube.com/embed/UElx1_qF12o?si=ppmzrl6psMRqwNQh>" %}

## Setup

We will start building by [forking the *filecoin-pin-website demo repo](https://github.com/filecoin-project/filecoin-pin-website/fork).* Make sure you have **Node.js 18+** and **npm 9+** installed. The dapp works with Filecoin Calibration testnet.

This will take ~10min. ⏲️

### Step 1: Fork, Clone, and Install Dependencies

```bash
# Fork the repo using the command below
# or visit [https://github.com/filecoin-project/filecoin-pin-website/fork](https://github.com/filecoin-project/filecoin-pin-website/fork)
gh repo fork filecoin-project/filecoin-pin-website

git clone https://github.com/YOUR-USERNAME/filecoin-pin-website.git
cd filecoin-pin-website
npm install
```

### **Step 2: Set Up Your Filecoin Wallet**

A Filecoin wallet is needed to send transactions on Filecoin and pay for the Filecoin storage service.

This demo dapp supports two authentication methods:

* **Private Key:** easiest for local development and learning.
* **Session Key:** recommended for production deployments - allows multiple users to share one wallet safely.

💡 The demo repo supports deployment with a shared session key, allowing multiple users to safely upload files using the same wallet. It has hardcoded DEFAULT_WALLET_ADDRESS and DEFAULT_SESSION_KEY that are ready to go, but please do NOT use it for production. You can override these defaults with env vars, see instructions [here](https://github.com/filecoin-project/filecoin-pin-website/blob/main/CONTRIBUTING.md#local-setup)!

**2.1 Get test FIL and test USDFC**

If you are using your own wallet, you need to get test FIL and test USDFC to pay for the Filecoin storage service and transactions.

1. Create or use an existing Filecoin wallet on the ****Calibration testnet**** ([such as MetaMask](../../../networks-and-tools/assets/metamask-setup.md)).

2. Visit the [Filecoin Calibration Faucet](https://faucet.calibnet.chainsafe-fil.io/funds.html) to get free test FIL (to pay for transaction gas).

3. Visit the [Filecoin USDFC faucet](https://forest-explorer.chainsafe.dev/faucet/calibnet_usdfc]) to get test USDFC, which is a USD stable coin backed by FIL that can be used to pay for services.

### **Step 3: Run Your dApp**

Fire up your local development server:

```bash
npm run dev
```

Visit `http://localhost:5173` and you should see your dApp running! That is all it takes to set up your app. Now, let’s upload a file to see the magic happen!

## Store IPFS Files on Filecoin

The magic happens in one key file [**`src/hooks/use-filecoin-upload.ts`**](https://github.com/filecoin-project/filecoin-pin-website/blob/main/src/hooks/use-filecoin-upload.ts). This is where your IPFS files get uploaded to Filecoin.

### Step 1: Upload the data

* **Prepare Service** - Validates wallet balance and gets the Filecoin Warm Storage service initialized.
* **Create CAR** - Converts your file to an IPFS CAR (Content Addressed aRchive) file.
* **Upload** - Sends the CAR file to a Filecoin Storage Provider (SP).

![Uploading a file to Filecoin](./assets/pinapp-upload.gif)

### Step 2: Announce CIDs and confirm the transaction

The Filecoin SP:

* indexes the IPFS CAR file and publishes all the contained CIDs to the IPFS network via IPNI.
* commits to the Filecoin network via onchain transactions to store the data. Once the transaction is confirmed, your data is paid to be persisted on Filecoin.

![Publishing CIDs and confirming the transaction](./assets/pinapp-publish.gif)

### Step 3: Download the data

Your data is available from both the IPFS Mainnet network using standard traditional IPFS tooling and/or directly from Filecoin SPs.

![Downloading the stored data](./assets/pinapp-download.gif)

### **Step 4: Verify your data storage**

Filecoin storage providers submit cryptographic proofs regularly onchain to prove that they are storing your data, and you can verify and see it for yourself [on the PDP Scan](https://pdp.vxb.ai/calibration).

![Viewing storage proofs on PDP Scan](./assets/pinapp-viewproof.gif)

That is it - you now have a dapp with a drag-and-drop interface to store IPFS Files on Filecoin!

## Next Steps

1. Check back on the [filecoin-pin-website repo](https://github.com/filecoin-project/filecoin-pin-website) - it will continue to be updated as new functionality is brought to filecoin-pin.
2. Feel free to report any issues with the dApp demo to <https://github.com/filecoin-project/filecoin-pin-website/issues>
3. Check out the the [other example uses of filecoin-pin](../).
4. Ask questions or get help with filecoin-pin in the [supported communcation channels](https://github.com/filecoin-project/filecoin-pin?tab=readme-ov-file#support-info).
Loading