Filecoin 백서

Filecoin

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 52쪽 중 21쪽

y is reported as not a document of record. ## What each layer provides | Layer | Role | | --------------- | ---------------------------------------------------- | | **Avalanche** | Asset state, transactions and the onchain reference | | **IPFS** | Content addressing and integrity verification | | **Filecoin** | Durable storage backed by cryptographic proofs | | **Application** | Connects the onchain asset to its underlying records | Verification here means that particular content was persisted and that the retrieved content matches its CID. None of these layers judges whether a deed is legitimate. ## Built for assets that depend on offchain truth Real-world assets often depend on supporting data that cannot or should not be stored directly onchain. A content-addressed storage layer creates a durable connection between an onchain asset and those records without asking the blockchain itself to hold them. * **Integrity.** Know whether the underlying record has changed. * **Persistence.** Reduce dependence on a single application's database or cloud provider. * **Portability.** Reference the same content-addressed data across applications and infrastructure. ### Example: tokenized real estate A tokenized property can reference many offchain records throughout its lifecycle: deeds, parcel data, appraisals, inspections, certifications and disclosures. Rather than placing those documents directly onchain, an RWA platform can content-address them with IPFS, persist them on Filecoin, and reference their CIDs from its Avalanche application. This reference implementation was developed to explore architectures for real-world asset platforms building on Avalanche. ## Build this pattern Explore the implementation, run the demo, or adapt the architecture for your own RWA application. * [View on GitHub](https://github.com/SgtPooki/Avalanche-IPFS-Filecoin-RWA-reference-Architecture) * [Architecture: what is stored where](https://github.com/SgtPooki/Avalanche-IPFS-Filecoin-RWA-reference-Architecture#what-the-issuer-publishes) * [Run the demo](https://github.com/SgtPooki/Avalanche-IPFS-Filecoin-RWA-reference-Architecture#verify-the-example) * [Implementation guide](https://github.com/SgtPooki/Avalanche-IPFS-Filecoin-RWA-reference-Architecture#fork-map) The implementation stores bytes with [Filecoin Onchain Cloud](https://docs.filecoin.cloud/) through the Synapse SDK, anchors a manifest pointer in a plain EVM registry contract on Avalanche, and verifies by re-hashing retrieved bytes and reading data set proof state. It builds on the [Avalanche and Filecoin data bridge](https://www.avalanche.com/about/blog/avalanche-and-filecoin-launch-cross-chain-data-bridge-for-scalable-web3) announced in May 2025. ## Building real-world assets on Avalanche? We're looking for RWA teams interested in applying this architecture to production data and helping shape the next generation of Filecoin + IPFS tooling. * [Talk to the Filecoin team](https://filecoin.cloud/contact) * [View the implementation](https://github.com/SgtPooki/Avalanche-IPFS-Filecoin-RWA-reference-Architecture) ### About the demo This open-source demo application was created to illustrate the reference architecture. The property in the example is synthetic. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/build/cookbook/rwa-reference-architecture) # Filecoin Pin Pin IPFS content to Filecoin using familiar IPFS tools and workflows. {% hint style="success" %} **Production-ready on Filecoin Mainnet** Filecoin Pin is live on Filecoin Mainnet and ready for use. Register for product updates and announcements at [filecoin.cloud](https://filecoin.cloud/). {% endhint %} ## What is Filecoin Pin? Filecoin Pin is a fully decentralised persistence layer for IPFS content, backed by the global network of Filecoin storage providers and cryptographic proofs of storage. When you pin content with Filecoin Pin, your IPFS data gains: * **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. * **Decentralised infrastructure** - Your data is 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** - Keep 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 for anyone who needs reliable, verifiable IPFS pinning: * **People moving from another pinning service** - If you're coming from Storacha, Pinata, or any other IPFS pinning service, Filecoin Pin gives you a place to keep your IPFS content pinned and accessible. * **Developers building on IPFS** - If you're building dApps, websites, AI agents, or other applications that rely on IPFS, Filecoin Pin provides the missing persistence layer with cryptographic guarantees. {% hint style="info" %} **Already have content pinned elsewhere?** This guide focuses on pinning new content. To move CIDs you already have pinned on Pinata, Storacha, or any public IPFS gateway onto Filecoin - without changing those CIDs - see [Migrating IPFS pins to Filecoin Onchain Cloud](/build-on-filecoin/cookbook/filecoin-pin/migrate-ipfs-pins). {% endhint %} ## How to Get Started The fastest path to pinning your first file is the **Getting Started** guide below. It walks you through installing the CLI, connecting your wallet, depositing storage credit, and pinning content - end to end. 1. [**Getting Started**](/build-on-filecoin/cookbook/filecoin-pin/getting-started) - Install Filecoin Pin and pin your first file in around 10 minutes. Start here. 2. [**Migrating IPFS pins to Filecoin Onchain Cloud**](/build-on-filecoin/cookbook/filecoin-pin/migrate-ipfs-pins) - Bring CIDs you have already pinned on IPFS onto Filecoin Onchain Cloud, unchanged. 3. [Filecoin Pin GitHub Actions](/build-on-filecoin/cookbook/filecoin-pin/github-action) - Automate pinning of websites or build artifacts as part of your CI/CD pipeline. 4. [Filecoin Pin dApp Demo](/build-on-filecoin/cookbook/filecoin-pin/dapp-demo) - Run or fork a demo dApp showing browser-based file uploads to Filecoin. 5. [Filecoin Pin for ERC-8004 Agents](/build-on-filecoin/cookbook/filecoin-pin/erc-8004-agent-registration) - Register a trustless autonomous agent on the ERC-8004 Identity Registry with verifiable persistent storage for agent metadata. ## Learn More * [**FAQ**](/build-on-filecoin/cookbook/filecoin-pin/faq) - 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. # Getting Started Install Filecoin Pin, connect your wallet, deposit storage credit, and pin your first file to Filecoin in around 10 minutes. This guide walks you through pinning your first file to Filecoin using the Filecoin Pin CLI. By the end, you'll be set up to: * ✅ Install the Filecoin Pin CLI * ✅ Connect your Ethereum-style wallet on Filecoin * ✅ Deposit storage credit on Filecoin Pay * ✅ Pin a file to Filecoin and retrieve it using standard IPFS tooling *** ## 🚀 Prerequisites Before starting, make sure you have: * **An Ethereum-style wallet on Filecoin** - MetaMask is the easiest option. If you don't have one set up, see [Wallets](/networks-and-tools/assets/wallets) and [Metamask setup](/networks-and-tools/assets/metamask-setup). * **FIL in your wallet** - to pay transaction gas fees on Filecoin. * **USDFC in your wallet** - to pay for storage. USDFC is the stablecoin used by Filecoin Onchain Cloud. The easiest way to get some is to [swap FIL for USDFC on Sushi](https://www.sushi.com/filecoin/swap?token0=NATIVE\&token1=0x80b98d3aa09ffff255c3ba4a241111ff1262f045). * **Node.js 24 or later** - the Filecoin Pin CLI runs on Node.js. Install from [nodejs.org](https://nodejs.org/) or via your package manager. <table data-view="cards"><thead><tr><th></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Filecoin Pin Repository</td><td><a href="https://github.com/filecoin-project/filecoin-pin">https://github.com/filecoin-project/filecoin-pin</a></td><td><a href="https://github.com/filecoin-project/filecoin-pin">https://github.com/filecoin-project/filecoin-pin</a></td></tr><tr><td>Filecoin Pin Support Channels</td><td><a href="https://filecoinproject.slack.com/archives/C07CGTXHHT4">Filecoin Slack - #fil-foc</a></td><td><a href="https://filecoinproject.slack.com/archives/C07CGTXHHT4">https://filecoinproject.slack.com/archives/C07CGTXHHT4</a></td></tr></tbody></table> *** ## 📦 Install the Filecoin Pin CLI Install the CLI globally with npm: ```sh npm install -g filecoin-pin@latest ``` Verify the installation: ```sh filecoin-pin --version ``` To see all available commands at any time: ```sh filecoin-pin --help ``` *** ## 🔐 Connect your wallet The Filecoin Pin CLI signs transactions using your wallet's private key. You provide it as an environment variable - the CLI reads it directly and never stores it on disk. ### 1️⃣ Export your private key from MetaMask {% hint style="danger" %} **Treat your private key like a password.** Anyone with your private key has full control of your wallet and any funds in it. Never paste it into a website, share it over chat, commit it to a repository, or store it in plain text on a shared system. {% endhint %} In MetaMask: 1. Open the MetaMask extension. 2. Click the three dots next to your account name. 3. Select **Account details**. 4. Click **Show private key**. 5. Enter your MetaMask password. 6. Copy the private key shown. The private key is a 64-character hex string, with or without an `0x` prefix. ### 2️⃣ Save or export the private key The Filecoin Pin CLI does not store your key, but a `.env` file is still a local file on disk. Use a private working directory, keep `.env` out of git, and delete the file when you no longer need it. Create a file named `.env` in your working directory containing: ```sh export PRIVATE_KEY="0xYOUR_PRIVATE_KEY_HERE" ``` Then secure it and load it into your shell: ```sh printf '.env\n' >> .gitignore chmod 600 .env source .env ``` For a one-off shell session, you can avoid writing the key to disk and export it directly instead: ```sh export PRIVATE_KEY="0xYOUR_PRIVATE_KEY_HERE" ``` *** ## 💰 Set up payments Filecoin Pin uses [Filecoin Pay](https://github.com/FilOzone/filecoin-pay) to manage storage payments. Before you can pin anything, you need to: 1. Authorise the Warm Storage Service contract to spend USDFC on your behalf. 2. Deposit USDFC into Filecoin Pay so storage providers can be paid. The CLI walks you through both steps interactively. ```sh filecoin-pin payments setup ``` The CLI will guide you through the following stages: #### 1️⃣ Connect and check balances The CLI confirms it can connect to Filecoin Mainnet and reports your wallet's FIL and USDFC balances. {% hint style="info" %} If you don't have enough FIL for gas or USDFC for storage, the CLI will tell you and stop. Top up your wallet and try again. {% endhint %} #### 2️⃣ Review pricing The CLI shows current storage pricing per GiB per month and per TiB per month. Use this to estimate how much USDFC you want to deposit. #### 3️⃣ Choose a deposit amount The CLI asks: **"Would you like to deposit USDFC to enable storage?"** Answer **Yes**. It then shows example monthly costs for common storage amounts (100 GiB, 1 TiB, 10 TiB) so you can pick a sensible deposit. When prompted **"How much USDFC would you like to deposit?"**, enter the amount you want. A first-time deposit of `10.0` USDFC is a reasonable starting point. {% hint style="info" %} **Coming from Storacha?** Refer to the email we sent you for the specific USDFC amount we'd recommend depositing for your dataset size. {% endhint %} #### 4️⃣ Confirm the deposit The CLI submits the deposit transaction onchain and shows the transaction hash and your new storage capacity. {% hint style="success" %} You should see something like: ``` ✓ Deposit complete Deposit tx: 0x1234...abcd New Storage Capacity: Total deposit: 10.00 USDFC Capacity: ~XX GiB for 1 month ``` {% endhint %} *** ## 💵 Top up your runway (optional) If you want to ensure your deposit covers a specific number of days at your current storage usage, run: ```sh filecoin-pin payments fund --days 30 ``` This deposits (or withdraws) the right amount of USDFC to give you exactly 30 days of runway based on what you're currently storing. You can use any number of days you like. To check your current deposit balance, runway, and payment status at any time: ```sh filecoin-pin payments status ``` *** ## 📌 Pin your first file Now you're ready to pin. Create a test file: ```sh echo "Hello Filecoin Pin @ $(date)!" > demo.txt ``` Pin it to Filecoin: ```sh filecoin-pin add demo.txt ``` The CLI will: 1. Pack your file into IPFS-compatible format (a CAR file). 2. Select storage providers automatically. 3. Store your file with two providers for redundancy. 4. Verify the upload was advertised to [IPNI indexers](https://github.com/filecoin-project/filecoin-pin/blob/master/documentation/glossary.md#ipni). {% hint style="success" %} You should see something like: ``` ✓ File validated (20 B) ✓ Connected to Filecoin Mainnet ✓ File packed with root CID: bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly ✓ IPFS content loaded (96 B) ━━━ Add Complete ━━━ Root CID: bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly Piece CID: bafkzcibcfab4grpgq6e6rva4kfuxfcvibdzx3kn2jdw6q3zqgwt5cou7j6k4wfq Copies: 2/2 Add completed successfully ``` {% endhint %} The **Root CID** is your IPFS Content Identifier - it's how you'll retrieve your data. Save it somewhere. You can also pin a directory by passing the directory path instead of a file: ```sh mkdir my-data echo "File 1" > my-data/file1.txt echo "File 2" > my-data/file2.txt filecoin-pin add my-data/ ``` *** ## 🌐 Retrieve your file Your file is now retrievable via standard IPFS tooling using its Root CID. For example: ``` https://<YOUR_ROOT_CID>.ipfs.inbrowser.link ``` Or via the dweb.link gateway: ``` https://dweb.link/ipfs/<YOUR_ROOT_CID> ``` Try opening one of those URLs in your browser - your file should load. You can also retrieve it programmatically using any IPFS-compatible client (Kubo, Helia, Lassie, etc.) by referencing the Root CID. *** ## 🛡️ Inspect your storage proofs Filecoin storage providers must cryptographically prove daily that they continue to store your data. You can inspect those proofs and the on-chain payment rails at any time. List the data sets associated with your wallet: ```sh filecoin-pin data-set list ``` Then get the full on-chain detail for a specific data set: ```sh filecoin-pin data-set show <DATASET_ID> ``` This queries the smart contracts directly, so the values are live blockchain state. {% hint style="success" %} You'll see something like: ``` Data Set #279 • live Managed by Warm Storage: yes Pieces stored: 2 Total size: 672.0 B PDP rail ID: 631 Payer: 0xYOUR_WALLET_ADDRESS Payee: 0xPROVIDER_ADDRESS Provider Provider: <provider-name> (ID <N>) Provider Service Service URL: https://<provider-service-url> Min proving period: 30 epochs Pieces #0 CommP: bafkzcib... Root CID: bafybei... ``` {% endhint %} Key things to look for: * **Status: `live`** - your data set is active and being proved. * **PDP rail ID** - your active storage-proof payment rail. * **Min proving period** - how often the provider must submit a fresh proof. * **Provider Service URL** - direct retrieval endpoint for your pieces. * **CommP / Root CID** per piece - the piece CID is what the provider proves; the Root CID is what you use to retrieve. *** ## 🎉 You're Done! You've successfully pinned your first file to Filecoin. You now have: * ✅ The Filecoin Pin CLI installed and configured * ✅ Your wallet connected with funded payments on Filecoin Pay * ✅ Files pinned to two Filecoin storage providers with daily cryptographic proofs * ✅ Your content retrievable via standard IPFS gateways *** ## 🔜 Next Steps * 📖 Run `filecoin-pin --help` to explore advanced usage, including auto-funding and custom provider selection. * 🔍 Want to understand what's happening behind the scenes? Read [Behind the Scenes of Adding a File](https://github.com/filecoin-project/filecoin-pin/blob/master/documentation/behind-the-scenes-of-adding-a-file.md) for a deep dive into each step. * 🤖 Automate pinning in your CI/CD pipeline with the [Filecoin Pin GitHub Action](/build-on-filecoin/cookbook/filecoin-pin/github-action). * 💬 Join the community in Filecoin Slack [#fil-foc](https://filecoinproject.slack.com/archives/C07CGTXHHT4) for help, discussion, and updates. * 🐛 Found a bug or have a feature request? [Open an issue](https://github.com/filecoin-project/filecoin-pin/issues) on GitHub. # Migrating IPFS pins to Filecoin Onchain Cloud Move content you have already pinned on IPFS onto Filecoin Onchain Cloud without changing your CIDs. IPFS2FOC exists to bring content you have already pinned on IPFS onto Filecoin Onchain Cloud. Once your existing CIDs are moved, everything you upload from then on should go through [Filecoin Pin](/build-on-filecoin/cookbook/filecoin-pin). *** ## What is IPFS2FOC? [**IPFS2FOC**](https://github.com/FilOzone/ipfs2foc) is a migration tool that seamlessly transfers content from IPFS to the Filecoin Onchain Cloud. It takes a list of CIDs you already have pinned - whether on a pinning service like Pinata or Storacha, or any public IPFS gateway - and commits that data directly to Filecoin storage providers. Once migrated, your data is paid for onchain and backed by Filecoin's ongoing cryptographic proofs of possession, ensuring verifiable, long-term persistence. {% hint style="info" %} **IPFS2FOC is a bridge, and it is moving.** Bulk migration is actively being moved into a native `filecoin-pin migrate` subcommand, so that migrating an existing inventory and pinning new content end up in one tool. Until that lands, `ipfs2foc` is how you move an inventory across - [migrate from the command line](/build-on-filecoin/cookbook/filecoin-pin/migrate-ipfs-pins/command-line) is the path to use today. {% endhint %} ### Key features and guarantees * **Zero CID changes** - The defining property of IPFS2FOC is that your CIDs are immutable. The tool never re-encodes or re-chunks your data. Every object remains byte-for-byte identical to its original state. * **Preserved links and embeds** - Because your original CIDs are preserved, every existing link, reference, app integration, and web embed you have already published keeps working without modification. * **Identical retrieval** - After the migration, you continue to retrieve your content exactly as you always have: by its original CID, over standard IPFS networks and trusted gateways. * **Verifiable onchain end state** - The end state of your migration is not a dashboard claim. Storage deals, provider commitments, and proofs of possession are verified directly against the Filecoin blockchain itself. *** ## Who is IPFS2FOC for? IPFS2FOC is built for anyone who relies on IPFS for content addressing and wants to move that content wholesale onto Filecoin storage providers, for the verifiable durability, cryptographic guarantees, and decentralized backing they bring. Th
프로젝트로 돌아가기