# Table of Contents - [Welcome to Filecoin Docs | Filecoin Docs](#welcome-to-filecoin-docs-filecoin-docs) - [What is Filecoin | Filecoin Docs](#what-is-filecoin-filecoin-docs) - [Crypto-economics | Filecoin Docs](#crypto-economics-filecoin-docs) - [Storage market | Filecoin Docs](#storage-market-filecoin-docs) - [Storage model | Filecoin Docs](#storage-model-filecoin-docs) - [Blockchain | Filecoin Docs](#blockchain-filecoin-docs) - [Networks | Filecoin Docs](#networks-filecoin-docs) - [The blockchain | Filecoin Docs](#the-blockchain-filecoin-docs) - [Retrieval market | Filecoin Docs](#retrieval-market-filecoin-docs) - [Programming on Filecoin | Filecoin Docs](#programming-on-filecoin-filecoin-docs) - [How storage works | Filecoin Docs](#how-storage-works-filecoin-docs) - [Storage onramps | Filecoin Docs](#storage-onramps-filecoin-docs) - [Consensus | Filecoin Docs](#consensus-filecoin-docs) - [Assets | Filecoin Docs](#assets-filecoin-docs) - [Serving retrievals | Filecoin Docs](#serving-retrievals-filecoin-docs) - [Blocks and tipsets | Filecoin Docs](#blocks-and-tipsets-filecoin-docs) - [Interplanetary consensus | Filecoin Docs](#interplanetary-consensus-filecoin-docs) - [How retrieval works | Filecoin Docs](#how-retrieval-works-filecoin-docs) - [Drand | Filecoin Docs](#drand-filecoin-docs) - [Project and community | Filecoin Docs](#project-and-community-filecoin-docs) - [Addresses | Filecoin Docs](#addresses-filecoin-docs) - [Filecoin and IPFS | Filecoin Docs](#filecoin-and-ipfs-filecoin-docs) - [Basic retrieval | Filecoin Docs](#basic-retrieval-filecoin-docs) - [Forums and FIPs | Filecoin Docs](#forums-and-fips-filecoin-docs) - [Proofs | Filecoin Docs](#proofs-filecoin-docs) - [The FIL token | Filecoin Docs](#the-fil-token-filecoin-docs) - [Wallets | Filecoin Docs](#wallets-filecoin-docs) - [Actors | Filecoin Docs](#actors-filecoin-docs) - [Storage proving | Filecoin Docs](#storage-proving-filecoin-docs) - [Saturn | Filecoin Docs](#saturn-filecoin-docs) - [Filecoin compared to | Filecoin Docs](#filecoin-compared-to-filecoin-docs) - [Get FIL | Filecoin Docs](#get-fil-filecoin-docs) - [Related projects | Filecoin Docs](#related-projects-filecoin-docs) - [Quickstart guide | Filecoin Docs](#quickstart-guide-filecoin-docs) - [Filecoin plus | Filecoin Docs](#filecoin-plus-filecoin-docs) - [Transfer FIL | Filecoin Docs](#transfer-fil-filecoin-docs) - [Metamask setup | Filecoin Docs](#metamask-setup-filecoin-docs) - [Filecoin economics | Filecoin Docs](#filecoin-economics-filecoin-docs) - [Filecoin deals | Filecoin Docs](#filecoin-deals-filecoin-docs) - [Social media | Filecoin Docs](#social-media-filecoin-docs) - [Filecoin FAQs | Filecoin Docs](#filecoin-faqs-filecoin-docs) - [FIL collateral | Filecoin Docs](#fil-collateral-filecoin-docs) - [Block rewards | Filecoin Docs](#block-rewards-filecoin-docs) - [The Filecoin project | Filecoin Docs](#the-filecoin-project-filecoin-docs) - [Slashing | Filecoin Docs](#slashing-filecoin-docs) - [Committed capacity | Filecoin Docs](#committed-capacity-filecoin-docs) - [Storage deals | Filecoin Docs](#storage-deals-filecoin-docs) - [Basics | Filecoin Docs](#basics-filecoin-docs) - [Network | Filecoin Docs](#network-filecoin-docs) - [Sealing-as-a-service | Filecoin Docs](#sealing-as-a-service-filecoin-docs) - [Charging for data | Filecoin Docs](#charging-for-data-filecoin-docs) - [Infrastructure | Filecoin Docs](#infrastructure-filecoin-docs) - [Verified deals | Filecoin Docs](#verified-deals-filecoin-docs) - [Storage provider automation | Filecoin Docs](#storage-provider-automation-filecoin-docs) - [PDP | Filecoin Docs](#pdp-filecoin-docs) - [Return-on-investment | Filecoin Docs](#return-on-investment-filecoin-docs) - [Auxiliary services | Filecoin Docs](#auxiliary-services-filecoin-docs) - [Sealing rate | Filecoin Docs](#sealing-rate-filecoin-docs) - [Venus | Filecoin Docs](#venus-filecoin-docs) - [Pre-requisites | Filecoin Docs](#pre-requisites-filecoin-docs) - [Network indexer | Filecoin Docs](#network-indexer-filecoin-docs) - [Storage | Filecoin Docs](#storage-filecoin-docs) - [Full-nodes | Filecoin Docs](#full-nodes-filecoin-docs) - [Skills | Filecoin Docs](#skills-filecoin-docs) - [Backup and disaster recovery | Filecoin Docs](#backup-and-disaster-recovery-filecoin-docs) - [Implementations | Filecoin Docs](#implementations-filecoin-docs) - [Lotus | Filecoin Docs](#lotus-filecoin-docs) - [Snap deals | Filecoin Docs](#snap-deals-filecoin-docs) - [Software components | Filecoin Docs](#software-components-filecoin-docs) - [Sales | Filecoin Docs](#sales-filecoin-docs) - [Industry | Filecoin Docs](#industry-filecoin-docs) - [Network | Filecoin Docs](#network-filecoin-docs) - [Node providers | Filecoin Docs](#node-providers-filecoin-docs) - [Architecture | Filecoin Docs](#architecture-filecoin-docs) - [Sealing pipeline | Filecoin Docs](#sealing-pipeline-filecoin-docs) - [Ways to contribute | Filecoin Docs](#ways-to-contribute-filecoin-docs) - [Security | Filecoin Docs](#security-filecoin-docs) - [Explorers | Filecoin Docs](#explorers-filecoin-docs) - [Lite-nodes | Filecoin Docs](#lite-nodes-filecoin-docs) - [Basic setup | Filecoin Docs](#basic-setup-filecoin-docs) - [Filecoin EVM-runtime | Filecoin Docs](#filecoin-evm-runtime-filecoin-docs) - [Support | Filecoin Docs](#support-filecoin-docs) - [Storage | Filecoin Docs](#storage-filecoin-docs) - [Explorers | Filecoin Docs](#explorers-filecoin-docs) - [Linux | Filecoin Docs](#linux-filecoin-docs) - [Reference architectures | Filecoin Docs](#reference-architectures-filecoin-docs) - [Filecoin programs and tools | Filecoin Docs](#filecoin-programs-and-tools-filecoin-docs) - [The Filecoin Virtual Machine | Filecoin Docs](#the-filecoin-virtual-machine-filecoin-docs) - [dApps | Filecoin Docs](#dapps-filecoin-docs) - [Get test tokens | Filecoin Docs](#get-test-tokens-filecoin-docs) - [Data replication, renewal and repair (RaaS) | Filecoin Docs](#data-replication-renewal-and-repair-raas-filecoin-docs) - [RPCs | Filecoin Docs](#rpcs-filecoin-docs) - [Specifications | Filecoin Docs](#specifications-filecoin-docs) - [Deprecated networks | Filecoin Docs](#deprecated-networks-filecoin-docs) - [Exchanges | Filecoin Docs](#exchanges-filecoin-docs) - [Filecoin EVM runtime | Filecoin Docs](#filecoin-evm-runtime-filecoin-docs) - [Roadmap | Filecoin Docs](#roadmap-filecoin-docs) - [Network performance | Filecoin Docs](#network-performance-filecoin-docs) - [FAQs | Filecoin Docs](#faqs-filecoin-docs) - [Aggregated deal-making | Filecoin Docs](#aggregated-deal-making-filecoin-docs) - [Direct deal-making | Filecoin Docs](#direct-deal-making-filecoin-docs) - [Mainnet | Filecoin Docs](#mainnet-filecoin-docs) - [Tools | Filecoin Docs](#tools-filecoin-docs) - [RaaS interfaces | Filecoin Docs](#raas-interfaces-filecoin-docs) - [Programmatic storage | Filecoin Docs](#programmatic-storage-filecoin-docs) - [Filecoin Pin Github Action | Filecoin Docs](#filecoin-pin-github-action-filecoin-docs) - [Table of Contents | Filecoin Docs](#table-of-contents-filecoin-docs) - [How gas works | Filecoin Docs](#how-gas-works-filecoin-docs) - [Precompiles | Filecoin Docs](#precompiles-filecoin-docs) - [Retrieve Data | Filecoin Docs](#retrieve-data-filecoin-docs) - [Data Storage | Filecoin Docs](#data-storage-filecoin-docs) - [Advanced | Filecoin Docs](#advanced-filecoin-docs) - [Actor types | Filecoin Docs](#actor-types-filecoin-docs) - [Filecoin Pin | Filecoin Docs](#filecoin-pin-filecoin-docs) - [Address types | Filecoin Docs](#address-types-filecoin-docs) - [Fundamentals | Filecoin Docs](#fundamentals-filecoin-docs) - [Calibration | Filecoin Docs](#calibration-filecoin-docs) - [Difference with Ethereum | Filecoin Docs](#difference-with-ethereum-filecoin-docs) - [Developing contracts | Filecoin Docs](#developing-contracts-filecoin-docs) - [Built-in actors | Filecoin Docs](#built-in-actors-filecoin-docs) - [Wrapped FIL | Filecoin Docs](#wrapped-fil-filecoin-docs) - [RPCs | Filecoin Docs](#rpcs-filecoin-docs) - [Decentralized Database | Filecoin Docs](#decentralized-database-filecoin-docs) - [Oracles | Filecoin Docs](#oracles-filecoin-docs) - [FAQ | Filecoin Docs](#faq-filecoin-docs) - [Foundry | Filecoin Docs](#foundry-filecoin-docs) - [Contract automation | Filecoin Docs](#contract-automation-filecoin-docs) - [FILForwarder | Filecoin Docs](#filforwarder-filecoin-docs) - [Multicall | Filecoin Docs](#multicall-filecoin-docs) - [Install & Run PDP | Filecoin Docs](#install-run-pdp-filecoin-docs) - [Chain-Data Query | Filecoin Docs](#chain-data-query-filecoin-docs) - [Overview | Filecoin Docs](#overview-filecoin-docs) - [Using RaaS | Filecoin Docs](#using-raas-filecoin-docs) - [Filecoin.sol | Filecoin Docs](#filecoin-sol-filecoin-docs) - [Cross-chain bridges | Filecoin Docs](#cross-chain-bridges-filecoin-docs) - [Filecoin Pin dApp Demo | Filecoin Docs](#filecoin-pin-dapp-demo-filecoin-docs) - [Remix | Filecoin Docs](#remix-filecoin-docs) - [Aggregated deal-making | Filecoin Docs](#aggregated-deal-making-filecoin-docs) - [Spin up a lite-node | Filecoin Docs](#spin-up-a-lite-node-filecoin-docs) - [Hardhat | Filecoin Docs](#hardhat-filecoin-docs) - [Oracles | Filecoin Docs](#oracles-filecoin-docs) - [Cross-Chain Data Bridge(CCDB) | Filecoin Docs](#cross-chain-data-bridge-ccdb-filecoin-docs) - [General | Filecoin Docs](#general-filecoin-docs) - [Exchange integration | Filecoin Docs](#exchange-integration-filecoin-docs) - [Direct deal-making with Client contract | Filecoin Docs](#direct-deal-making-with-client-contract-filecoin-docs) - [Solidity libraries | Filecoin Docs](#solidity-libraries-filecoin-docs) - [Privacy & Access Control | Filecoin Docs](#privacy-access-control-filecoin-docs) - [Programmatic | Filecoin Docs](#programmatic-filecoin-docs) --- # Welcome to Filecoin Docs | Filecoin Docs ![Page cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-329ac1f55b71664bff9a81b1848bd63911acc83c%252FFilecoinDocs.png%3Falt%3Dmedia&width=1248&dpr=3&quality=100&sign=9fa74d80&sv=2) Choose your own path to start exploring Filecoin: [](https://docs.filecoin.io/basics/what-is-filecoin) 💡 **Learn the basics** New to Filecoin and looking for foundational concepts? Start with the Basics section to understand the essentials and kick off your journey! [](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) 🔧 **Build with Filecoin** Ready to develop on the Filecoin network? Head to the Developers section for guides and examples to help bring your project to life. [](https://docs.filecoin.io/storage-providers/basics) 🏗️ **Become a Storage Provider** Thinking about running a provider node on Filecoin? Visit the Provider section for comprehensive guidance on getting started. [](https://docs.filecoin.io/basics/what-is-filecoin/storage-model) 📊 **Store data** Looking to store large volumes of data? Explore the Store section to review the various storage options Filecoin offers. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/) [NextWhat is Filecoinchevron-right](https://docs.filecoin.io/basics/what-is-filecoin) Last updated 1 year ago --- # What is Filecoin | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin#introduction-to-filecoin) Introduction to Filecoin Filecoin is a peer-to-peer network that enables reliable, decentralized file storage through built-in economic incentives and cryptographic proofs. Clients, or users, pay any number of storage providers, or data centers, to store the client's data --storage providers then provide cryptographic proofs daily as evidence to the clients that the data is still at the data center. Storage providers lock a certain amount of Filecoin as collateral --should they repeatedly fail to provide a proof, their collateral gets burned, serving as a strong deterrent from the data center losing the data. Anyone can join Filecoin as a client looking to store their data, or as a storage provider offering storage services. Storage availability and pricing aren’t controlled by any single entity; instead, Filecoin fosters an open market for file storage and retrieval accessible to all. Clients can review the history of each storage provider, along with their credentials and compliance record, before choosing to store their data with them. Note that most Filecoin nodes are [IPFS protocolarrow-up-right](https://docs.ipfs.tech/) nodes. IPFS is a open system, a hypermedia protocol, to manage data without a central server that makes use of [content addressingarrow-up-right](https://docs.ipfs.tech/concepts/content-addressing/) to provide permanent data references without dependency on specific devices or cloud providers. A client who knows the content address (CID) of their file can retrieve it from any IPFS node (or Filecoin storage provider) that currently has a copy and is able to serve it. Given a CID, the [CID Contactarrow-up-right](https://cid.contact/) network indexer will locate and providing routing details for the relevant file. Historically, IPFS node operators offered pinning services to the community out of interest and often for free, meaning there was no financial incentive for the IPFS node operators to stay online or keep a given file for a long period of time. Filecoin solves this issue by introducing an incentive layer (clients pay storage providers for long term data center use) to ensure more reliable long term cold storage. Since most Filecoin nodes are also IPFS nodes, they can pin a hot copy of the given file to the IPFS node to allow the client to easily retrieve the file later. Filecoin is used as a storage solution for a range of products, including from Web3-native NFT storage, incentivized permanent storage, and archival traditional Web2 datasets. For instance, [NFT.Storagearrow-up-right](https://nft.storage/) leverages Filecoin for NFT content and metadata storage. Organizations such as the [Shoah Foundationarrow-up-right](https://sfi.usc.edu/) and the [Internet Archivearrow-up-right](https://archive.org/) use Filecoin for content preservation and backup. Filecoin is compatible with various data types, including audio and video files. This versatility allows Web3 platforms like [Audiusarrow-up-right](https://audius.co/) and [Huddle01arrow-up-right](https://huddle01.com/) to use Filecoin as a decentralized storage backend for music streaming and video conferencing. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin) [PreviousWelcome to Filecoin Docschevron-left](https://docs.filecoin.io/) [NextCrypto-economicschevron-right](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics) Last updated 3 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Crypto-economics | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#native-currency) Native currency ----------------------------------------------------------------------------------------------------------------- Filecoin’s native currency, FIL, is a utility token that incentivizes persistent storage on the Filecoin network. Storage providers earn FIL by offering reliable storage services or committing storage capacity to the network. With a maximum circulating supply of 2 billion FIL, no more than 2 billion Filecoin will ever exist. As a utility token aligned with the network’s long-term growth, Filecoin issuance depends on the network’s provable utility and growth. Most of the Filecoin supply is only minted as the network achieves specific growth and utility milestones. Filecoin uses a dual minting model for block reward distribution: [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#baseline-minting) Baseline minting ------------------------------------------------------------------------------------------------------------------- Up to 770 million FIL tokens are minted based on network performance. Full release of these tokens would only occur if the Filecoin network reaches a yottabyte of storage capacity within 20 years, approximately 1,000 times the capacity of today’s cloud storage. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#simple-minting) Simple minting --------------------------------------------------------------------------------------------------------------- An additional 330 million FIL tokens are released on a 6-year half-life schedule, with 97% of these tokens projected to be released over about 30 years. Additionally, 300 million FIL tokens are held in a mining reserve to incentivize future mining models. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#vesting) Vesting ------------------------------------------------------------------------------------------------- Mining rewards are subject to a vesting schedule to support long-term network alignment. For instance, 75% of block rewards earned by miners vest linearly over 180 days, while 25% are immediately accessible, improving miner cash flow and profitability. Note that if the miner has incurred "[fee debtarrow-up-right](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) ," the immediately accessible block rewards will automatically go towards paying down those fees. A certain portion of initially printed FIL tokens are vested to Protocol Labs teams and the Filecoin Foundation over six years, and to SAFT investors over three years, as outlined in the [vesting schedulearrow-up-right](https://observablehq.com/@starboard/a-primer-to-filecoin-circulating-supply/2) . To learn more about Filecoin block rewards vesting, review [FIP004: Liquidity Improvement for Storage Minersarrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0004.md) . [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#collateral-and-slashing) Collateral and slashing --------------------------------------------------------------------------------------------------------------------------------- To ensure network security and reliable storage, storage providers must lock FIL as pledge collateral during block reward mining. Pledge collateral is based on projected block rewards a miner could earn. Collateral and all earned rewards are subject to slashing if the storage fails to meet reliability standards throughout a sector’s lifecycle. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#total-supply) Total supply ----------------------------------------------------------------------------------------------------------- FIL’s maximum circulating supply is capped at 2 billion FIL. However, this maximum will never be reached, as a portion of FIL is permanently removed from circulation through gas fees, penalties, and other mechanisms. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics) [PreviousWhat is Filecoinchevron-left](https://docs.filecoin.io/basics/what-is-filecoin) [NextBlockchainchevron-right](https://docs.filecoin.io/basics/what-is-filecoin/blockchain) Last updated 1 year ago * [Native currency](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#native-currency) * [Baseline minting](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#baseline-minting) * [Simple minting](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#simple-minting) * [Vesting](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#vesting) * [Collateral and slashing](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#collateral-and-slashing) * [Total supply](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics#total-supply) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage market | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-market#deal-making) Deal making ------------------------------------------------------------------------------------------------------- The lifecycle of a deal within the storage market includes four distinct phases: * **Discovery**: The client identifies potential storage providers (SPs) and requests their prices. * **Negotiation**: After selecting an SP, both parties agree to the terms of the deal. * **Publishing**: The deal is published on-chain. * **Handoff**: The deal is added to a sector, where the SP can provide cryptographic proofs of data storage. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-market#filecoin-plus) Filecoin Plus ----------------------------------------------------------------------------------------------------------- Filecoin Plus aims to maximize useful storage on the Filecoin network by incentivizing the storage of meaningful and valuable data. It offers verified clients low-cost or free storage through a system called datacap, a storage quota that boosts incentives for storage providers. Verified clients use datacap allocated by community-selected allocators to store data on the network. In exchange for storing verified deals, storage providers receive a 10x boost in storage power, which increases their block rewards as an incentive. * **Datacap**: A token allocated to verified clients to spend on storage deals, offering a 10x quality multiplier for deals. * **Allocators**: Community-selected entities responsible for verifying storage clients and allocating datacap tokens. * **Verified Clients**: Active participants with datacap allocations for their data storage needs. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-market#storage-on-ramps) Storage on-ramps ----------------------------------------------------------------------------------------------------------------- To simplify data storage on the Filecoin network, several tools offer streamlined integration of Filecoin and IPFS storage for applications or smart contracts. These storage helpers provide libraries that abstract the Filecoin deal-making process into simple API calls. They also store data on IPFS for efficient and fast content retrieval. Available storage helpers include: * [lighthouse.storagearrow-up-right](https://www.lighthouse.storage/) : An SDK for builders, providing tools for storing data from dApps. * [web3.storagearrow-up-right](https://web3.storage/) : A user-friendly client for accessing decentralized protocols like IPFS and UCAN. * [Akavearrow-up-right](https://www.akave.ai/) : A modular L2 solution for decentralized data management, combining Filecoin storage with encryption and easy-to-use interfaces. * [Storachaarrow-up-right](https://storacha.network/) : A decentralized hot storage network for scalable, user-owned data with decentralized permissions, leveraging Filecoin. * [Curioarrow-up-right](https://curiostorage.org/) : A next-gen platform within the Filecoin ecosystem, streamlining storage provider operations. * [boost.filecoin.ioarrow-up-right](https://boost.filecoin.io/) : A tool for storage providers to manage data onboarding and retrieval on the Filecoin network. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/storage-market) [PreviousStorage modelchevron-left](https://docs.filecoin.io/basics/what-is-filecoin/storage-model) [NextRetrieval marketchevron-right](https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market) Last updated 1 year ago * [Deal making](https://docs.filecoin.io/basics/what-is-filecoin/storage-market#deal-making) * [Filecoin Plus](https://docs.filecoin.io/basics/what-is-filecoin/storage-market#filecoin-plus) * [Storage on-ramps](https://docs.filecoin.io/basics/what-is-filecoin/storage-market#storage-on-ramps) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage model | Filecoin Docs The Filecoin storage model consists of three main components: * Providers * Deals * Sectors [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#providers) Providers -------------------------------------------------------------------------------------------------- Providers offer storage and retrieval services to network users. There are two types of providers: * Storage Providers * Retrieval Providers ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#storage-providers) Storage providers Storage providers, often called SPs, are responsible for storing files and data for clients on the network. They also provide cryptographic proofs to verify that data is stored securely. The majority of providers on the Filecoin network are SPs. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#retrieval-providers) Retrieval providers Retrieval providers, or RPs, specialize in delivering quick access to data rather than long-term storage. While many storage providers also offer retrieval services, stand-alone RPs are increasingly joining the network to enhance data accessibility. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#deals) Deals ------------------------------------------------------------------------------------------ In the Filecoin network, SPs and RPs offer storage or retrieval services to clients through deals. These deals are negotiated between two parties and outline terms such as data size, price, duration, and collateral. The deal-making process initially occurs _off-chain_. Once both parties agree to the terms, the deal is published _on-chain_ for network-wide visibility and validation. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#sectors) Sectors ---------------------------------------------------------------------------------------------- Sectors are the fundamental units of provable storage where storage providers securely store client data and generate PoSt (Proof of Spacetime) for the Filecoin network. Sectors come in standard sizes, typically `32 GiB` or `64 GiB`, and have a set lifespan that providers can extend before it expires. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/storage-model) [PreviousBlockchainchevron-left](https://docs.filecoin.io/basics/what-is-filecoin/blockchain) [NextStorage marketchevron-right](https://docs.filecoin.io/basics/what-is-filecoin/storage-market) Last updated 1 year ago * [Providers](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#providers) * [Storage providers](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#storage-providers) * [Retrieval providers](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#retrieval-providers) * [Deals](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#deals) * [Sectors](https://docs.filecoin.io/basics/what-is-filecoin/storage-model#sectors) sun-brightdesktopmoon sun-brightdesktopmoon --- # Blockchain | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#blockchain) Blockchain ------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#tipsets) Tipsets A tipset is a set of blocks with the same height, allowing multiple storage providers to produce blocks in each epoch, increasing network throughput. The Filecoin blockchain consists of a chain of tipsets rather than individual blocks. Each tipset is assigned a weight, enabling the consensus protocol to guide nodes to build on the heaviest chain and preventing interference from nodes attempting to produce invalid blocks. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#actors) Actors Actors are ‘objects’ within the Filecoin network, each with a state and a set of methods for interaction, that pass messages to each other and ensure the system operates appropiately. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#built-in-actors) Built-in actors Several built-in system actors power the Filecoin network as a decentralized storage network: * **Init actor**: Initializes new actors and records the network name. * **Cron actor**: Scheduler that runs critical functions at every epoch. * **Account actor**: Manages user accounts (non-singleton). * **Reward actor**: Manages block rewards and token vesting (singleton). * **Storage miner actor**: Manages storage mining operations and validates storage proofs. * **Storage power actor**: Tracks storage power allocation for each provider. * **Storage market actor**: Manages storage deals. * **Multisig actor**: Handles Filecoin multi-signature wallet operations. * **Payment channel actor**: Sets up and settles payment channel funds. * **Datacap actor**: Manages datacap tokens. * **Verified registry actor**: Manages verified clients. * **Ethereum Address Manager (EAM) actor**: Assigns Ethereum-compatible addresses on Filecoin, including EVM smart contract addresses. * **Ethereum Virtual Machine (EVM) account actor**: Represents an external Ethereum identity backed by a secp256k1 key. * **System actor**: General system actor. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#nodes) Nodes Filecoin nodes are categorized by the services they provide to the storage network, including chain verifier nodes, client nodes, storage provider nodes, and retrieval provider nodes. All participating nodes must provide chain verification services. Filecoin supports multiple protocol implementations to enhance security and resilience. Active implementations include: * [Lotusarrow-up-right](https://lotus.filecoin.io/) * [Venusarrow-up-right](https://github.com/filecoin-project/venus) * [Forestarrow-up-right](https://github.com/ChainSafe/forest) ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#addresses) Addresses In the Filecoin network, addresses identify actors in the Filecoin state. Each address encodes information about the corresponding actor, making it easy to use and resistant to errors. Filecoin has five address types. Mainnet addresses start with `f`, and Testnet addresses start with `t`. * `**f0/t0**`: ID address for an actor in a human-readable format, such as `f0123261` for a storage provider. * `**f1/t1**`: secp256k1 wallet address, generated from an encrypted secp256k1 public key. * `**f2/t2**`: Address assigned to an actor in a way that ensures stability across network forks. * `**f3/t3**`: BLS wallet address, generated from a BLS public key. * `**f4/t4**`: Address created and assigned to user-defined actors by customizable "address management" actors. This address can receive funds before an actor is deployed. * `**f410/t410**`: Address space managed by the Ethereum Address Manager (EAM) actor, allowing Ethereum-compatible addresses to interact seamlessly with the Filecoin network. Ethereum addresses can be cast as `f410/t410` addresses and vice versa, enabling compatibility with existing Ethereum tools. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#consensus) Consensus #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#expected-consensus) Expected consensus Expected Consensus (EC) is the probabilistic, Byzantine fault-tolerant consensus algorithm underlying Filecoin. EC conducts a leader election among storage providers each epoch to determine which provider submits a block. Similar to proof-of-stake, Filecoin’s leader election relies on proof-of-storage, meaning the probability of being elected depends on how much provable storage a miner contributes to the network --measured in something called "storage power". The consensus process uses [Drandarrow-up-right](https://drand.love/) as a randomness beacon for leader election, ensuring the leader election is secret, fair, and verifiable. Election participants and their storage power are drawn from a data structure called the "Power Table", which is continuously calculated and maintained by the storage power actor. Ultimately, the EC process ends by gathering all valid blocks produced in an epoch to a tipset, applying a weighting function to select the heaviest chain, and adding the tipset to the heaviest chain accordingly. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#block-production-process) Block production process The block production process for each epoch is as follows: * Elect leaders from eligible miners. * Miners check if they are elected. * Elected miners generate WinningPoSt using randomness. * Miners build and propagate a block. * Verify the winning miner and election. * Select the heaviest chain to add the tipset. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#finality) Finality EC enforces soft finality, where miners at round `N` reject blocks forking off before round `N - F` (where `F` is set to `900`). This ensures finality without compromising chain availability. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#proofs) Proofs Filecoin operates on proof-of-storage, where miners offer storage space and provide proofs to verify data storage. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#proof-of-replication) Proof of replication With proof-of-replication (PoRep), storage providers prove they have created a unique copy of the client’s data for the network. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#proof-of-spacetime) Proof of spacetime Storage providers must continuously prove that they are storing clients' data throughout the entire duration of the storage deal. The proof-of-spacetime (PoSt) process includes two types of challenges: * **Winning PoSt**: Verifies that a storage provider holds a copy of the data at a specific point in time. * **Window PoSt**: Confirms that the data has been consistently stored over a defined period. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#slashing) Slashing If storage providers fail to maintain reliable uptime or act maliciously, they face penalties through a process called slashing. Filecoin enforces two types of slashing: * **Storage Fault Slashing**: Penalizes providers who fail to maintain healthy and reliable storage sectors. * **Consensus Fault Slashing**: Penalizes providers attempting to disrupt the security or availability of the consensus process. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/blockchain) [PreviousCrypto-economicschevron-left](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics) [NextStorage modelchevron-right](https://docs.filecoin.io/basics/what-is-filecoin/storage-model) Last updated 1 year ago * [Blockchain](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#blockchain) * [Tipsets](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#tipsets) * [Actors](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#actors) * [Nodes](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#nodes) * [Addresses](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#addresses) * [Consensus](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#consensus) * [Proofs](https://docs.filecoin.io/basics/what-is-filecoin/blockchain#proofs) sun-brightdesktopmoon sun-brightdesktopmoon --- # Networks | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/networks#mainnet) Mainnet ----------------------------------------------------------------------------------------- [Mainnet](https://docs.filecoin.io/networks/mainnet) is the live production network that connects all nodes on the Filecoin network. It operates continuously without resets. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/networks#testnets) Testnets ------------------------------------------------------------------------------------------- Test networks, or testnets, are versions of the Filecoin network that simulate various aspects of the mainnet. They are intended for testing and should not be used for production applications or services. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/networks#calibration) Calibration The [Calibration](https://docs.filecoin.io/networks/calibration) testnet offers the closest simulation of the mainnet. It provides realistic sealing performance and hardware requirements due to the use of finalized proofs and parameters, allowing prospective storage providers to test their setups. Storage clients can also store and retrieve real data on this network, participating in deal-making workflows and testing storage/retrieval functionalities. Calibration testnet uses the same sector size as the mainnet. * [Public endpointarrow-up-right](https://api.calibration.node.glif.io/rpc/v0) * [Blockchain explorerarrow-up-right](https://calibration.filscan.io/) * [Calibration Faucet - Chainsafearrow-up-right](https://faucet.calibnet.chainsafe-fil.io/) * [Calibration Faucet - Zondaxarrow-up-right](https://beryx.zondax.ch/faucet/) * [Calibration Faucet - Forest Explorerarrow-up-right](https://forest-explorer.chainsafe.dev/faucet/calibnet) * [Calibration USDFC Faucet - Chainsafearrow-up-right](https://forest-explorer.chainsafe.dev/faucet/calibnet_usdfc) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/networks) [PreviousProgramming on Filecoinchevron-left](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin) [NextThe blockchainchevron-right](https://docs.filecoin.io/basics/the-blockchain) Last updated 5 months ago * [Mainnet](https://docs.filecoin.io/basics/what-is-filecoin/networks#mainnet) * [Testnets](https://docs.filecoin.io/basics/what-is-filecoin/networks#testnets) * [Calibration](https://docs.filecoin.io/basics/what-is-filecoin/networks#calibration) sun-brightdesktopmoon sun-brightdesktopmoon --- # The blockchain | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain) [PreviousNetworkschevron-left](https://docs.filecoin.io/basics/what-is-filecoin/networks) [NextActorschevron-right](https://docs.filecoin.io/basics/the-blockchain/actors) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Retrieval market | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market#basic-retrieval-from-filecoin) Basic Retrieval from Filecoin --------------------------------------------------------------------------------------------------------------------------------------------- Currently, Filecoin nodes support direct retrieval from the storage miners who originally stored the data. Clients can send retrieval requests directly to a storage provider and pay a small amount of FIL to retrieve their data. To request data retrieval, clients need to provide the following information to the storage provider: * **Storage Provider ID**: The ID of the storage provider where the data is stored. * **Payload CID**: Also known as Data CID. * **Address**: The address initially used to create the storage deal. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market#hot-retrieval-from-ipfs) Hot Retrieval from IPFS --------------------------------------------------------------------------------------------------------------------------------- Since most Filecoin nodes are also IPFS nodes, standard practice has been for Filecoin storage providers to also make available a hot copy of any given stored file through IPFS. Since the algorithm that generates a content address (CID) is the same for both Filecoin and IPFS, the client can request the CID of a file they stored on Filecoin and retrieve it from IPFS, if there is an IPFS node that is able and willing to serve the file. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market) [PreviousStorage marketchevron-left](https://docs.filecoin.io/basics/what-is-filecoin/storage-market) [NextProgramming on Filecoinchevron-right](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin) Last updated 1 year ago * [Basic Retrieval from Filecoin](https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market#basic-retrieval-from-filecoin) * [Hot Retrieval from IPFS](https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market#hot-retrieval-from-ipfs) sun-brightdesktopmoon sun-brightdesktopmoon --- # Programming on Filecoin | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#compute-over-data) Compute-over-data ---------------------------------------------------------------------------------------------------------------------------- Beyond storage and retrieval, data often needs transformation. Compute-over-data protocols enable computations over IPLD, the data layer used by content-addressed systems like Filecoin. Working groups are developing compute solutions for Filecoin data, including large-scale parallel compute (e.g., [Bacalhauarrow-up-right](https://www.bacalhau.org/) ) and cryptographically verifiable compute (e.g., [Lurkarrow-up-right](https://filecoin.io/blog/posts/introducing-lurk-a-programming-language-for-recursive-zk-snarks/) ). For example, Bacalhau provides a platform for public, transparent, and verifiable distributed computation, allowing users to run Docker containers and WebAssembly (Wasm) images as tasks on data stored in InterPlanetary File System (IPFS). Filecoin is uniquely positioned to support large-scale off-chain computation because storage providers have compute resources, such as GPUs and CPUs, colocated with their data. This setup enables a new paradigm where computations occur directly on the data where it resides, reducing the need to move data to external compute nodes. [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#filecoin-virtual-machine) Filecoin Virtual Machine ------------------------------------------------------------------------------------------------------------------------------------------ The Filecoin Virtual Machine (FVM) is a runtime environment for executing smart contracts on the Filecoin network. These smart contracts allow users to run bounded computations and establish rules for storing and accessing data. The FVM ensures that these contracts are executed securely and reliably. The FVM is designed to support both native Filecoin actors written in languages that compile to Wasm and smart contracts from other runtimes, such as Solidity for the Ethereum Virtual Machine (EVM), Secure EcmaScript (SES), and eBPF. The [reference FVMarrow-up-right](https://github.com/filecoin-project/ref-fvm) and SDK are written in Rust, ensuring high performance and security. Initially, the FVM supports smart contracts written in Solidity, with plans to expand to other languages that compile to Wasm, as outlined in the FVM roadmap. By enabling compute-over-states on the Filecoin network, the FVM unlocks a wide range of potential use cases. Examples include: ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#data-organizations) Data Organizations FVM enables a new kind of organization centered around data. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#data-daos-and-tokenized-datasets) Data DAOs and tokenized datasets The FVM makes it possible to create and manage decentralized and autonomous organizations (Data DAOs) focused on data curation and preservation. Data DAOs allow groups of individuals or organizations to govern and monetize data access, pooling returns into a shared treasury to fund preservation and growth. These data tokens can also be exchanged among peers or used to request computation services, such as validation, analysis, feature detection, and machine learning. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#perpetual-storage) Perpetual storage The FVM allows users to store data once and use repair and replication bots to manage ongoing storage deals, ensuring perpetual data storage. Through smart contracts, users can fund a wallet with FIL, allowing storage providers to maintain data storage indefinitely. Repair bots monitor these storage deals and replicate data across providers as needed, offering long-term data permanence. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#financial-services-for-storage-providers) Financial services for storage providers The FVM can facilitate unique financial services tailored for storage providers (SPs) in the Filecoin ecosystem. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#lending-and-staking-protocols) Lending and staking protocols Users can lend Filecoin to storage providers to be used as storage collateral, earning interest in return. Loans may be undercollateralized based on SP performance history, with reputation scores generated from on-chain data. Loans can also be automatically repaid to investors using a multisig wallet, which includes lenders and a third-party arbitrator. New FVM-enabled smart contracts create yield opportunities for FIL holders while supporting the growth of storage services on the network. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#insurance) Insurance SPs may require financial products to protect against risks in providing storage solutions. Attributes such as payment history, operational length, and availability can be used to underwrite insurance policies, shielding SPs from financial impacts due to storage faults or token price fluctuations. ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#core-chain-infrastructure) Core chain infrastructure The FVM is expected to achieve feature parity with other persistent EVM chains, supporting critical infrastructure for decentralized exchanges and token bridges. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#decentralized-exchanges) Decentralized exchanges To facilitate on-chain token exchange, the FVM may support decentralized exchanges like Uniswap or Sushi, or implement decentralized order books similar to Serum on Solana. #### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#token-bridges) Token bridges Although not an immediate focus, token bridges will eventually connect Filecoin to EVM, Move, and Cosmos chains, enabling cross-chain wrapped tokens. While Filecoin currently offers unique value without needing to bootstrap liquidity from other chains, long-term integration with other blockchains is anticipated. In addition to these, the FVM could support various other use cases, such as data access control ([Medusaarrow-up-right](https://cryptonet.org/projects/project-medusa-scalable-threshold-network-on-chain) ), trustless reputation systems, replication workers, storage bounties, and L2 networks. For more details on potential use cases, see our [Request for Startupsarrow-up-right](https://protocollabs.notion.site/Request-for-Startups-FVM-edition-8cd3e76982d14e29b33335ca458fb087) post. If you are interested in building these use cases, the following solution blueprints may be helpful: * [DataDAO Solution Blueprintarrow-up-right](https://docs.google.com/document/d/1OYDh_gs7mAk2M_O9m-2KedQA7MNo6ysIzH6eaQZxMOk/edit?pli=1) * [Perpetual Storage Solution Blueprintarrow-up-right](https://docs.google.com/document/d/19Kck1PiGGrUKyd6XBYj6NtsC5NiCjndUSsv0OFA1Lv0/edit) * [Lending Pool Cookbookarrow-up-right](https://docs.google.com/document/d/18in74On0bY7KyEsPgItvNvfUUPcPtHjNQtVfLdJUyzM/edit) ### [hashtag](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#filecoin-evm) Filecoin EVM The Filecoin EVM (FEVM) is an Ethereum Virtual Machine (EVM) runtime built on top of the FVM. It allows developers to port existing EVM-based smart contracts directly onto Filecoin. The FEVM emulates EVM bytecode at a low level, supporting contracts written in Solidity, Vyper, and Yul. The EVM runtime is based on open-source libraries, including [SputnikVMarrow-up-right](https://github.com/rust-blockchain/evm) and Revm. More details can be found in the [EVM <> FVM mapping specificationarrow-up-right](https://github.com/filecoin-project/fvm-project/blob/main/04-evm-mapping.md) . Since Filecoin nodes support the Ethereum JSON-RPC API, FEVM is compatible with existing EVM development tools, such as Hardhat, Brownie, and MetaMask. Most smart contracts deployed to Filecoin require minimal adjustments, if any. For example, new ERC-20 tokens can be launched on Filecoin or bridged to other chains. Developers can choose between deploying actors on the FEVM or native FVM: for optimal performance, actors should be written in languages that compile to Wasm and deployed to the native FVM. For familiarity with Solidity and EVM tools, the FEVM is a convenient alternative. In summary, the FEVM provides a straightforward path for Web3 developers to begin building on Filecoin using familiar tools and languages, while gaining native access to Filecoin storage deals. The primary difference between FEVM and EVM contracts is that FEVM contracts can interact directly with Filecoin-specific actors, such as miner actors, which are inaccessible to Ethereum contracts. To enable seamless integration, a Filecoin-Solidity API library has been developed to facilitate interactions with Filecoin-specific actors and syscalls. For example FEVM contracts, see the available [example contracts herearrow-up-right](https://github.com/lotus-web3/client-contract) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin) [PreviousRetrieval marketchevron-left](https://docs.filecoin.io/basics/what-is-filecoin/retrieval-market) [NextNetworkschevron-right](https://docs.filecoin.io/basics/what-is-filecoin/networks) Last updated 7 months ago * [Compute-over-data](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#compute-over-data) * [Filecoin Virtual Machine](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#filecoin-virtual-machine) * [Data Organizations](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#data-organizations) * [Financial services for storage providers](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#financial-services-for-storage-providers) * [Core chain infrastructure](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#core-chain-infrastructure) * [Filecoin EVM](https://docs.filecoin.io/basics/what-is-filecoin/programming-on-filecoin#filecoin-evm) sun-brightdesktopmoon sun-brightdesktopmoon --- # How storage works | Filecoin Docs This section is an introduction to two methods of performing storage deals --through the [Filecoin Plusarrow-up-right](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) program or through [various storage onrampsarrow-up-right](https://docs.filecoin.io/basics/how-storage-works/storage-onramps) . This section also explains the features and advantages of using [Filecoin and IPFSarrow-up-right](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-storage-works) [PreviousInterplanetary consensuschevron-left](https://docs.filecoin.io/basics/interplanetary-consensus) [NextFilecoin pluschevron-right](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage onramps | Filecoin Docs Developers use web UIs, APIs, or libraries to send data to storage onramps. Behind the scenes, storage onramps receive the data and handle the underlying processes to store it in a reliable way, making deals with Filecoin storage providers. The available storage onramps are: * [Lighthousearrow-up-right](https://lighthouse.storage/) "offers permanent, decentralized storage powered by Filecoin. Secure, scalable, and ideal for individuals, developers, and enterprises." * [Akavearrow-up-right](https://www.akave.ai/) is "revolutionizing data management with a decentralized, modular solution that combines the robust storage of Filecoin with cutting-edge encryption and easy-to-use interfaces." * [Storachaarrow-up-right](https://storacha.network/) is an open hot storage network scales IPFS and Filecoin. Upload any data and Storacha will ensure it ends up on a decentralized set of IPFS and Filecoin storage providers. There Storacha [docsarrow-up-right](https://docs.storacha.network/) detail the JavaScript and Go API libraries, and there is a no-code web uploader available as well. * [Singularityarrow-up-right](https://singularity.storage/) "facilitates onboarding of large quantaties of data (PB-scale) to the Filecoin network in an efficient, secure, and flexible way." * [CID Gravityarrow-up-right](https://www.cidgravity.com/) is a "seamless gateway to the decentralized web", allowing you to drag and drop files through an easy-to-use UI that uploads files to Filecoin and IPFS. * [Ramoarrow-up-right](https://www.ramo.io/) is "a network coordinating people, hardware and capital to build a more open and resilient internet infrastructure for everyone." [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-storage-works/storage-onramps) [PreviousFilecoin pluschevron-left](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) [NextFilecoin and IPFSchevron-right](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Consensus | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/the-blockchain/consensus#overview) Overview ------------------------------------------------------------------------------------------ In the Filecoin blockchain, network _consensus_ is achieved using the Expected Consensus (EC) algorithm, a probabilistic, _Byzantine fault-tolerant_ consensus protocol. At a high level, EC achieves consensus by running a secret, fair, and verifiable _leader election_ at every [epoch](https://docs.filecoin.io/reference/general/glossary#epoch) where a set number of participants may become eligible to submit a block to the chain based on fair and verifiable criteria. [hashtag](https://docs.filecoin.io/basics/the-blockchain/consensus#properties) Properties ---------------------------------------------------------------------------------------------- Expected Consensus (EC) has the following properties: * Each epoch has potentially multiple elected leaders who may propose a block. * A winner is selected randomly from a set of network participants weighted according to the respective storage power they contribute to the Filecoin network. * All blocks proposed are grouped together in a _tipset_, from which the final chain is selected. * A block producer can be verified by any participant in the network. * The identity of a block producer is anonymous until they release their block to the network. [hashtag](https://docs.filecoin.io/basics/the-blockchain/consensus#steps) Steps ------------------------------------------------------------------------------------ In summary, EC involves the following steps at each _epoch_: 1. A storage provider checks to see if they are elected to propose a block by generating an _election proof_. 2. Zero, one, or multiple storage providers may be elected to propose a block. This does not mean that an elected participant is guaranteed to be able to submit a block. In the case where: * **No storage providers are elected to propose a block in a given epoch**; a new election is run in the next epoch to ensure that the network remains live. * **One or more storage providers are elected to propose a block in a given epoch**; each must generate a _WinningPoSt proof-of-storage_ to be eligible to actually submit a block. 3. Each potential block producer elected generates a storage proof using [WinningPoSt](https://docs.filecoin.io/reference/general/glossary#winning-proof-of-spacetime-winningpost) for a randomly selected [_sector_](https://docs.filecoin.io/reference/general/glossary#sector) within in short window of time. Potential block producers that fail this step are not eligible to produce a block. In this step, the following could occur: * **All potential block producers fail WinningPoSt**, in which case EC returns to step 1 (described above). * **One or more potential block producers pass WinningPoSt**, which means they are eligible to submit that block to the epochs tipset. 4. Blocks generated by block producers are grouped into a [tipset](https://docs.filecoin.io/reference/general/glossary#tipset) . 5. The tipset that reflects the biggest amount of committed storage on the network is selected. 6. Using the selected tipset, the chain state is propagated. 7. EC returns to step 1 in the next epoch. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain/consensus) [PreviousBlocks and tipsetschevron-left](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets) [NextDrandchevron-right](https://docs.filecoin.io/basics/the-blockchain/drand) Last updated 1 year ago * [Overview](https://docs.filecoin.io/basics/the-blockchain/consensus#overview) * [Properties](https://docs.filecoin.io/basics/the-blockchain/consensus#properties) * [Steps](https://docs.filecoin.io/basics/the-blockchain/consensus#steps) sun-brightdesktopmoon sun-brightdesktopmoon --- # Assets | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/assets) [PreviousProofschevron-left](https://docs.filecoin.io/basics/the-blockchain/proofs) [NextThe FIL tokenchevron-right](https://docs.filecoin.io/basics/assets/the-fil-token) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Serving retrievals | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#the-indexer) The indexer When a storage deal is originally made, the client can opt to make the data publicly discoverable. If this is the case, the storage provider must publish an advertisement of the storage deal to the Interplanetary Network Indexer (IPNI). IPNI maps a CID to a storage provider (SP). This mapping allows clients to query the IPNI to discover where content is on Filecoin. The IPNI also tracks which data transfer protocols you can use to retrieve specific CIDs. Currently, Filecoin SPs have the ability to serve retrievals over Graphsync, Bitswap, and HTTP. This is dependent on the SP setup. ### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#retrieval-process) Retrieval process If a client wants to retrieve publicly available data from the Filecoin network, then they generally follow this process. #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#query-the-ipni) Query the IPNI Before the client can submit a retrieval deal to a storage provider, they first need to find which providers hold the data. To do this, the client sends a query to the Interplanetary Network Indexer. #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#select-a-provider) Select a provider Assuming the IPNI returns more than one storage provider, the client can select which provider they’d like to deal with. Here, they will also get additional details (if needed) based on the retrieval protocol they want to retrieve the content over. #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#initiate-retrieval) Initiate retrieval The client then attempts to retrieve the data from the SP over Bitswap, Graphsync, or HTTP. Note that currently, clients can only get full-piece retrievals using HTTP. When attempting this retrieval deal using Graphsync, payment channels are used to pay FIL to the storage provider. These payment channels watch the data flow and pay the storage provider after each chunk of data is retrieved successfully. #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#finalize-the-retrieval) Finalize the retrieval Once the client has received the last chunk of data, the connection is closed. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals) [PreviousBasic retrievalchevron-left](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval) [NextSaturnchevron-right](https://docs.filecoin.io/basics/how-retrieval-works/saturn) Last updated 1 year ago * [The indexer](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#the-indexer) * [Retrieval process](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals#retrieval-process) sun-brightdesktopmoon sun-brightdesktopmoon --- # Blocks and tipsets | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocks) Blocks ----------------------------------------------------------------------------------------------- In Filecoin, a block consists of: * A block header * A list of _messages_ contained in the block * A signed copy of each message listed Every block refers to at least one _parent block_; that is, a block produced in a prior epoch. A _message_ represents communication between two actors and thus changes in network state. The messages are listed in their order of appearance, deduplicated, and returned in canonical order of execution. So, in other words, a block describes all changes to the network state in a given epoch. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime) Blocktime Blocktime is a concept that represents the average time it takes to mine or produce a new block on a blockchain. In Ethereum, for example, the blocktime is approximately 15 seconds on average, meaning that a new block is added to the Ethereum blockchain roughly every 15 seconds. In the Filecoin network, storage providers compete to produce blocks by providing storage capacity and participating in the consensus protocol. The block time determines how frequently new blocks are added to the blockchain, which impacts the overall speed and responsiveness of the network. Filecoin has a block time of 30 seconds, and this duration was chosen for two main reasons: * **Hardware requirements**: If the block time were faster while maintaining the same gas limit or the number of messages per block, it would lead to increased hardware requirements. This includes the need for more storage space to accommodate the larger chain data resulting from more frequent block production. * **Storage provider operations**: The block time also takes into account the various operations that occur during that duration on the storage provider (SP) side. As SPs generate new blocks, the 30-second block time allows for the necessary processes and computations to be carried out effectively. If the blocktime were shorter, SPs would encounter significantly more blocktime failures. By considering these factors, the Filecoin network has established a block time of 30 seconds, balancing the need for efficient operations and hardware requirements. [hashtag](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#tipsets) Tipsets ------------------------------------------------------------------------------------------------- As described in [Consensus](https://docs.filecoin.io/basics/the-blockchain/consensus) , multiple potential block producers may be elected via Expected Consensus (EC) to create a block in each epoch, which means that more than one valid block may be produced in a given epoch. All valid blocks with the same height and same parent block are assembled into a group called a _tipset_. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#benefits-of-tipsets) Benefits of tipsets In other blockchains, blocks are used as the fundamental representation of network state, that is, the overall status of each participant in the network at a given time. However, this structure has the following disadvantages: * Potential block producers may be hobbled by network latency. * Not all valid work is rewarded. * Decentralization and collaboration in block production are not incentivized. Because Filecoin is a chain of tipsets rather than individual blocks, the network enjoys the following benefits: * All valid blocks generated in a given round are used to determine network state, increasing network efficiency and throughput. * All valid work is rewarded (that is, all validated block producers in an epoch receive a block reward). * All potential block producers are incentivized to produce blocks, disincentivizing centralization and promoting collaboration. * Because all blocks in a tipset have the same height and parent, Filecoin is able to achieve rapid convergence in the case of forks. In summary, blocks, which contain actor messages, are grouped into tipsets in each epoch, which can be thought of as the overall description of the network state for a given epoch. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#tipsets-in-the-ethereum-json-rpc) Tipsets in the Ethereum JSON-RPC Wherever you see the term _block_ in the Ethereum JSON-RPC, you should mentally read _tipset_. Before the inclusion of the Filecoin EVM runtime, there was no single hash referring to a tipset. A tipset ID was the concatenation of block CIDs, which led to a variable-length ID and poor user experience. With the Ethereum JSON-RPC, we introduced the concept of the _tipset CID_ for the first time. It is calculated by hashing the former _tipset key_ using a Blake-256 hash. Therefore, when you see the term: * _block hash_, think _tipset hash_. * _block height_, think _tipset epoch_. * _block messages_, think _messages in all blocks in a tipset, in their order of appearance, deduplicated and returned in canonical order of execution_. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets) [PreviousAddresseschevron-left](https://docs.filecoin.io/basics/the-blockchain/addresses) [NextConsensuschevron-right](https://docs.filecoin.io/basics/the-blockchain/consensus) Last updated 1 year ago * [Blocks](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocks) * [Blocktime](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime) * [Tipsets](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#tipsets) * [Benefits of tipsets](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#benefits-of-tipsets) * [Tipsets in the Ethereum JSON-RPC](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#tipsets-in-the-ethereum-json-rpc) sun-brightdesktopmoon sun-brightdesktopmoon --- # Interplanetary consensus | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/interplanetary-consensus#what-is-ipc) What is IPC? ------------------------------------------------------------------------------------------------- [Interplanetary Consensus (IPC)arrow-up-right](https://www.ipc.space/) is a framework that enables on-demand horizontal scalability of networks, by deploying "subnets" running different consensus algorithms depending on the application's requirements. ### [hashtag](https://docs.filecoin.io/basics/interplanetary-consensus#what-is-horizontal-scalability-and-why-is-it-important-for-dapps) What is horizontal scalability and why is it important for dApps? [Horizontal scalabilityarrow-up-right](https://en.wikipedia.org/wiki/Scalability#Horizontal_or_scale_out) generally refers to the addition of nodes to a system, to increase its performance. For example, adding more nodes to a compute network helps distribute the effort needed to run a single compute task. This reduces cost per task and decreases latency, while improving overall throughput. In web3, horizontal scalability refers to _scaling_ blockchains, for _desired_ performance. More specifically, _scaling_ the ability of a blockchain to process transactions and achieve consensus, across an increasing number of users, at _desired_ latencies and throughput. IPC is one such scaling solution, alongside other popular layer 2 solutions, like [sidechainsarrow-up-right](https://ethereum.org/en/developers/docs/scaling/sidechains/) and [rollupsarrow-up-right](https://ethereum.org/en/developers/docs/scaling/#rollups) . For decentralized applications (dApps), there are several key motivations to adopt scaling - performance, decentralization, security. The challenge is that these factors are known to be conflicting goals. ### [hashtag](https://docs.filecoin.io/basics/interplanetary-consensus#how-does-ipc-achieve-horizontal-scalability) How does IPC achieve horizontal scalability? IPC is a scaling solution intentionally designed to achieve considerable performance, decentralization and security for dApps. It achieves scaling through the permissionless spawning of new blockchain sub-systems, which are composed of [subnetsarrow-up-right](https://docs.ipc.space/concepts/subnets) . Subnets are organized in a hierarchy, with one parent subnet being able to spawn infinite child subnets. Within a hierarchical subsystem, subnets can seamlessly communicate with each other, reducing the need for cross-chain bridges. Subnets also have their own specific consensus algorithms, whilst leveraging security features from parent subnets. This allows dApps to use subnets for hosting sets of applications or to [shardarrow-up-right](https://en.wikipedia.org/wiki/Shard_(database_architecture)) a single application, according to its various cost or performance needs. ### [hashtag](https://docs.filecoin.io/basics/interplanetary-consensus#how-is-ipc-unique-as-a-scaling-solution) How is IPC unique as a scaling solution? Earlier, we talked about the challenge of scaling solutions to balance performance, security and decentralization. IPC is a standout framework that strikes a considerable balance between these factors, to achieve breakthroughs in scaling. * **Highly customizable without compromising security.** Most L2 scaling solutions today either inherit the L1's security features but don't have their own consensus algorithms (e.g. rollups), or do the reverse (e.g. sidechains). They are also deployed in isolation and require custom bridges or protocols to transfer assets and state between L2s that share a common L1, which are vulnerable to attacks. In contrast, IPC subnets have their own consensus algorithms, inherit security features from the parent subnet and have native cross-net communication, eliminating the need for bridges. * **Multi-chain interoperability.** IPC uses the [Filecoin Virtual Machine (FVM)arrow-up-right](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) as its transaction execution layer. The FVM is a WASM-based polyglot execution environment for IPLD data and is designed to support smart contracts written in any programming language, compiled to WASM. It currently supports Filecoin and Ethereum. Today, IPC is fully compatible with Filecoin and Ethereum and can use either as a rootnet. IPC will eventually allow any chain to be taken as rootnet. * **Tight storage integration with Filecoin.** IPC was designed from the data-centric L1, [Filecoinarrow-up-right](https://docs.filecoin.io/basics/what-is-filecoin) , which is the largest decentralized storage network. IPC can leverage its storage primitives, like IPLD data integration, to deliver enhanced solutions for data availability and more. [hashtag](https://docs.filecoin.io/basics/interplanetary-consensus#applications-of-ipc) Applications of IPC ---------------------------------------------------------------------------------------------------------------- Here are some practical examples of how IPC improves the performance of dApps: * **Distributed Computation**: Spawn ephemeral subnets to run distributed computation jobs. * **Coordination**: Assemble into smaller subnets for decentralized orchestration with high throughput and low fees. * **Localization**: Leverage proximity to improve performance and operate with very low latency in geographically constrained settings. * **Partition tolerance**: Deploy blockchain substrates in mobile settings or other environments with limited connectivity. With better performance, lower fees and faster transactions, IPC can rapidly improve horizontal and vertical markets with decentralized technology: * **Artificial Intelligence:** IPC is fully compatible with [Filecoinarrow-up-right](https://docs.filecoin.io/basics/what-is-filecoin) , the world’s largest decentralized data storage. Leveraging Filecoin, IPC can enable distributed computation to power hundreds of innovative AI models. * **Decentralized Finance (DeFi):** Enabling truly high-frequency trading and traditional backends with verifiability and privacy. * **Big Data and Data Science:** Multiple teams are creating global-scale distributed compute networks to enable Data Science analysis on Exabytes of decentralized stored data. * **Metaverse/Gaming:** Enabling real-time tracking of player interactions in virtual worlds. * **DAOs:** Assemble into smaller subnets for decentralized orchestration with high throughput and low fees. Partition tolerance: Deploy blockchain substrates in mobile settings or other environments with limited connectivity. ### [hashtag](https://docs.filecoin.io/basics/interplanetary-consensus#get-involved) Get involved * Visit the [websitearrow-up-right](https://www.ipc.space/) * Read the [docsarrow-up-right](https://docs.ipc.space/) * Check out the [repositoryarrow-up-right](https://github.com/consensus-shipyard/ipc) * Connect with the community on [Discordarrow-up-right](https://discord.gg/QtNbXf75) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/interplanetary-consensus) [PreviousTransfer FILchevron-left](https://docs.filecoin.io/basics/assets/transfer-fil) [NextHow storage workschevron-right](https://docs.filecoin.io/basics/how-storage-works) Last updated 1 year ago * [What is IPC?](https://docs.filecoin.io/basics/interplanetary-consensus#what-is-ipc) * [What is horizontal scalability and why is it important for dApps?](https://docs.filecoin.io/basics/interplanetary-consensus#what-is-horizontal-scalability-and-why-is-it-important-for-dapps) * [How does IPC achieve horizontal scalability?](https://docs.filecoin.io/basics/interplanetary-consensus#how-does-ipc-achieve-horizontal-scalability) * [How is IPC unique as a scaling solution?](https://docs.filecoin.io/basics/interplanetary-consensus#how-is-ipc-unique-as-a-scaling-solution) * [Applications of IPC](https://docs.filecoin.io/basics/interplanetary-consensus#applications-of-ipc) * [Get involved](https://docs.filecoin.io/basics/interplanetary-consensus#get-involved) sun-brightdesktopmoon sun-brightdesktopmoon --- # How retrieval works | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-retrieval-works) [PreviousFilecoin and IPFSchevron-left](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs) [NextBasic retrievalchevron-right](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Drand | Filecoin Docs This page covers how Drand is used within the Filecoin network. For more information on Drand generally, [take a look at the project’s documentationarrow-up-right](https://www.drand.love/developers) . [hashtag](https://docs.filecoin.io/basics/the-blockchain/drand#randomness-outputs) Randomness outputs ---------------------------------------------------------------------------------------------------------- By polling the appropriate endpoint, a Filecoin node will get back a Drand value formatted as follows: Copy { "round": 367, "signature": "b62dd642e939191af1f9e15bef0f0b0e9562a5f570a12a231864afe468377e2a6424a92ccfc34ef1471cbd58c37c6b020cf75ce9446d2aa1252a090250b2b1441f8a2a0d22208dcc09332eaa0143c4a508be13de63978dbed273e3b9813130d5", "previous_signature": "afc545efb57f591dbdf833c339b3369f569566a93e49578db46b6586299422483b7a2d595814046e2847494b401650a0050981e716e531b6f4b620909c2bf1476fd82cf788a110becbc77e55746a7cccd47fb171e8ae2eea2a22fcc6a512486d" } * `signature`: the threshold BLS signature on the previous signature value and the current round number round. * `previous_signature`: the threshold BLS signature from the previous Drand round. * `round`: the index of randomness in the sequence of all random values produced by this Drand network. The message signed is the concatenation of the round number treated as a uint64 and the previous signature. At the moment, Drand uses BLS signatures on the BLS12-381 curve with the latest v7 RFC of hash-to-curve, and the signature is made over G1. [hashtag](https://docs.filecoin.io/basics/the-blockchain/drand#polling-the-network) Polling the network ------------------------------------------------------------------------------------------------------------ Filecoin nodes fetch the Drand entry from the distribution network of the selected Drand network. Drand distributes randomness using multiple distribution channels such as HTTP servers, S3 buckets, gossiping, etc. Simply put, the Drand nodes themselves will not be directly accessible by consumers; rather, highly-available relays will be set up to serve Drand values over these distribution channels. On initialization, Filecoin initializes a Drand client with chain info that contains the following information: * Period: the period of time between each Drand randomness generation. * GenesisTime: at which the first round in the Drand randomness chain is created. * PublicKey: the public key to verify randomness. * GenesisSeed: the seed that has been used for creating the first randomness. It is possible to simply store the hash of this chain info and to retrieve the contents from the Drand distribution network as well on the `/info` endpoint. Thereafter, the Filecoin client can call Drand’s endpoints: * `/public/latest` to get the latest randomness value produced by the beacon. * `/public/` to get the randomness value produced by the beacon at a given round. [hashtag](https://docs.filecoin.io/basics/the-blockchain/drand#using-drand) Using Drand -------------------------------------------------------------------------------------------- Drand is used as a randomness beacon for leader election in Filecoin. While Drand returns multiple values with every call to the beacon (see above), Filecoin blocks need only store a subset of these in order to track a full Drand chain. This information can then be mixed with on-chain data for use in Filecoin. [hashtag](https://docs.filecoin.io/basics/the-blockchain/drand#edge-cases-and-outages) Edge cases and outages ------------------------------------------------------------------------------------------------------------------ Any Drand beacon outage will effectively halt Filecoin block production. Given that new randomness is not produced, Filecoin miners cannot generate new blocks. Specifically, any call to the Drand network for a new randomness entry during an outage should be blocked in Filecoin. After a beacon downtime, Drand nodes will work to quickly catch up to the current round. In this way, the above time-to-round mapping in Drand used by Filecoin remains invariant after this catch-up following downtime. While Filecoin miners were not able to mine during the Drand outage, they will quickly be able to run leader election thereafter, given a rapid production of Drand values. We call this a _catch-up_ period. During the catch-up period, Filecoin nodes will backdate their blocks in order to continue using the same time-to-round mapping to determine which Drand round should be integrated according to the time. Miners can then choose to publish their null blocks for the outage period, including the appropriate Drand entries throughout the blocks, per the time-to-round mapping. Or, as is more likely, try to craft valid blocks that might have been created during the outage. Based on the level of decentralization of the Filecoin network, we expect to see varying levels of miner collaboration during this period. This is because there are two incentives at play: trying to mine valid blocks during the outage to collect block rewards and not falling behind a heavier chain being mined by a majority of miners who may or may not have ignored a portion of these blocks. In any event, a heavier chain will emerge after the catch-up period and mining can resume as normal. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain/drand) [PreviousConsensuschevron-left](https://docs.filecoin.io/basics/the-blockchain/consensus) [NextProofschevron-right](https://docs.filecoin.io/basics/the-blockchain/proofs) Last updated 1 year ago * [Randomness outputs](https://docs.filecoin.io/basics/the-blockchain/drand#randomness-outputs) * [Polling the network](https://docs.filecoin.io/basics/the-blockchain/drand#polling-the-network) * [Using Drand](https://docs.filecoin.io/basics/the-blockchain/drand#using-drand) * [Edge cases and outages](https://docs.filecoin.io/basics/the-blockchain/drand#edge-cases-and-outages) sun-brightdesktopmoon sun-brightdesktopmoon --- # Project and community | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community) [PreviousSaturnchevron-left](https://docs.filecoin.io/basics/how-retrieval-works/saturn) [NextForums and FIPschevron-right](https://docs.filecoin.io/basics/project-and-community/forums-and-fips) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Addresses | Filecoin Docs All Filecoin addresses begin with an `f` to indicate the network (Filecoin), followed by any of the address prefix numbers (`0`, `1`, `2`, `3`, `4`) to indicate the address type. There are five address types: Address prefix Description `0` An ID address. `1` A [SECP256K1arrow-up-right](https://en.bitcoin.it/wiki/Secp256k1) public key address. `2` An actor address. `3` A [BLSarrow-up-right](https://en.wikipedia.org/wiki/BLS_digital_signature) public key address. `4` Extensible, user-defined actor addresses. `f410` addresses refers to Ethereum-compatible address space, each `f410` address is equivalent to an `0x` address. Each of the address types is described below. [hashtag](https://docs.filecoin.io/basics/the-blockchain/addresses#actor-ids) Actor IDs -------------------------------------------------------------------------------------------- All actors have a short integer assigned to them by `InitActor`, a unique actor that can create _new_ actors. This integer that gets assigned is the ID of that actor. An _ID address_ is an actor’s ID prefixed with the network identifier and the address type. Actor ID addresses are not _robust_ in the sense that they depend on chain state and are defined on-chain by the `InitActor`. Additionally, actor IDs can change for a brief time after creation if the same ID is assigned to different actors on different forks. Actor ID addresses are similar to monotonically increasing numeric primary keys in a relational database. So, when a chain reorganization occurs (similar to a rollback in a SQL database), you can refer to the same ID for different rows. The expected consensus algorithm will resolve the conflict. Once the state that defines a new ID reaches finality, no changes can occur, and the ID is bound to that actor forever. For example, the mainnet burn account ID address, `f099`, is structured as follows: Copy Address type | f 0 9 9 | | | Actor ID | Network identifier ID addresses are often referred to by their shorthand `f0`. [hashtag](https://docs.filecoin.io/basics/the-blockchain/addresses#public-keys) Public keys ------------------------------------------------------------------------------------------------ Actors managed directly by users, like accounts, are derived from a public-private key pair. If you have access to a private key, you can sign messages sent from that actor. The public key is used to derive an address for the actor. Public key addresses are referred to as _robust addresses_ as they do not depend on the Filecoin chain state. Public key addresses allow devices, like hardware wallets, to derive a valid Filecoin address for your account using just the public key. The device doesn’t need to ask a remote node what your ID address is. Public key addresses provide a concise, safe, human-readable way to reference actors before the chain state is final. ID addresses are used as a space-efficient way to identify actors in the Filecoin chain state, where every byte matters. Filecoin supports two types of public key addresses: * [`secp256k1` addressesarrow-up-right](https://en.bitcoin.it/wiki/Secp256k1) that begin with the prefix `f1`. * [BLS addressesarrow-up-right](https://en.wikipedia.org/wiki/BLS_digital_signature) that begin with the prefix `f3`. For BLS addresses, Filecoin uses `curve bls12-381` for BLS signatures, which is a pair of two related curves, `G1` and `G2`. Filecoin uses `G1` for public keys, as G1 allows for a smaller representation of public keys and `G2` for signatures. This implements the same design as ETH2 but contrasts with Zcash, which has signatures on `G1` and public keys on `G2`. However, unlike ETH2, which stores private keys in big-endian order, Filecoin stores and interprets private keys in little-endian order. Public key addresses are often referred to by their shorthand, `f1` or `f3`. [hashtag](https://docs.filecoin.io/basics/the-blockchain/addresses#actors) Actors -------------------------------------------------------------------------------------- Actor addresses provide a way to create robust addresses for actors not associated with a public key. They are generated by taking a `sha256` hash of the output of the account creation. The ZH storage provider has the actor address `f2plku564ddywnmb5b2ky7dhk4mb6uacsxuuev3pi` and the ID address `f01248`. Actor addresses are often referred to by their shorthand, `f2`. [hashtag](https://docs.filecoin.io/basics/the-blockchain/addresses#extensible-user-defined-actors) Extensible user-defined actors -------------------------------------------------------------------------------------------------------------------------------------- Filecoin supports extensible, user-defined actor addresses through the `f4` address class, introduced in [Filecoin Improvement Proposal (FIP) 0048arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md) . The `f4` address class provides the following benefits to the network: * A predictable addressing scheme to support interactions with addresses that do not yet exist on-chain. * User-defined, custom addressing systems without extensive changes and network upgrades. * Support for native addressing schemes from foreign runtimes such as the EVM. An `f4` address is structured as `f4f`, where `` is the actor ID of the _address manager_, and `` is the arbitrary actor ID chosen by that actor. An _address manager_ is an actor that can create new actors and assign an `f4` address to the new actor. Currently, per [FIP 0048arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md) , `f4` addresses may only be assigned by and in association with specific, built-in actors called _address managers_. Once users are able to deploy custom WebAssembly actors, this restriction will likely be relaxed in a future FIP. As an example, suppose an address manager has an actor ID (an `f0` address) `123`, and that address manager creates a new actor. Then, the `f4` address of the actor created by the address manager is `f4123fa3491xyz`, where `f4` is the address class, `123` is the actor ID of the address manager, `f` is a separator, and `a3491xyz` is the arbitrary `` chosen by that actor. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain/addresses) [PreviousActorschevron-left](https://docs.filecoin.io/basics/the-blockchain/actors) [NextBlocks and tipsetschevron-right](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets) Last updated 1 year ago * [Actor IDs](https://docs.filecoin.io/basics/the-blockchain/addresses#actor-ids) * [Public keys](https://docs.filecoin.io/basics/the-blockchain/addresses#public-keys) * [Actors](https://docs.filecoin.io/basics/the-blockchain/addresses#actors) * [Extensible user-defined actors](https://docs.filecoin.io/basics/the-blockchain/addresses#extensible-user-defined-actors) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin and IPFS | Filecoin Docs #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#verifiable-storage) Verifiable storage Filecoin has built-in processes to check the history of files and verify that they have been stored correctly over time. Every storage provider proves that they are maintaining their files in every 24-hour window. Clients can efficiently scan this history to confirm that their files have been stored correctly, even if the client was offline at the time. Any observer can check any storage provider’s track record and will notice if the provider has been faulty or offline in the past. [Learn about storage verification at ProtoSchoolarrow-up-right](https://proto.school/#/verifying-storage-on-filecoin) #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#open-market) Open market In Filecoin, file storage and retrieval deals are negotiated in open markets. Anybody can join the Filecoin network without needing permission. By lowering the barriers to entry, Filecoin enables a thriving ecosystem of many independent storage providers. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#competitive-prices) Competitive prices Prices for storage and retrieval are determined by supply and demand, not corporate pricing departments. Filecoin makes reliable storage available at hyper-competitive prices. Miners compete based on their storage, reliability, and speed rather than through marketing or locking users in. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#reliable-storage) Reliable storage Because storage is paid for, Filecoin provides a viable economic reason for files to stay available over time. Files are stored on computers that are reliable and well-connected to the internet. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#reputation-not-marketing) Reputation, not marketing In Filecoin, storage providers prove their reliability through their track record published on the blockchain, not through marketing claims published by the providers themselves. Users don’t need to rely on status pages or self-reported statistics from storage providers. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#choice-of-tradeoffs) Choice of tradeoffs Users get to choose their own tradeoffs between cost, redundancy, and speed. Users are not limited to a set group of data centers offered by their provider but can choose to store their files on any storage provider participating in Filecoin. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#censorship-resistance) Censorship resistance Filecoin resists censorship because no central provider can be coerced into deleting files or withholding service. The network is made up of many different computers run by many different people and organizations. Faulty or malicious actors are noticed by the network and removed automatically. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#useful-blockchain) Useful blockchain In Filecoin, storage providers are rewarded for providing storage, not for performing wasteful computations. Filecoin secures its blockchain using proof of file replication and proof of storage over time. It doesn’t rely on energy-intensive proof-of-work schemes like other blockchains. Miners are incentivized to amass hard drives and put them to use by storing files. Filecoin doesn’t incentivize the hoarding of graphics cards or application-specific integrated circuits for the sole purpose of mining. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#provides-storage-to-other-blockchains) Provides storage to other blockchains Filecoin’s blockchain is designed to store large files, whereas other blockchains can typically only store tiny amounts of data, very expensively. Filecoin can provide storage to other blockchains, allowing them to store large files. In the future, mechanisms will be added to Filecoin, enabling Filecoin’s blockchain to interoperate with transactions on other blockchains. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#content-addressing) Content addressing Files are referred to by the data they contain, not by fragile identifiers such as URLs. Files remain available no matter where they are hosted or who they are hosted by. When a file becomes popular, it can be quickly distributed by swarms of computers instead of relying on a central computer, which can become overloaded by network traffic. When multiple users store the same file (and choose to make the file public by not encrypting it), everyone who wants to download the file benefits from Filecoin, keeping it available. No matter where a file is downloaded from, users can verify that they have received the correct file and that it is intact. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#content-distribution-network) Content distribution network Retrieval providers are computers that have good network connections to lots of users who want to download files. By prefetching popular files and distributing them to nearby users, retrieval providers are rewarded for making network traffic flow smoothly and files download quickly. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#single-protocol) Single protocol Applications implementing Filecoin can store their data on any storage provider using the same protocol. There isn’t a different API to implement for each provider. Applications wishing to support several different providers aren’t limited to the lowest-common-denominator set of features supported by all their providers. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#no-lock-in) No lock-in Migrating to a different storage provider is made easier because they all offer the same services and APIs. Users aren’t locked into providers because they rely on a particular feature of the provider. Also, files are content-addressed, enabling them to be transferred directly between providers without the user having to download and re-upload the files. Traditional cloud storage providers lock users by making it cheap to store files but expensive to retrieve them again. Filecoin avoids this by facilitating a retrieval market where providers compete to give users their files back as fast as possible, at the lowest possible price. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#open-source-code) Open source code The code that runs both clients and storage providers is open-source. Storage providers don’t have to develop their own software for managing their infrastructure. Everyone benefits from improvements made to Filecoin’s code. #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs#active-community) Active community Filecoin has an active community of contributors to answer questions and help newcomers get started. There is an open dialog between users, developers, and storage providers. If you need help, you can reach the person who designed or built the system in question. Reach out on [Filecoin’s chat and forumsarrow-up-right](https://docs.filecoin.io/basics/project-and-community/forums-and-fips) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-storage-works/filecoin-and-ipfs) [PreviousStorage onrampschevron-left](https://docs.filecoin.io/basics/how-storage-works/storage-onramps) [NextHow retrieval workschevron-right](https://docs.filecoin.io/basics/how-retrieval-works) Last updated 10 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Basic retrieval | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval#lassie) Lassie Lassie is a simple retrieval client for IPFS and Filecoin. It finds and fetches your data over the best retrieval protocols available. Lassie makes Filecoin retrieval easy. While Lassie is powerful, the core functionality is expressed in a single CLI command: Copy lassie fetch Lassie also provides an HTTP interface for retrieving IPLD data from IPFS and Filecoin peers. Developers can use this interface directly in their applications to retrieve the data. Lassie fetches content in content-addressed archive (CAR) form, so in most cases, you will need additional tooling to deal with CAR files. Lassie can also be used as a library to fetch data from Filecoin from within your application. Due to the diversity of data transport protocols in the IPFS ecosystem, Lassie is able to use the Graphsync or Bitswap protocols, depending on how the requested data is available to be fetched. One prominent use case of Lassie as a library is the **Saturn Network**. Saturn nodes fetch content from Filecoin and IPFS through Lassie in order to serve retrievals. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d103c6873e5cfb87e6d132e7688b561e1ee362c2%252Fbasics-how-retrieval-works-basic-retrieval-lassie-library.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=dc221a7b&sv=2) Lassie Architecture #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval#retrieve-using-lassie) Retrieve using Lassie Make sure that you have [Goarrow-up-right](https://go.dev/) installed and that your `GOPATH` is set up. By default, your `GOPATH` will be set to `~/go`. **Install Lassie** [**#**arrow-up-right](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval/#install-lassie) 1. Download the [Lassie Binary from the latest releasearrow-up-right](https://github.com/filecoin-project/lassie/releases/latest) based on your system architecture. Or download and install Lassie using the Go package manager: 1. Download the [go-car binary from the latest releasearrow-up-right](https://github.com/ipld/go-car/releases/latest) based on your system architecture or install the [go-cararrow-up-right](https://github.com/ipld/go-car) package using the Go package manager. The go-car package makes it easier to work with content-addressed archive (CAR) files: You now have everything you need to retrieve a file with Lassie and extract the contents with `go-car`. **Retrieve** To retrieve data from Filecoin using Lassie, all you need is the CID of the content you want to download. The video below demonstrates how Lassie can be used to render content directly from Filecoin and IPFS. Lassie and `go-car` can work together to retrieve and extract data from Filecoin. All you need is the CID of the content to download. This command uses a `|` to chain two commands together. This will work on Linux or macOS. Windows users may need to use PowerShell to use this form. Alternatively, you can use the commands separately, as explained later on this page. An example of fetching and extracting a single file, identified by its CID: Basic progress information, similar to the output shown below, is displayed: The resulting file is a tar archive: **Lassie CLI usage** Lassie's usage for retrieving data is as follows: * `-p` is an optional flag that tells Lassie that you would like to see detailed progress information as it fetches your data. For example: * `-o` is an optional flag that tells Lassie where to write the output to. If you don’t specify a file, it will append `.car` to your CID and use that as the output file name. If you specify `-p`, the output will be written to `stdout` so it can be piped to another command, such as `go-car`, or redirected to a file. * `/path/to/content` is the CID of the content you want to retrieve and an optional path to a specific file within that content. Example: A CID is always necessary, and if you don’t specify a path, Lassie will attempt to download the entire content. If you specify a path, Lassie will only download that specific file or, if it is a directory, the entire directory and its contents. **go-car CLI usage** The `car extract` command can be used to extract files and directories from a CAR: * `-f` is an optional flag that tells `go-car` where to read the input from. If omitted, it will read from `stdin`, as in our example above where we piped `lassie fetch -o -` output to `car extract`. * `/path/to/file/or/directory` is an optional path to a specific file or directory within the CAR. If omitted, it will attempt to extract the entire CAR. * `` is an optional argument that tells `go-car` where to write the output to. If omitted, it will be written to the current directory. If you supply `-p`, as in the above example, it will attempt to extract the content directly to `stdout`. This will only work if we are extracting a single file. In the example above, where we fetched a file named `lidar-data.tar`, the `>` operator was used to redirect the output of `car extract` to a named file. This is because the content we fetched was raw file data that did not have a name encoded. In this case, if we didn’t use `-` and `> filename`, `go-car` would write to a file named `unknown`. In this instance, `go-car` was used to reconstitute the file from the raw blocks contained within Lassie’s CAR output. `go-car` has other useful commands. The first is `car ls`, which can be used to list the contents of a CAR. The second is `car inspect`, which can be used to inspect the contents of the CAR and optionally verify the integrity of a CAR. And there we have it! Downloading and managing data from Filecoin is super simple when you use Lassie and Go-car! #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval#lassie-http-daemon) Lassie HTTP daemon The Lassie HTTP daemon is an HTTP interface for retrieving IPLD data from IPFS and Filecoin peers. It fetches content from peers known to have it and provides the resulting data in CAR format. A `GET` query against a Lassie HTTP daemon allows retrieval from peers that have the content identified by the given root CID, streaming the DAG in the response in [CAR (v1)arrow-up-right](https://ipld.io/specs/transport/car/carv1/) format. You can read more about the HTTP request and response to the daemon in [Lassie’s HTTP specarrow-up-right](https://github.com/filecoin-project/lassie/blob/main/docs/HTTP_SPEC.md) . Lassie’s HTTP interface can be a very powerful tool for web applications that require fetching data from Filecoin and IPFS. #### [hashtag](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval#lassies-car-format) Lassie’s CAR format Lassie only returns data in CAR format, specifically, [CARv1arrow-up-right](https://ipld.io/specs/transport/car/carv1/) format. [Lassie’s car specarrow-up-right](https://github.com/filecoin-project/lassie/blob/main/docs/CAR.md) describes the nature of the CAR data returned by Lassie and the various options available to the client for manipulating the output. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval) [PreviousHow retrieval workschevron-left](https://docs.filecoin.io/basics/how-retrieval-works) [NextServing retrievalschevron-right](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals) Last updated 1 year ago sun-brightdesktopmoon Copy go install github.com/filecoin-project/lassie/cmd/lassie@latest Copy go install github.com/ipld/go-car/cmd/car@latest Copy lassie fetch -o - | car extract Copy lassie fetch -o - bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6 | car extract - > lidar-data.tar Copy Fetching bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6................................................................................................................................................ Fetched [bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6] from [12D3KooWPNbkEgjdBNeaCGpsgCrPRETe4uBZf1ShFXStobdN18ys]: Duration: 42.259908785s Blocks: 144 Bytes: 143 MiB extracted 1 file(s) Copy ls -l # total 143M # -rw-rw-r-- 1 user user 143M Feb 16 11:21 lidar-data.tar Copy lassie fetch -p -o /path/to/content Copy Fetching bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6 Querying indexer for bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6... Found 4 storage providers candidates from the indexer, querying all of them: 12D3KooWPNbkEgjdBNeaCGpsgCrPRETe4uBZf1ShFXStobdN18ys 12D3KooWNHwmwNRkMEP6VqDCpjSZkqripoJgN7eWruvXXqC2kG9f 12D3KooWKGCcFVSAUXxe7YP62wiwsBvpCmMomnNauJCA67XbmHYj 12D3KooWLDf6KCzeMv16qPRaJsTLKJ5fR523h65iaYSRNfrQy7eU Querying [12D3KooWLDf6KCzeMv16qPRaJsTLKJ5fR523h65iaYSRNfrQy7eU] (started)... Querying [12D3KooWKGCcFVSAUXxe7YP62wiwsBvpCmMomnNauJCA67XbmHYj] (started)... ... Copy lassie fetch -o - bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/Cryptographic_hash_function | car extract - | less Copy car extract -f [/path/to/file/or/directory] [] Copy GET /ipfs/{cid}[/path][?params] sun-brightdesktopmoon --- # Forums and FIPs | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/project-and-community/forums-and-fips#discussion-forums) Discussion Forums For shorter-lived discussions, our community chat open to all on both Slack and Discord: * [Slackarrow-up-right](https://filecoin.io/slack) * [Discordarrow-up-right](https://discord.com/invite/filecoin) For long-lived discussions and for support, please use the [discussion tab on GitHubarrow-up-right](https://github.com/filecoin-project/community#forums) instead of Slack. It’s easy for complex discussions to get lost in a sea of new messages on those chat platforms, and posting longer discussions and support requests on the forums helps future visitors, too. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/forums-and-fips#filecoin-improvement-proposals) Filecoin improvement proposals Filecoin improvement proposals (FIPs) are design documents that propose changes and improvements to the Filecoin network, giving detailed specifications and their rational, and allowing the community to document their consensus or dissent. All technical FIPs that are accepted are later reflected in the [Filecoin Specarrow-up-right](https://spec.filecoin.io/) . There are three types of FIPs: * Technical FIPs (FTP): protocol changes, standards, API changes. They can include core (consensus-related changes, networking (network protocol improvements, interface (API/RPC or language-level updates), or can be informational (updates to general guidelines or documentation). * Organizational FIPs (FOP): changes to processes, tools, or governance. * Recovery FIPs (FRP): emergency fixes requiring state changes (e.g., major bugs). Typically, the FIP lifecycle looks something like this: \[ WIP \] -> \[ DRAFT \] -> \[ LAST CALL \] -> \[ ACCEPTED \] -> \[ FINAL \] 1. WIP: A community member has an idea for a FIP, and begins discussing the idea publicly on the Filecoin Discord, in the [Filecoin Slack channel for discussing FIPsarrow-up-right](https://filecoinproject.slack.com/archives/C01EU76LPCJ) , or in Github issues for the relevant repo. 2. DRAFT: If there is a chance the FIP could be adopted, the author submits a draft for the FIP as a pull request in the [FIPs repoarrow-up-right](https://github.com/filecoin-project/FIPs) . 3. LAST CALL: This status allows the community to submit final changes to the draft. 4. ACCEPTED: Once the FIP is voted on and accepted, the core engineers will work to implement it. 5. FINAL: This status represents the current state-of-the-art, and it should only be updated to correct errors. It is the authors' responsibility to request status updates for the FIP. A more robust explainer of the FIP process can be found in [FIP001arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0001.md#what-is-a-fip) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/forums-and-fips) [PreviousProject and communitychevron-left](https://docs.filecoin.io/basics/project-and-community) [NextFilecoin compared tochevron-right](https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to) Last updated 10 months ago * [Discussion Forums](https://docs.filecoin.io/basics/project-and-community/forums-and-fips#discussion-forums) * [Filecoin improvement proposals](https://docs.filecoin.io/basics/project-and-community/forums-and-fips#filecoin-improvement-proposals) sun-brightdesktopmoon sun-brightdesktopmoon --- # Proofs | Filecoin Docs Different blockchains use different cryptographic proving systems (proofs) based on the network’s specific purpose, goals, and functionality. Regardless of which method is used, proofs have the following in common: * All blockchain networks seek to achieve [_consensus_](https://docs.filecoin.io/basics/the-blockchain/consensus) and rely on proofs as part of this process. * Proofs incentivize network participants to behave in certain ways and allow the network to penalize participants who do not abide by network standards. * Proofs allow decentralized systems to agree on a network state without a central authority. Proof-of-Work and Proof-of-Stake are both fairly common proof methods: * **Proof-of-Work**: nodes in the network solve complex mathematical problems to validate transactions and create new blocks, * **Proof-of-Stake**: nodes in the network are chosen to validate transactions and create new blocks based on the amount of cryptocurrency they hold and “stake” in the network. The Filecoin network aims to provide useful, reliable storage to its participants. With a traditional centralized entity like a cloud storage provider, explicit trust is placed in the entity itself that the data will be stored in a way that meets some minimum set of standards such as security, scalability, retrievability, or replication. Because the Filecoin network is a decentralized network of storage providers (SPs) distributed across the globe, network participants need an automated, trustless, and decentralized way to validate that an SP is doing a good job of handling the data. In particular, the Filecoin proof process must verify the data was properly stored at the time of the initial request and is continuing to be stored based on the terms of the agreement between the client and the SP. In order for the proof processes to be robust, the process must: * Target a random part of the data. * Occur at a time interval such that it is not possible, profitable, or rational for an SP to discard and re-fetch the copy of data. In Filecoin, this process is known as _Proof-of-Storage_, and consists of two distinct types of proofs: * [Proof of Replication (PoRep)arrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/#proof-of-replication-porep) : a procedure used at the time of initial data storage to validate that an SP has _created and stored_ a unique copy of some piece of data. * [Proof of Spacetime (PoST)arrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/#proof-of-spacetime-post) : a procedure to validate that an SP is _continuing to store_ a unique copy of some piece of data. [hashtag](https://docs.filecoin.io/basics/the-blockchain/proofs#proof-of-replication-porep) Proof-of-Replication (PoRep) ----------------------------------------------------------------------------------------------------------------------------- In the Filecoin storage lifecycle process, _Proof-of-Replication (PoRep)_ is used when an SP agrees to store data on behalf of a client and receives a piece of client data. In this process: 1. The data is placed into a [sectorarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/) . 2. The sector is sealed by the SP. 3. A unique encoding, which serves as proof that the SP has replicated a copy of the data they agreed to store, is generated (described in [Sealing as proofarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/#sealing-as-proof) ). 4. The proof is compressed. 5. The result of the compression is submitted to the network as certification of storage. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/proofs#sealing-as-proof) Sealing as proof The unique encoding created during the sealing process is generated using the following pieces of information: * The data is sealed. * The storage provider who seals the data. * The time at which the data was sealed. Because of the principles of cryptographic hashing, a new encoding will be generated if the data changes, the storage provider sealing the data changes, or the time of sealing changes. This encoding is unique and can be used to verify that a specific storage provider did, in fact, store a particular piece of client data at a specific time. [hashtag](https://docs.filecoin.io/basics/the-blockchain/proofs#proof-of-spacetime-post) Proof-of-Spacetime (PoSt) ----------------------------------------------------------------------------------------------------------------------- After a storage provider has proved that they have replicated a copy of the data that they agreed to store, the SP must continue to prove to the network that: * They are still storing the requested data. * The data is available. * The data is still sealed. Because this method is concerned with proving that data is being stored in a particular _space_ for a particular period or at a particular _time_, it is called _Proof-of-Spacetime (PoSt)_. In Filecoin, the PoSt process is handled using two different sub-methods, each of which serves a different purpose: * [WinningPoStarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/#winningpost) is used to prove that an SP selected using an election process has a replica of the data at the specific time that they were asked and is used in the block consensus process. * [WindowPoStarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/#windowpost) is used to prove that, for any and all SPs in the network, a copy of the data that was agreed to be stored is being continuously maintained over time and is used to audit SPs continuously. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/proofs#winningpost) WinningPoSt _WinningPoSt_ is used to prove that an SP selected via election has a replica of the data at the specific time that they were asked and is specifically used in Filecoin to determine which SPs may add blocks to the Filecoin blockchain. At the beginning of each [epocharrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/) , a small number of SPs are elected to mine new blocks using the [Expected Consensus algorithmarrow-up-right](https://spec.filecoin.io/algorithms/expected_consensus/) , which guarantees that validators will be chosen based on a probability proportional to their [powerarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/) . Each of the SPs selected must submit a WinningPoSt, proof that they have a sealed copy of the data that they have included in their proposed block. The deadline to submit this proof is the end of the current epoch and was intentionally designed to be short, making it impossible for the SP to fabricate the proof. Successful submission grants the SP: * The [block rewardarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/) . * The opportunity to charge other nodes fees in order to include their messages in the block. If an SP misses the submission deadline, no penalty is incurred, but the SP misses the opportunity to mine a block and receive the block reward. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/proofs#windowpost) WindowPoSt _WindowPoSt_ is used to prove that, for any and all SPs in the network, a copy of the data that was agreed to be stored is being continuously maintained over time and is used to audit SPs continuously. In WindowPoSt, all SPs must demonstrate the availability of all sectors claimed every [proving periodarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/) . Sector availability is not proved individually; rather, SPs must prove a whole [partitionarrow-up-right](https://docs.filecoin.io/basics/the-blockchain/proofs/) at once, and that sector must be proved by the deadline assigned (a 30-minute interval in the proving period). The more sectors an SP has pledged to store, the more the partitions of sectors that the SP will need to prove per deadline. As this requires that the SP has access to sealed copies of each of the requested sectors, it makes it irrational for the SP to seal data every time they need to provide a WindowPoSt proof, thus ensuring that SPs on the network are continuously maintaining the data agreed to. Additionally, failure to submit WindowPoSt for a sector will result in the SPs’ pledge collateral being forfeited and their storage power being reduced. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain/proofs) [PreviousDrandchevron-left](https://docs.filecoin.io/basics/the-blockchain/drand) [NextAssetschevron-right](https://docs.filecoin.io/basics/assets) Last updated 1 year ago * [Proof-of-Replication (PoRep)](https://docs.filecoin.io/basics/the-blockchain/proofs#proof-of-replication-porep) * [Sealing as proof](https://docs.filecoin.io/basics/the-blockchain/proofs#sealing-as-proof) * [Proof-of-Spacetime (PoSt)](https://docs.filecoin.io/basics/the-blockchain/proofs#proof-of-spacetime-post) * [WinningPoSt](https://docs.filecoin.io/basics/the-blockchain/proofs#winningpost) * [WindowPoSt](https://docs.filecoin.io/basics/the-blockchain/proofs#windowpost) sun-brightdesktopmoon sun-brightdesktopmoon --- # The FIL token | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/assets/the-fil-token#uses) Uses ------------------------------------------------------------------------------ FIL plays a vital role in incentivizing users to participate in the Filecoin network and ensuring its smooth operation. Here are some ways in which FIL is used on the Filecoin network: ### [hashtag](https://docs.filecoin.io/basics/assets/the-fil-token#network-payments) Network payments When a user wants to store data on the Filecoin network, they pay in FIL to the storage providers who offer their storage space. The payment is made in advance, for a certain amount of time that the data will be stored on the network. In addition, storage providers choose their own terms and payment mechanisms for providing storage and retrieval services so other options (such as fiat payments) can be available. ### [hashtag](https://docs.filecoin.io/basics/assets/the-fil-token#blockchain-rewards) Blockchain rewards Storage providers are also rewarded with FIL for providing their storage space and performing other useful tasks on the network. FIL is used to reward storage providers who validate and add new blocks to the Filecoin blockchain. Providers receive a block reward in FIL for each new block they add to the blockchain and also earn transaction fees in FIL for processing storage and retrieval transactions. ### [hashtag](https://docs.filecoin.io/basics/assets/the-fil-token#governance) Governance As members of the Filecoin community, FIL holders are encouraged to participate in the Filecoin governance process. They can do so by proposing, deliberating, designing, and/or contributing to consensus for network changes, alongside other stakeholders in the Filecoin community- including implementers, Core Devs, storage providers, and other ecosystem partners. Learn more about the [Filecoin Governance processarrow-up-right](https://fil.org/governance) . [hashtag](https://docs.filecoin.io/basics/assets/the-fil-token#denominations) Denominations ------------------------------------------------------------------------------------------------ FIL, NanoFIL, and PicoFIL are all denominated in the same cryptocurrency unit, but they represent different levels of precision and granularity. For most users, FIL is the main unit of measurement and is used for most transactions and payments on the Filecoin network. Much like how a US penny represents a fraction of a US dollar, there are many ways to represent value using Filecoin. This is because some actions on the Filecoin network require substantially less value than one whole `FIL`. The different denominations of `FIL` you may see referenced across the ecosystem are: Name Decimal FIL 1 milliFIL 1,000 microFIL 1,000,000 nanoFIL 1,000,000,000 picoFIL 1,000,000,000,000 femtoFIL 1,000,000,000,000,000 attoFIL 1,000,000,000,000,000,000 [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/assets/the-fil-token) [PreviousAssetschevron-left](https://docs.filecoin.io/basics/assets) [NextWalletschevron-right](https://docs.filecoin.io/basics/assets/wallets) Last updated 10 months ago * [Uses](https://docs.filecoin.io/basics/assets/the-fil-token#uses) * [Network payments](https://docs.filecoin.io/basics/assets/the-fil-token#network-payments) * [Blockchain rewards](https://docs.filecoin.io/basics/assets/the-fil-token#blockchain-rewards) * [Governance](https://docs.filecoin.io/basics/assets/the-fil-token#governance) * [Denominations](https://docs.filecoin.io/basics/assets/the-fil-token#denominations) sun-brightdesktopmoon sun-brightdesktopmoon --- # Wallets | Filecoin Docs When someone sends cryptocurrency to your wallet address, the transaction is recorded on the blockchain network, and the funds are added to your wallet balance. Similarly, when you send cryptocurrency from your wallet to someone else’s wallet, the transaction is recorded on the blockchain network, and the funds are deducted from your wallet balance. There are various types of cryptocurrency wallets, including desktop, mobile, hardware, and web-based wallets, each with its own unique features and levels of security. It’s important to choose a reputable and secure wallet to ensure the safety of your digital assets. [hashtag](https://docs.filecoin.io/basics/assets/wallets#compatible-wallets) Compatible wallets ---------------------------------------------------------------------------------------------------- We do not provide technical support for any of these wallets. Please use caution when researching and using the wallets listed below. Wallets that have conducted third-party audits of their open-source code by a reputable security auditor are marked _recommended_ below. If you are already running your own lotus node, you can also [manage FIL wallets from the command linearrow-up-right](https://lotus.filecoin.io/lotus/manage/manage-fil/) . Name Description Audited [Ledgerarrow-up-right](https://support.ledger.com/article/4402721277329-zd) A multi-currency hardware wallet. _Recommended._ Yes [Glif web walletarrow-up-right](https://www.glif.io/en?txtype=send) Supports sending & receiving FIL. Can be integrated with a Ledger hardware device. _Recommended._ Yes [Filecoin MetaMask Walletarrow-up-right](https://snaps.metamask.io/snap/npm/filsnap/) MetaMask has extensions called [Snapsarrow-up-right](https://metamask.io/snaps/) installable from the right menu in MetaMask. Yes [FoxWalletarrow-up-right](https://foxwallet.com/) A multi-currency mobile wallet by [Filfoxarrow-up-right](https://filfox.info/en) . Yes [Brave Walletarrow-up-right](https://brave.com/wallet/) A multi-currency software wallet built-in to the Brave browser. Yes [Trust walletarrow-up-right](https://trustwallet.com/) A multi-currency wallet, the official wallet of Binance. Unknown [ImTokenarrow-up-right](https://token.im/) A multi-currency wallet. Unknown [MathWalletarrow-up-right](https://mathwallet.org/en-us/) A multi-currency wallet. Unknown [FoxWalletarrow-up-right](https://foxwallet.com/) A multi-currency mobile wallet by [Filfoxarrow-up-right](https://filfox.info/en) . Yes [FilSnap MetaMask Snaparrow-up-right](https://snaps.metamask.io/snap/npm/filsnap/) MetaMask has an extension system called [Snapsarrow-up-right](https://metamask.io/snaps/) . Yes [D'CENT Walletarrow-up-right](https://www.dcentwallet.com/en) A hardware and mobile wallet supporting Filecoin mainnet transactions, with f1 and f4 address support. Yes ### [hashtag](https://docs.filecoin.io/basics/assets/wallets#hot-versus-cold) Hot versus cold A hot wallet refers to any wallet that is permanently connected to the internet. They can be mobile, desktop, or browser-based. Hot wallets make it faster and easier to access digital assets but could be vulnerable to online attacks. Therefore, it is recommended to keep large balances in cold wallets and only use hot wallets to hold funds that need to be accessed frequently. Cold wallets most commonly refer to hardware wallet devices shaped like a USB stick. They are typically offline and only connected to the internet for transactions. Accessing a cold wallet requires physical possession of the device plus knowledge of the private key, which makes them more resistant to theft. Cold wallets can be less convenient and are most useful for storing larger balances securely. ### [hashtag](https://docs.filecoin.io/basics/assets/wallets#security) Security Wallets that have gone through an audit have had their codebase checked by a recognized security firm for security vulnerabilities and potential leaks. However, just because a wallet has had an audit does not mean that it’s 100% bug-proof. Be incredibly cautious when using unaudited wallets. Never share your seed phrase, password, or private keys. Bad actors will often use social engineering tactics such as phishing emails or posing as customer service or tech support to lure users into handing over their private key or seed phrase. ### [hashtag](https://docs.filecoin.io/basics/assets/wallets#add-a-wallet-to-our-list) Add a wallet to our list If you know of a wallet that supports Filecoin, you can submit a pull request to this page and add it! * Create an issue in [`filecoin-project/filecoin-docs`arrow-up-right](https://github.com/filecoin-project/filecoin-docs) with the name of the wallet and its features. * If the wallet is a mobile wallet, it must be available on both Android and iOS. * The wallet must have been audited. The results of this audit must be public. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/assets/wallets) [PreviousThe FIL tokenchevron-left](https://docs.filecoin.io/basics/assets/the-fil-token) [NextMetamask setupchevron-right](https://docs.filecoin.io/basics/assets/metamask-setup) Last updated 11 months ago * [Compatible wallets](https://docs.filecoin.io/basics/assets/wallets#compatible-wallets) * [Hot versus cold](https://docs.filecoin.io/basics/assets/wallets#hot-versus-cold) * [Security](https://docs.filecoin.io/basics/assets/wallets#security) * [Add a wallet to our list](https://docs.filecoin.io/basics/assets/wallets#add-a-wallet-to-our-list) sun-brightdesktopmoon sun-brightdesktopmoon --- # Actors | Filecoin Docs For those familiar with the Ethereum virtual machine (EVM), _actors_ work similarly to [smart contracts](https://docs.filecoin.io/smart-contracts/fundamentals) . In the Filecoin network, there are two types of actors: * [_Built-in actors_](https://docs.filecoin.io/basics/the-blockchain/actors#built-in-actors) : Hardcoded programs written ahead of time by network engineers that manage and orchestrate key subprocesses and subsystems in the Filecoin network. * [_User actors_](https://docs.filecoin.io/basics/the-blockchain/actors#user-actors-smart-contracts) : Code implemented by **any developer** that interacts with the Filecoin Virtual Machine (FVM). [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#built-in-actors) Built-in actors ----------------------------------------------------------------------------------------------------- Built-in actors are how the Filecoin network manages and updates _global state_. The _global state_ of the network at a given epoch can be thought of as the set of blocks agreed upon via network consensus in that epoch. This global state is represented as a _state tree_, which maps an actor to an _actor state_. An _actor state_ describes the current conditions for an individual actor, such as its FIL balance and its nonce. In Filecoin, actors trigger a _state transition_ by sending a _message_. Each block in the chain can be thought of as a **proposed** global state, where the block selected by network consensus sets the **new** global state. Each block contains a series of messages and a checkpoint of the current global state after the application of those messages. The Filecoin Virtual Machine (FVM) is the Filecoin network component that is in charge of the execution of all actor code. A basic example of how actors are used in Filecoin is the process by which storage providers prove storage and are subsequently rewarded. The process is as follows: 1. The [`StorageMinerActor`](https://docs.filecoin.io/basics/the-blockchain/actors#storagemineractor) processes proof of storage from a storage provider. 2. The storage provider is awarded storage power based on whether the proof is valid or not. 3. The [`StoragePowerActor`](https://docs.filecoin.io/basics/the-blockchain/actors#storagepoweractor) accounts for the storage power. 4. During block validation, the [`StoragePowerActor`](https://docs.filecoin.io/basics/the-blockchain/actors#storagepoweractor) state, which includes information on storage power allocated to each storage provider, is read. 5. Using the state information, the consensus mechanism randomly awards blocks to the storage providers with the most power, and the [`RewardActor`](https://docs.filecoin.io/basics/the-blockchain/actors#rewardactor) sends FIL to storage providers. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#blocks) Blocks Each block in the Filecoin chain contains the following: * Inline data such as current block height. * A pointer to the current state tree. * A pointer to the set of messages that, when applied to the network, generated the current state tree. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#state-tree) State tree A [Merkle Directed Acyclic Graph (Merkle DAG)](https://docs.filecoin.io/reference/general/glossary#merkle-directed-acyclic-graph) is used to map the state tree and the set of messages. Nodes in the state tree contain information on: * Actors, like FIL balance, nonce, and a pointer (CID) to actor state data. * Messages in the current block ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#messages) Messages Like the state tree, a Merkle Directed Acyclic Graph (Merkle DAG) is used to map the set of messages for a given block. Nodes in the messages may contain information on: * The actor the message was sent to * The actor that sent the message * Target method to call on the actor being sent the message * A cryptographic signature for verification * The amount of FIL transferred between actors ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#actor-code) Actor code The code that defines an actor in the Filecoin network is separated into different methods. Messages sent to an actor contain information on which method(s) to call and the input parameters for those methods. Additionally, actor code interacts with a _runtime_ object, which contains information on the general state of the network, such as the current epoch, cryptographic signatures, and proof validations. Like smart contracts in other blockchains, actors must pay a _gas fee_, which is some predetermined amount of FIL to offset the cost (network resources used, etc.) of a transaction. Every actor has a Filecoin balance attributed to it, a state pointer, a code that tells the system what type of actor it is, and a nonce, which tracks the number of messages sent by this actor. ### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#types-of-built-in-actors) Types of built-in actors The 11 different types of built-in actors are as follows: * [CronActor](https://docs.filecoin.io/basics/the-blockchain/actors#cronactor) * [InitActor](https://docs.filecoin.io/basics/the-blockchain/actors#initactor) * [AccountActor](https://docs.filecoin.io/basics/the-blockchain/actors#accountactor) * [RewardActor](https://docs.filecoin.io/basics/the-blockchain/actors#rewardactor) * [StorageMarketActor](https://docs.filecoin.io/basics/the-blockchain/actors#storagemarketactor) * [StorageMinerActor](https://docs.filecoin.io/basics/the-blockchain/actors#storagemineractor) * [MultisigActor](https://docs.filecoin.io/basics/the-blockchain/actors#multisigactor) * [PaymentChannelActor](https://docs.filecoin.io/basics/the-blockchain/actors#paymentchannelactor) * [StoragePowerActor](https://docs.filecoin.io/basics/the-blockchain/actors#storagepoweractor) * [VerifiedRegistryActor](https://docs.filecoin.io/basics/the-blockchain/actors#verifiedregistryactor) * [SystemActor](https://docs.filecoin.io/basics/the-blockchain/actors#systemactor) #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#cronactor) CronActor The `CronActor` sends messages to the `StoragePowerActor` and `StorageMarketActor` at the end of each epoch. The messages sent by `CronActor` indicate to StoragePowerActor and StorageMarketActor how they should maintain the internal state and process deferred events. This system actor is instantiated in the genesis block and interacts directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#initactor) InitActor The `InitActor` can initialize new actors on the Filecoin network. This system actor is instantiated in the genesis block and maintains a table resolving a public key and temporary actor addresses to their canonical ID addresses. The `InitActor` interacts directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#accountactor) AccountActor The `AccountActor` is responsible for user accounts. Account actors are not created by the `InitActor` but by sending a message to a public-key style address. The account actor updates the state tree with a new actor address and interacts directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#rewardactor) RewardActor The `RewardActor` manages unminted Filecoin tokens and distributes rewards directly to miner actors, where they are locked for vesting. The reward value used for the current epoch is updated at the end of an epoch. The `RewardActor` interacts directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#storagemarketactor) StorageMarketActor The `StorageMarketActor` is responsible for processing and managing on-chain deals. This is also the entry point of all storage deals and data into the system. This actor keeps track of storage deals and the locked balances of both the client storing data and the storage provider. When a deal is posted on-chain through the `StorageMarketActor`, the actor will first check if both transacting parties have sufficient balances locked up and include the deal on-chain. Additionally, the `StorageMarketActor` holds _Storage Deal Collateral_ provided by the storage provider to collateralize deals. This collateral is returned to the storage provider when all deals in the sector successfully conclude. This actor does not interact directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#storagemineractor) StorageMinerActor The `StorageMinerActor` is created by the `StoragePowerActor` and is responsible for storage mining operations and the collection of mining proofs. This actor is a key part of the Filecoin storage mining subsystem, which ensures a storage miner can effectively commit storage to Filecoin and handles the following: * Committing new storage * Continuously proving storage * Declaring storage faults * Recovering from storage faults This actor does not interact directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#multisigactor) MultisigActor The `MultisigActor` is responsible for dealing with operations involving the Filecoin wallet and represents a group of transaction signers with a maximum of 256. Signers may be external users or the `MultisigActor` itself. This actor does not interact directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#paymentchannelactor) PaymentChannelActor The `PaymentChannelActor` creates and manages _payment channels_, a mechanism for off-chain microtransactions for Filecoin dApps to be reconciled on-chain at a later time with less overhead than a standard on-chain transaction and no gas costs. Payment channels are uni-directional and can be funded by adding to their balance. To create a payment channel and deposit fund, a user calls the `PaymentChannelActor`. This actor does not interact directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#storagepoweractor) StoragePowerActor The `StoragePowerActor` is responsible for keeping track of the storage power allocated to each storage miner and has the ability to create a `StorageMinerActor`. This actor does not interact directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#verifiedregistryactor) VerifiedRegistryActor The `VerifiedRegistryActor` is responsible for managing Filecoin Plus clients. This actor can add a verified client to the Filecoin Plus program, remove and reclaim expired DataCap allocations, and manage claims. This actor does not interact directly with the FVM. #### [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#systemactor) SystemActor For more information on `SystemActor`, see the [source codearrow-up-right](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/system/system_actor.go) . [hashtag](https://docs.filecoin.io/basics/the-blockchain/actors#user-actors-smart-contracts) User actors (smart contracts) ------------------------------------------------------------------------------------------------------------------------------- A _user actor_ is code defined by **any developer** that can interact with the FVM, otherwise known as a _smart contract_. A _smart contract_ is a small, self-executing block of custom code that runs on other blockchains, like Ethereum. In the Filecoin network, the term is a synonym for [_user actor_](https://docs.filecoin.io/basics/the-blockchain/actors#user-actors-smart-contracts) . You may see the term _smart contract_ used in tandem with _user actor_, but there is no difference between the two. With the FVM, actors can be written in Solidity. In future updates, any language that compiles to WASM will be supported. With user actors, users can create and enforce custom rules for storing and accessing data on the network. The FVM is responsible for actors and ensuring that they are executed correctly and securely. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/the-blockchain/actors) [PreviousThe blockchainchevron-left](https://docs.filecoin.io/basics/the-blockchain) [NextAddresseschevron-right](https://docs.filecoin.io/basics/the-blockchain/addresses) Last updated 1 year ago * [Built-in actors](https://docs.filecoin.io/basics/the-blockchain/actors#built-in-actors) * [Blocks](https://docs.filecoin.io/basics/the-blockchain/actors#blocks) * [State tree](https://docs.filecoin.io/basics/the-blockchain/actors#state-tree) * [Messages](https://docs.filecoin.io/basics/the-blockchain/actors#messages) * [Actor code](https://docs.filecoin.io/basics/the-blockchain/actors#actor-code) * [Types of built-in actors](https://docs.filecoin.io/basics/the-blockchain/actors#types-of-built-in-actors) * [User actors (smart contracts)](https://docs.filecoin.io/basics/the-blockchain/actors#user-actors-smart-contracts) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage proving | Filecoin Docs Storage proving, known as _Proof-of-Spacetime_ (“PoSt”), is the mechanism that the Filecoin blockchain uses to validate that storage providers are continuously providing the storage they claim. Storage providers earn block rewards each time they successfully answer a PoSt challenge. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving#proving-deadlines) Proving deadlines --------------------------------------------------------------------------------------------------------------------------------- As a storage provider, you must preserve the data for the duration of the [deal](https://docs.filecoin.io/reference/general/glossary#deal) , which are on-chain agreements between a client and a storage provider. As of March 2023, deals must have a minimum duration of 180 days, and maximum duration of 540 days. The latter value was chosen to balance long deal length with cryptographic security. Storage providers must be able to continuously prove the availability and integrity of the data they are storing. Every storage sector of 32 GiB or 64 GiB gets verified once in each 24 hour period. This period is called a _proving period_. Every proving period of 24 hours is broken down into a series of 30 minute, non-overlapping _deadlines_. This means there are 48 deadlines per day. Storage sectors are grouped in a _partition_, and assigned to a proving deadline. All storage sectors in a given partition will always be verified during the same deadline. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving#windowpost) WindowPoSt ------------------------------------------------------------------------------------------------------------------- The cryptographic challenge for storage proving is called _Window Proof-of-Spacetime_ (WindowPoSt). Storage providers have a deadline of 30 minutes to respond to this WindowPoSt challenge via a message on the blockchain containing a [zk-SNARKarrow-up-right](https://en.wikipedia.org/wiki/Zero-knowledge_proof) proof of the verified sector. Failure to submit this proof within the 30 minute deadline, or failure to submit it at all, results in _slashing_. Slashing means a portion of the [collateral](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral) will be forfeited to the f099 burn address and the _storage power_ of the storage provider gets reduced. Slashing is a way to penalize storage providers who fail to meet the agreed upon standards of storage. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) [PreviousFilecoin economicschevron-left](https://docs.filecoin.io/storage-providers/filecoin-economics) [NextFIL collateralchevron-right](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral) Last updated 1 year ago * [Proving deadlines](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving#proving-deadlines) * [WindowPoSt](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving#windowpost) sun-brightdesktopmoon sun-brightdesktopmoon --- # Saturn | Filecoin Docs ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-fc5ff8325da041fcda8f77a0e8962cf5c8c0973c%252Fbasics-how-retrieval-works-saturn-saturn-homepage.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e3633&sv=2) [https://saturn.tech/arrow-up-right](https://saturn.tech/) Saturn is a Web3 CDN in Filecoin’s retrieval market. On one side of the network, websites buy fast, low-cost content delivery. On the other side, Saturn node operators earn Filecoin by fulfilling requests. Saturn is trustless, permissionless, and inclusive. Anyone can run Saturn software, contribute to the network, and earn Filecoin. Content on Saturn is IPFS content-addressed. Every piece of content is immutable, and every response is verifiable. Incentives unite, align, and grow the network. Node operators earn Filecoin for accelerating web content, and websites get faster content delivery for less. Find out more over at [saturn.techarrow-up-right](https://saturn.tech/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-retrieval-works/saturn) [PreviousServing retrievalschevron-left](https://docs.filecoin.io/basics/how-retrieval-works/serving-retrievals) [NextProject and communitychevron-right](https://docs.filecoin.io/basics/project-and-community) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin compared to | Filecoin Docs Filecoin combines many elements of other file storage and distribution systems. What makes Filecoin unique is that it runs on an open, peer-to-peer network while still providing economic incentives and proofs to ensure files are being stored correctly. This page compares Filecoin against other technologies that share some of the same properties. * [Filecoin vs. Amazon S3, Google Cloud Storage](https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to#filecoin-vs.-amazon-s3-google-cloud-storage) * [Filecoin vs. Bitcoin](https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to#filecoin-tokens-fil-vs.-bitcoin-tokens-btc) #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to#filecoin-vs.-amazon-s3-google-cloud-storage) Filecoin vs. Amazon S3, Google Cloud Storage Filecoin Amazon S3, Google Cloud Storage Main use case Storing files at hypercompetitive prices Storing files using a familiar, widely-supported service Pricing Determined by a hypercompetitive open market Set by corporate pricing departments Centralization Many small, independent storage providers A handful of large companies Reliability stats Independently checked by the network and publicly verifiable Companies self-report their own stats API Applications can access all storage providers using the Filecoin protocol Applications must implement a different API for each storage provider Retrieval Competitive market for retrieving files Typically more expensive than storing files to lock users in Fault handling If a file is lost, the user is refunded automatically by the network Companies can offer users credit if files are lost or unavailable Support If something goes wrong, the Filecoin protocol determines what happens without human intervention If something goes wrong, users contact the support help desk to seek resolution Physical location Miners located anywhere in the world Limited to where provider’s data centres are located Becoming a storage provider Low barrier to entry for storage providers (computer, hard drive, internet connection) High barrier to entry for storage providers (legal agreements, marketing, support staff) #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to#filecoin-tokens-fil-vs.-bitcoin-tokens-btc) Filecoin tokens (FIL) vs. Bitcoin tokens (BTC) FIL BTC Main use case File storage Payment network Data storage Good at storing large amounts of data inexpensively Small amounts of data can be stored on blockchain at significant cost Proof Blockchain secured using proof of replication and proof of spacetime Blockchain secured using proof of work Consensus power Miners with the most storage have the most power Miners with the most computational speed have the most power Mining hardware Hard drives, GPUs, and CPUs ASICs Mining usefulness Mining results in peoples’ files being stored Mining results in heat Types of provider Storage provider, retrieval provider, repair provider All providers perform proof of work Uptime requirements Storage providers rewarded for uptime, penalized for downtime Miners can go offline without being penalized Network status Mainnet running since 2020 Mainnet running since 2009 [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to) [PreviousForums and FIPschevron-left](https://docs.filecoin.io/basics/project-and-community/forums-and-fips) [NextFilecoin FAQschevron-right](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Get FIL | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/assets/get-fil#exchanges) Exchanges ---------------------------------------------------------------------------------- A cryptocurrency exchange is a digital platform where users can buy, sell, and trade cryptocurrencies for other cryptocurrencies or traditional fiat currencies like USD, EUR, or JPY. Cryptocurrency exchanges provide a marketplace for users to trade their digital assets and are typically run by private companies that facilitate these transactions. These exchanges can differ in terms of fees, security protocols, and the variety of cryptocurrencies they support. Users can typically sign up for an account with a cryptocurrency exchange, deposit funds into their account, and then use those funds to purchase or sell cryptocurrencies at the current market price. Some exchanges offer advanced trading features like margin trading, stop-loss orders, and trading bots. It's important to note that while cryptocurrency exchanges can offer convenience and liquidity for traders, they also come with risks like hacking and regulatory uncertainty. Therefore, users should take precautions to protect their funds and do their own research before using any particular exchange. ### [hashtag](https://docs.filecoin.io/basics/assets/get-fil#supported-exchanges) Supported exchanges There are many exchanges that allow users to buy, sell, and trade FIL. Websites like [coingecko.comarrow-up-right](https://www.coingecko.com/) and [coinmarketcap.comarrow-up-right](https://coinmarketcap.com/currencies/filecoin/markets/) keep track of which exchanges support which cryptocurrencies. You can use these lists to help you decide which exchange to use. Once you have found an exchange you want to use, you will have to create an account with that exchange. Many exchanges have strict verification and Know-Your-Customer (KYC) processes in place, so it may take a few days to create your account. However, most large exchanges can verify your information in a few minutes. Purchasing cryptocurrency varies from exchange to exchange, but the process is usually something like this: 1. Add funds to your exchange account in your local currency (USD, EUR, YEN, etc.). 2. Exchange your local currency for FIL at a set price. ### [hashtag](https://docs.filecoin.io/basics/assets/get-fil#address-compatibility) Address compatibility Some exchanges allow users to fund and withdraw FIL using any of the [Filecoin address type](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types) . However, some exchanges only support one or a handful of the available address types. Most exchanges do not currently support [f410 addresses](https://docs.filecoin.io/basics/the-blockchain/addresses) . If your exchange does not yet support Filecoin Eth-style 0x addresses, you must create a wallet to _relay_ the funds through. Take a look at the [Transfer FIL page](https://docs.filecoin.io/basics/assets/transfer-fil) for details on how to transfer your funds safely. [hashtag](https://docs.filecoin.io/basics/assets/get-fil#fiat-on-ramps) Fiat on-ramps ------------------------------------------------------------------------------------------ A fiat on-ramp is a service or platform that allows individuals to convert traditional fiat currencies such as the US dollar, Euro, or any other government-issued currency into cryptocurrencies. These on-ramps serve as entry points for people who want to start participating in the cryptocurrency ecosystem by purchasing digital currencies with their money but don't want to sign up with a cryptocurrency exchange. FIL is supported by a number of fiat on-ramps, such as: * [Changellyarrow-up-right](https://changelly.com/) * [ChangeNowarrow-up-right](https://changenow.io/) * [MoonPayarrow-up-right](https://www.moonpay.com/) * [Ramp Networkarrow-up-right](https://ramp.network/) * [Simplexarrow-up-right](https://www.simplex.com/) . circle-info If you know of any other services that can be added to list this, [raise an issue on GitHubarrow-up-right](https://github.com/filecoin-project/filecoin-docs/issues/new) . Users are cautioned to do their own due diligence with respect to choosing a fiat on-ramp provider. ### [hashtag](https://docs.filecoin.io/basics/assets/get-fil#crypto-atms) Crypto ATMs Crypto ATMs, also known as Bitcoin ATMs, are kiosks that allow individuals to buy and/or sell cryptocurrencies in exchange for fiat currency like the US dollar. They function similarly to traditional ATMs but are not connected to a bank account. Instead, they connect the user directly to a cryptocurrency exchange. Using a Bitcoin ATM often comes with higher fees than online exchanges. Fees can vary, but they can range anywhere from 5% to 15% or even more per transaction. [hashtag](https://docs.filecoin.io/basics/assets/get-fil#test-fil) Test FIL -------------------------------------------------------------------------------- If you’re looking to get FIL to test your applications on a testnet like [Calibration](https://docs.filecoin.io/networks/calibration) , then check how to get test tokens! Test FIL is often referred to as `tFIL`. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/assets/get-fil) [PreviousMetamask setupchevron-left](https://docs.filecoin.io/basics/assets/metamask-setup) [NextTransfer FILchevron-right](https://docs.filecoin.io/basics/assets/transfer-fil) Last updated 1 year ago * [Exchanges](https://docs.filecoin.io/basics/assets/get-fil#exchanges) * [Supported exchanges](https://docs.filecoin.io/basics/assets/get-fil#supported-exchanges) * [Address compatibility](https://docs.filecoin.io/basics/assets/get-fil#address-compatibility) * [Fiat on-ramps](https://docs.filecoin.io/basics/assets/get-fil#fiat-on-ramps) * [Crypto ATMs](https://docs.filecoin.io/basics/assets/get-fil#crypto-atms) * [Test FIL](https://docs.filecoin.io/basics/assets/get-fil#test-fil) sun-brightdesktopmoon sun-brightdesktopmoon --- # Related projects | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/project-and-community/related-projects#libp2p) Libp2p ---------------------------------------------------------------------------------------------------- A modular network stack, libp2p enables you to run your network applications free from runtime and address services, independently of their location. Learn more at [libp2p.io/arrow-up-right](http://libp2p.io/) . ### [hashtag](https://docs.filecoin.io/basics/project-and-community/related-projects#ipld) IPLD IPLD is the data model of the content-addressable web. It allows us to treat all hash-linked data structures as subsets of a unified information space, unifying all data models that link data with hashes as instances of IPLD. Learn more at [ipld.io/arrow-up-right](https://ipld.io/) . ### [hashtag](https://docs.filecoin.io/basics/project-and-community/related-projects#ipfs) IPFS IPFS is a distributed system for storing and accessing files, websites, applications, and data. However, it does not have support for incentivization or guarantees of this distributed storage; Filecoin provides the incentive layer. Learn more at [ipfs.tech/arrow-up-right](https://ipfs.tech/) . ### [hashtag](https://docs.filecoin.io/basics/project-and-community/related-projects#multiformats) Multiformats The Multiformats Project is a collection of protocols which aim to future-proof systems through self-describing format values that allow for interoperability and protocol agility. Learn more at [multiformats.io/arrow-up-right](https://multiformats.io/) . ### [hashtag](https://docs.filecoin.io/basics/project-and-community/related-projects#protoschool) ProtoSchool Interactive tutorials on decentralized web protocols, designed to introduce you to decentralized web concepts, protocols, and tools. Complete code challenges right in your web browser and track your progress as you go. Explore ProtoSchool’s tutorials on Filecoin at [proto.school/arrow-up-right](https://proto.school/#/tutorials?course=filecoin) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/related-projects) [PreviousFilecoin FAQschevron-left](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs) [NextSocial mediachevron-right](https://docs.filecoin.io/basics/project-and-community/social-media) Last updated 1 year ago * [Libp2p](https://docs.filecoin.io/basics/project-and-community/related-projects#libp2p) * [IPLD](https://docs.filecoin.io/basics/project-and-community/related-projects#ipld) * [IPFS](https://docs.filecoin.io/basics/project-and-community/related-projects#ipfs) * [Multiformats](https://docs.filecoin.io/basics/project-and-community/related-projects#multiformats) * [ProtoSchool](https://docs.filecoin.io/basics/project-and-community/related-projects#protoschool) sun-brightdesktopmoon sun-brightdesktopmoon --- # Quickstart guide | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#explore-the-storage-provider-documentation) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Explore the storage provider documentation ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Get ready to dive into the valuable resources of the [storage provider documentation](https://docs.filecoin.io/storage-providers/basics) . This comprehensive guide offers a wealth of information about the role of storage providers in the Filecoin ecosystem, including insights into the economic aspects. You’ll also gain knowledge about the software architecture, hardware infrastructure, and the necessary skills for success. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#gain-insights-into-roi-and-collaterals-role) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Gain insights into ROI and collateral’s role ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- To run a successful storage provider business, it’s crucial to understand the concept of [Return on Investment (ROI)arrow-up-right](https://calc.filecoin.eu/) and the significance of collateral. By planning ahead and considering various factors, such as CAPEX, OPEX, network variables, and collateral requirements, you can make informed decisions that impact your business’s profitability and desired capacity. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#get-to-know-the-ecosystem) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Get to know the ecosystem --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- One of the truly enriching elements of the Filecoin ecosystem lies in its vibrant community. Meet the community on the [Filecoin Slackarrow-up-right](https://filecoin.io/slack) . Within this dynamic network, you’ll find a treasure trove of individuals who are eager to share their experiences and offer invaluable solutions to the challenges they’ve encountered along the way. Whether it’s navigating the intricacies of storage provider operations or overcoming hurdles on the blockchain, this supportive community stands ready to lend a helping hand. Embrace the spirit of collaboration and tap into this remarkable network. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#unleash-the-power-of-filecoins-reference-implementation) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Unleash the Power of Filecoin’s Reference Implementation ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Get ready to dive into the heart of the Filecoin network with [Lotusarrow-up-right](https://lotus.filecoin.io/) , the leading reference implementation. As the most widely used software stack for interacting with the blockchain and operating a storage provider setup, Lotus holds the key to unlocking a world of possibilities. Seamlessly navigate the intricacies of this powerful tool and leverage its capabilities to propel your journey forward. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#hands-on-learning-and-exploration) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Hands-on learning and exploration ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- It’s time to roll up your sleeves and embark on a hands-on adventure. With a multitude of options at your disposal, setting up a [local devnet](https://docs.filecoin.io/networks/local-testnet) environment is the easiest and most exciting way to kickstart your Filecoin journey. Immerse yourself in the captivating world of sealing sectors and witness firsthand how this critical process works. Feel the thrill of experimentation as you delve deeper into the inner workings of this remarkable technology. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#transforming-into-a-storage-provider) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Transforming into a storage provider ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Congratulations on taking the next leap in becoming a full-fledged storage provider! Now is the time to determine your starting capacity and architect a tailored solution to accommodate it. Equip yourself with the [necessary hardware](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures) to kickstart your journey on the mainnet. Test your setup on the calibration testnet to fine-tune your skills and ensure seamless operations. Once you’re ready, brace yourself for the excitement of joining the mainnet. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#supercharge-your-mainnet-experience) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Supercharge your mainnet experience ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- As you step into the vibrant realm of the mainnet, it’s time to supercharge your storage provider capabilities with [Boostarrow-up-right](https://boost.filecoin.io/) . Discover the immense potential of this powerful software designed to help you secure storage deals and offer efficient data retrieval services to data owners. Unleash the full force of Boost and witness the transformative impact it has on your Filecoin journey. [hashtag](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#discover-the-world-of-verified-deals-and-tools) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d5fe255022affb97af459a3dc5d1093c28e4cf3a%252Fstorage-provider-basics-quickstart-guide-icon.png%3Falt%3Dmedia&width=40&dpr=3&quality=100&sign=bd448290&sv=2) Discover the world of verified deals and tools --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Within the Filecoin network there are many [programs and tools](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs) designed to enhance your storage provider setup. Uncover the power of these tools as you dive into the documentation, gaining valuable insights and expanding your knowledge. Make the best use of data programs on your path to success. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/basics/quickstart-guide) [PreviousBasicschevron-left](https://docs.filecoin.io/storage-providers/basics) [NextFilecoin economicschevron-right](https://docs.filecoin.io/storage-providers/filecoin-economics) Last updated 1 year ago * [Explore the storage provider documentation](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#explore-the-storage-provider-documentation) * [Gain insights into ROI and collateral’s role](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#gain-insights-into-roi-and-collaterals-role) * [Get to know the ecosystem](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#get-to-know-the-ecosystem) * [Unleash the Power of Filecoin’s Reference Implementation](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#unleash-the-power-of-filecoins-reference-implementation) * [Hands-on learning and exploration](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#hands-on-learning-and-exploration) * [Transforming into a storage provider](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#transforming-into-a-storage-provider) * [Supercharge your mainnet experience](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#supercharge-your-mainnet-experience) * [Discover the world of verified deals and tools](https://docs.filecoin.io/storage-providers/basics/quickstart-guide#discover-the-world-of-verified-deals-and-tools) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin plus | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#what-is-filecoin-plus) What is Filecoin Plus? ---------------------------------------------------------------------------------------------------------------------------- The goal of the Filecoin Plus program is to increase the amount of useful data stored with storage providers by clients on the Filecoin network. In short, this is achieved by appointing allocators responsible for assigning DataCap tokens to clients that are vetted by the allocator as trusted parties storing useful data. Clients then pay DataCap to storage providers as part of a storage deal, which increases a storage provider’s probability of earning block rewards. A full description of this mechanism is described below. Filecoin Plus creates demand on the Filecoin network, ensuring the datasets stored on the network are legitimate and useful to either the clients, or a third party. [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#storage-providers-and-datacap) Storage Providers & DataCap ----------------------------------------------------------------------------------------------------------------------------------------- Filecoin Plus introduces two concepts important to interactions on the Filecoin network – DataCap and Quality Adjusted Power (QAP). ### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#datacap) DataCap DataCap is a token paid to storage providers as part of a deal in which the client and the data they are storing is verified by a Filecoin Plus allocator. Batches of DataCap are granted to allocators by root-key holders, allocators give DataCap to verified clients, and clients pay DataCap to storage providers as part of a deal. The more DataCap a storage provider ends up with, the higher probability they have to earn block rewards. The role of each of these participants, and how DataCap is used in a Filecoin Plus deal, is described below in the "Filecoin Plus Processes & Participants" section. ### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#quality-adjusted-power) Quality Adjusted Power Quality Adjusted Power is an assigned rating to a given [sectorarrow-up-right](https://spec.filecoin.io/systems/filecoin_mining/sector/) , the basic unit of storage on the Filecoin network. Quality Adjusted Power is a function of a number of features of the sector, including, but not limited to, the sector’s size and promised duration, and whether the sector includes a Filecoin+ deal. It's clear to the network that a sector includes a Filecoin Plus deal if a deal in that sector involves DataCap paid to the storage provider. The more Filecoin Plus verified data the storage provider has in a sector, the higher the Quality-Adjusted Power a storage provider has, which linearly increases the number of votes a miner has in the [Secret Leader Electionarrow-up-right](https://spec.filecoin.io/algorithms/expected_consensus/) , determining which storage provider gets to serve as the verifier for the next block in the blockchain, and thus increasing the probability the storage provider is afforded the opportunity to earn block rewards. For more details on Quality Adjusted Power, see the [Filecoin specificationarrow-up-right](https://spec.filecoin.io/systems/filecoin_blockchain/storage_power_consensus/) . #### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#important) Important There is a common misconception that a Filecoin Plus deal increases the miner’s reward paid to a Filecoin storage provider by a factor of ten. This is not true, Filecoin+ does not increase the amount of block rewards available to storage providers. Including Filecoin Plus deals in a sector increases the Quality Adjusted Power of a storage provider, which increases the probability a storage provider is selected as the block verifier for the next block on the Filecoin blockchain, and thus increases the probability they earn block rewards. Consider first a network with ten storage providers. Initially, each storage provider has an equal 10% probability of winning available block rewards in a given period: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2Fbf496536-c8a6-4847-8474-f849bdc56c20&width=768&dpr=3&quality=100&sign=3dd6b1b5&sv=2) verified-deals-impact-1 In the above visualization, "VD" means "verified deals", that is, deals that have been reviewed by allocators and have associated spending of datacap. If two of these storage providers begin filling their sectors with verified deals, their chances of winning a block reward increases by a factor of ten relative to their peers. Each one of these storage providers with verified deals in their sectors has a 36% chance of winning the block reward, while storage providers with only [regular dealsarrow-up-right](https://spec.filecoin.io/systems/filecoin_blockchain/storage_power_consensus/#section-systems.filecoin_mining.sector.sector_quality) in their sectors have a 4% probability of winning the block rewards. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2Fea79d2b1-2c65-47da-a09e-04af1aeb02bb&width=768&dpr=3&quality=100&sign=440efad0&sv=2) verified-deals-impact-2 Incentives for storage providers to accept verified deals is strongest initially. As more and more storage providers include verified deals in their sectors, the probability any one of them earns the block rewards returns to an equal chance. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F634f96eb-c0b4-4230-95ca-b9a4875b180d&width=768&dpr=3&quality=100&sign=8461b80e&sv=2) filecoinplus3 As seen in the diagrams above, Filecoin Plus increases the collateral requirements needed by a storage provider. As a higher percentage of storage providers include verified deals in their sectors, the collateral needed by each storage provider will increase. To learn more about storage provider collateral, see [this linkarrow-up-right](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral) . [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#filecoin-processes-and-participants) Filecoin+ Processes & Participants ------------------------------------------------------------------------------------------------------------------------------------------------------ The participants of the Filecoin+ program, along with how they interact with each other, is detailed here: * Decisions as to who the root-key holders should be, how they should grant and remove batches of DataCap to/from allocators, and other important decisions about the Filecoin+ program are determined through Filecoin Improvement Proposals (FIPs), the community governance process. Learn more about [Filecoin+ governancearrow-up-right](https://github.com/filecoin-project/allocator-governance/tree/main) . To see a list of FIPs, see this [linkarrow-up-right](https://github.com/filecoin-project/FIPs) . * Root-key holders execute the governance process for Filecoin+ as determined through community executed Filecoin Improvement Proposals, their role is to grant and remove batches of DataCap to/from allocators. Root-key holders are signers to a multisig wallet on-chain –a majority of signers are needed for an allocator to be granted or removed. * Allocators perform due diligence on clients and the data they are storing, allocate DataCap to trusted clients, and facilitate predetermined dispute resolution processes. To learn more about how allocators are chosen and evaluated, see [this blogarrow-up-right](https://blog.allocator.tech/2024/05/who-are-allocators.html) . * Clients are participants in the Filecoin network who store data with a storage provider. A trusted client, as determined by an allocator who performs due diligence on the client and the data they are looking to store, will be given DataCap by the allocator. Clients offer to give this DataCap to a storage provider as part of a deal, which increases the “deal quality multiplier” of the deal, and in turn the likelihood a storage provider will accept the deal. * Storage providers who receive DataCap as part of a deal are able to use this DataCap to increase their “quality adjusted power” of the storage provider on the network by a factor of ten. As described above, this increases their probability of being selected as the verifier for a block, affording them the opportunity to earn block rewards. [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#how-filecoin-plus-works) How Filecoin Plus Works ------------------------------------------------------------------------------------------------------------------------------- A visualization of the interactions between parties involved in a Filecoin+ deal described above is shown below in Figure 1. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F61d1e3c9-438c-4614-b333-14c4fb0dc0e1&width=768&dpr=3&quality=100&sign=443e972d&sv=2) Figure 1 | Diagram showing participant interactions in a Filecoin+ deal. [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#acquiring-datacap-for-clients-and-builders) Acquiring DataCap for Clients & Builders ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Clients can secure DataCap by making a request to an allocator. Each one of the allocators maintain their own applications for requesting DataCap. One such allocator is [Filecoin Incentive Design Labs (FIDL)arrow-up-right](https://www.fidl.tech/) . They maintain a [Github repositoryarrow-up-right](https://github.com/fidlabs) that includes an [applicationarrow-up-right](https://github.com/fidlabs/Open-Data-Pathway/issues/new/choose) where clients can make a request of FIDL for DataCap. Clients and builders looking to acquire DataCap may consider applying directly with FIDL, noting that all DataCap applications are transparent and open for public review on the [issues pagearrow-up-right](https://github.com/fidlabs/Open-Data-Pathway/issues) . ### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#steps-to-acquire-mainnet-datacap-as-a-client) Steps to Acquire Mainnet DataCap as a Client The steps a client should follow to acquire DataCap are as follows: 1. Create a [Filecoin walletarrow-up-right](https://docs.filecoin.io/basics/assets/wallets) . 2. Choose an allocator from the [full list of active allocatorsarrow-up-right](https://github.com/filecoin-project/Allocator-registry) or the [active list of allocatorsarrow-up-right](https://allocator.tech/) who have verified public datasets. 3. Check that you satisfy the requirements of the allocator. In the case of uploading open source datasets with FIDL as the allocator, the client will need to demonstrate to FIDL that they can (1) satisfy a third party Know Your Customer(KYC) identity check, (2) provide the details of storage provider (entity, storage location) where the data is intended to be stored, and (3) demonstrate proof that the dataset can be actively retrieved. You can learn more about [FIDL’s requirements and application processarrow-up-right](https://www.fidl.tech/apply-for-datacap) . 4. Submit an application for DataCap from an allocator. You can submit a request to FIDL via their [Github application formarrow-up-right](https://github.com/fidlabs/Open-Data-Pathway/issues/new/choose) or [Google Formarrow-up-right](https://www.fidl.tech/apply-for-datacap) . 5. Use the DataCap in a storage deal. ### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#steps-to-acquire-testnet-datacap-as-a-builder) Steps to Acquire Testnet DataCap as a Builder For builders on the [Calibration testnet](https://docs.filecoin.io/networks/calibration) who need testnet DataCap to test their applications, a faucet is available. The steps a builder should follow to acquire testnet DataCap are as follows: 1. Create a wallet on Filecoin Calibration testnet. For more information, see the [Calibration docs](https://docs.filecoin.io/networks/calibration) or [Githubarrow-up-right](https://github.com/filecoin-project/testnet-calibration) . 2. Grant the wallet address DataCap by using this [faucetarrow-up-right](https://faucet.calibnet.chainsafe-fil.io/datacap.html) . [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#datacap-for-smart-contracts) **DataCap for Smart contracts** ------------------------------------------------------------------------------------------------------------------------------------------- Smart contracts can acquire and use DataCap just like any regular client. To do so, simply enter the `f410` address of the smart contract as the client address when making a request for DataCap. ### [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#important-1) Important It’s important to note that DataCap allocations are a one-time credit for a Filecoin address and cannot be transferred between smart contracts. If you need to redeploy the smart contract, you must request additional DataCap. [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#how-to-use-datacap) How to Use DataCap --------------------------------------------------------------------------------------------------------------------- Once you have an address with DataCap, you can make deals using DataCap as a part of the payment. Because storage providers receive a deal quality multiplier for taking Filecoin+ deals, many storage providers offer special pricing and services to attract clients who use DataCap to make deals. [Learn more about Storage Deals.arrow-up-right](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals) By default, when you make a deal with an address with DataCap allocated, you will spend that DataCap when making the deal. [hashtag](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#visualizing-blockchain-data-for-filecoin) Visualizing Blockchain Data for Filecoin+ ------------------------------------------------------------------------------------------------------------------------------------------------------------------ There are three resources you can use to check the current status of the Filecoin+ deals and participants: * The [Filecoin Pulse dashboardarrow-up-right](https://filecoinpulse.pages.dev/allocators/) includes visualizations of and tables for data about Filecoin+ deals on the Filecoin blockchain, organized by Allocators, Clients, and Storage Providers. * The [Datacap Stats dashboardarrow-up-right](https://datacapstats.io/) shows DataCap allocations, including the number of allocators, clients, and storage providers. You can also see number and size of deals. * The [Starboard Dashboardarrow-up-right](https://dashboard.starboard.ventures/market-deals) includes network health data related to Filecoin+ verified deals. To learn more about Filecoin Plus, review [FIP003: Filecoin Plus Principlesarrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0003.md) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) [PreviousHow storage workschevron-left](https://docs.filecoin.io/basics/how-storage-works) [NextStorage onrampschevron-right](https://docs.filecoin.io/basics/how-storage-works/storage-onramps) Last updated 1 year ago * [What is Filecoin Plus?](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#what-is-filecoin-plus) * [Storage Providers & DataCap](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#storage-providers-and-datacap) * [DataCap](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#datacap) * [Quality Adjusted Power](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#quality-adjusted-power) * [Filecoin+ Processes & Participants](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#filecoin-processes-and-participants) * [How Filecoin Plus Works](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#how-filecoin-plus-works) * [Acquiring DataCap for Clients & Builders](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#acquiring-datacap-for-clients-and-builders) * [Steps to Acquire Mainnet DataCap as a Client](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#steps-to-acquire-mainnet-datacap-as-a-client) * [Steps to Acquire Testnet DataCap as a Builder](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#steps-to-acquire-testnet-datacap-as-a-builder) * [DataCap for Smart contracts](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#datacap-for-smart-contracts) * [Important](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#important-1) * [How to Use DataCap](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#how-to-use-datacap) * [Visualizing Blockchain Data for Filecoin+](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus#visualizing-blockchain-data-for-filecoin) sun-brightdesktopmoon sun-brightdesktopmoon --- # Transfer FIL | Filecoin Docs After FVM launched, a new Ethereum-compatible address type (`f410` address) was introduced to the Filecoin network. This new `f410` address can be converted into Ethereum-style addresses starting with `0x` so that it can be used in any Ethereum-compatible toolings or dApps. Filecoin addresses start with `f`, so we will use the `f` address in this tutorial. And Ethereum-style addresses start with `0x`, so we will use the `0x` address in this tutorial. There are four paths for transferring FIL tokens across the Filecoin network, depending on which address type you are transferring from and to. From an `0x` address From a `f` address **To an** `**0x**` **address** [`0x` => `0x` addressarrow-up-right](https://docs.filecoin.io/basics/assets/transfer-fil/#eth-style-address-to-eth-style-address) [`f` =>`0x` addressarrow-up-right](https://docs.filecoin.io/basics/assets/transfer-fil/#filecoin-to-eth-style-address) **To a** `**f**` **address** [`0x` => `f` addressarrow-up-right](https://docs.filecoin.io/basics/assets/transfer-fil/#eth-style-address-to-filecoin) [`f` => `f` addressarrow-up-right](https://docs.filecoin.io/basics/assets/transfer-fil/#filecoin-to-filecoin) circle-exclamation **ASSETS ON THE FILECOIN NETWORK ARE NOT AVAILABLE ON ANY OTHER NETWORK** Remember that Filecoin is fully compatible with Ethereum tools, like wallets. But that doesn’t mean you’re using the Ethereum network. These instructions transfer assets only within the Filecoin network. [Learn how to configure your Ethereum wallet on the Filecoin networkarrow-up-right](https://docs.filecoin.io/basics/assets/metamask-setup/) . [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#id-0x-greater-than-0x-address) 0x => 0x address ------------------------------------------------------------------------------------------------------------------ If you want to transfer FIL tokens from one `f4` address to another `f4` address using their corresponding `0x` addresses, you need to understand how to convert between `f4` and `0x` addresses. * If you have `f4` address, you can convert it to `0x` address using [Beryx Address converterarrow-up-right](https://beryx.zondax.ch/address_converter) . * If you have a `0x` address, you can directly search it on [Filfox Explorerarrow-up-right](https://filfox.info/en) , which will show the `0x` address and corresponding `f4` address. Apart from that, you just need to follow the standard process using your preferred Ethereum-compatible wallet, like MetaMask, MethWallet, etc. For instance, [MetaMask has a simple guidearrow-up-right](https://support.metamask.io/manage-crypto/move-crypto/send/how-to-send-tokens-from-your-metamask-wallet/) for how to send Ethereum from one account to another. [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#id-0x-greater-than-f-address) 0x => f address ---------------------------------------------------------------------------------------------------------------- If you want to transfer FIL tokens from an Ethereum style `0x` address to another Filecoin address type, like an `f1` or `f3` address, follow the steps in [FilForwarder](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder) tutorial. [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#f-greater-than-0x-address) f => 0x address ------------------------------------------------------------------------------------------------------------- Most wallets and exchanges currently support Filecoin `f1` or `f3` addresses, and many of them already fully support `f4` and `0x` addresses, including [OKXarrow-up-right](https://www.okx.com/price/filecoin-fil) , [Krakenarrow-up-right](https://www.kraken.com/) , [Btcturkarrow-up-right](https://www.btcturk.com/) , etc. But there are some exchanges that are still implementing the support for `f4` addresses. If your preferred wallets and exchanges don’t let you directly transfer FIL to an `f4` or Ethereum-style `0x` address, We recommend filing a support issue with the exchange to help accelerate the support of `f4` addresses. The process for sending FIL from a Filecoin `f` address to an Ethereum-style `0x` address depends on the wallet or exchange you use. ### [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#ledger-device) Ledger device Ledger Live supports sending to a Filecoin `f4` address, which has an automatic `0x` equivalent that you can look up on any [block explorer](https://docs.filecoin.io/networks/mainnet/explorers) . This allows you to directly transfer your FIL to an Ethereum-style `0x` address using its `f4` equivalent. circle-exclamation Sending directly to a `0x` address does not work in Ledger Live. You must use the `f4` equivalent. ### [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#hot-wallet) Hot wallet A hot wallet is a cryptocurrency wallet that is always connected to the internet. They allow you to store, send, and receive tokens. Because hot wallets are always connected to the internet, they tend to be somewhat more vulnerable to hacks and theft than cold storage methods. However, they are generally easier to use than cold wallets and do not require any specific hardware like a Ledger device. If you want to transfer your FIL tokens from the `f1\f3` to the `0x` address, but the wallet or exchange you are using does not support the `f4` and `0x` style addresses. Then, you can create a _burner wallet_ using Glif, transfer FIL to the burner wallet, and then transfer FIL from the burner wallet to the `0x` address on MetaMask. 1. Navigate to [glif.io/arrow-up-right](https://www.glif.io/en?txtype=send) . Create a **Burner wallet**. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-8dbf76486771b81863af5231629c49dbfce953fc%252Fbasics-assets-transfer-fil-burner-wallet.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1b2870b2&sv=2) Create burner wallet 1. Click **Create Seed Phase**. Write down your seed phrase somewhere safe. You can also copy or download the seed phrase. You will need it later. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-98c893fe009cc632093453cbb7481c2529b1f56d%252Fbasics-assets-transfer-fil-seed-phrase.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=fff2aa57&sv=2) Seed phase 1. Click **I’ve recorded my seed phrase**. Using your seed phrase, enter the missing words in the blank text fields. 2. Click **Next**, and then **Connect**. The burner wallet is created 3. In the upper left corner of your wallet dashboard, click on the double squares icon next to your address to copy it. Record this address. You will need it later. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-3c8d682ed8a27abd24ad78f3a3e6328940e30246%252Fbasics-assets-transfer-fil-wallet-address.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=44049c75&sv=2) Copy the wallet address 1. From your main wallet account or exchange, transfer your FIL token to this address. 2. Connect to MetaMask and copy your `0x` address. 3. Once the funds appear in the burner wallet, click on **Send FIL**. 4. Enter the necessary information into the text fields: * In the **Recipient** field, enter your `0x` style address. GLIF automatically converts it to an `f4` address. * In the **Amount** field, enter the amount of FIL to send. Make sure you have enough FIL to cover the GAS cost. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-76fb2fe6e1eea6914bb44ac48bd22b5f810fd1d9%252Fbasics-assets-transfer-fil-send-detail-burner-wallet%2520%281%29.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=d4071162&sv=2) Fill out send detail 1. Click **Send**. The FIL will arrive in your MetaMask wallet shortly. ### [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#exchange) Exchange If you are transferring FIL from any exchange to your `0x` address on MetaMask, make sure the exchange supports withdrawing FIL to the `0x` or `f410` address. If not, you will need extra steps to withdraw FIL to your `0x` address. Let’s take Coinbase as an example; you can follow this [Guide: How to transfer FIL from Coinbase to a Metamask Wallet (0x)arrow-up-right](https://filecointldr.io/article/guide-how-to-transfer-fil-from-coinbase-to-a-metamask-wallet-0x) . [hashtag](https://docs.filecoin.io/basics/assets/transfer-fil#f-to-f-address) f to f address ------------------------------------------------------------------------------------------------- There are no special steps or requirements for sending Filecoin from one Filecoin-style address to another on the Filecoin network. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/assets/transfer-fil) [PreviousGet FILchevron-left](https://docs.filecoin.io/basics/assets/get-fil) [NextInterplanetary consensuschevron-right](https://docs.filecoin.io/basics/interplanetary-consensus) Last updated 3 months ago * [0x => 0x address](https://docs.filecoin.io/basics/assets/transfer-fil#id-0x-greater-than-0x-address) * [0x => f address](https://docs.filecoin.io/basics/assets/transfer-fil#id-0x-greater-than-f-address) * [f => 0x address](https://docs.filecoin.io/basics/assets/transfer-fil#f-greater-than-0x-address) * [Ledger device](https://docs.filecoin.io/basics/assets/transfer-fil#ledger-device) * [Hot wallet](https://docs.filecoin.io/basics/assets/transfer-fil#hot-wallet) * [Exchange](https://docs.filecoin.io/basics/assets/transfer-fil#exchange) * [f to f address](https://docs.filecoin.io/basics/assets/transfer-fil#f-to-f-address) sun-brightdesktopmoon sun-brightdesktopmoon --- # Metamask setup | Filecoin Docs [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#using-chainid) Using ChainID ------------------------------------------------------------------------------------------------- ChainID.network is a website that lets users easily connect their wallets to EVM-compatible blockchains. ChainID is the simplest way to add the Filecoin network to your MetaMask wallet. Mainnet Calibration Local testnet 1. Navigate to [chainid.networkarrow-up-right](https://chainid.network/) . 2. Search for `Filecoin Mainnet`. 3. Click **Connect Wallet**. 4. Click **Approve** when prompted to _Allow this site to add a network_. 5. Click **Switch network** when prompted by MetaMask. 6. Open MetaMask from the browser extensions tab. 7. You should see _Filecoin_ listed at the top. You can now use MetaMask to interact with the Filecoin network. 1. Navigate to [chainid.networkarrow-up-right](https://chainid.network/) . 2. Search for `Filecoin Calibration`. 3. Click **Connect Wallet**. 4. Click **Approve** when prompted to _Allow this site to add a network_. 5. You may be shown a warning that you are connecting to a test network. If prompted, click **Accept**. 6. Click **Switch network** when prompted by MetaMask. 7. Open MetaMask from the browser extensions tab. You should see _Filecoin Calibration_ listed at the top. You can now use MetaMask to interact with the Filecoin network. 1. Navigate to [chainid.networkarrow-up-right](https://chainid.network/) . 2. Search for `Filecoin Local testnet`. 3. Click **Connect Wallet**. 4. Click **Approve** when prompted to _Allow this site to add a network_. 5. You may be shown a warning that you are connecting to a test network. If prompted, click **Accept**. 6. Click **Switch network** when prompted by MetaMask. 7. Open MetaMask from the browser extensions tab. You should see _Filecoin Local testnet_ listed at the top. You can now use MetaMask to interact with the Filecoin network. [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#manual-process) Manual process --------------------------------------------------------------------------------------------------- If you can't or don't want to use ChainID, you can add the Filecoin network to your MetaMask manually. ### [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#prerequisites) Prerequisites Before we get started, you’ll need the following: * A [Chromium-based browserarrow-up-right](https://en.wikipedia.org/wiki/Chromium_web_browser#Browsers_based_on_Chromium) , or [Firefoxarrow-up-right](https://www.mozilla.org/en-CA/firefox/products/) . * A browser with [MetaMaskarrow-up-right](https://metamask.io/) installed. ### [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#steps) Steps The process for configuring MetaMask to use Filecoin is fairly simple but has some very specific variables that you must copy exactly. 1. Open your browser and open the MetaMask plugin. If you haven’t opened the MetaMask plugin before, you’ll be prompted to create a new wallet. Follow the prompts to create a wallet. 2. Click the user circle and select **Settings.** 3. Select **Networks**. 4. Click **Add a network**. 5. Scroll down and click **Add a network manually**. 6. Enter the following information into the fields: Mainnet Calibration Local testnet Field Value Network name `Filecoin` New RPC URL Either: - `https://api.node.glif.io/rpc/v1` - `https://filecoin.chainup.net/rpc/v1` - `https://rpc.ankr.com/filecoin` Chain ID `314` Currency symbol `FIL` Field Value Network name `Filecoin Calibration testnet` New RPC URL Either: - `https://api.calibration.node.glif.io/rpc/v1` - `https://filecoin-calibration.chainup.net/rpc/v1` Chain ID `314159` Currency symbol `tFIL` Field Value Network name `Filecoin Local testnet` New RPC URL `http://localhost:1234/rpc/v1` Chain ID `31415926` Currency symbol `tFIL` 1. Pick one block explorer from the [Networks section](https://docs.filecoin.io/networks/mainnet) , and enter the URL into the **Block explorer (optional)** field. 2. Review the values in the fields and click **Save**. 3. The Filecoin network should now be shown in your MetaMask window. 4. Done! You can now use MetaMask to interact with the Filecoin network. [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#ledger-hardware-wallet) Ledger hardware wallet ------------------------------------------------------------------------------------------------------------------- MetaMask is compatible with the Ledger hardware wallet. There are 2 options for Ledger apps that support Filecoin: * **Filecoin Ledger App** - compatible with MetaMask or the [Glif.ioarrow-up-right](https://glif.io/en/wallet) wallet * **Ethereum Ledger App** - _**currently deprecated**_ for Filecoin as of v1.15.0 (previous versions will work) until Ledger releases their upcoming Dynamic Networks feature #### [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#note-on-filecoin-evm-vs-filecoin-native-addresses) Note on Filecoin EVM vs Filecoin Native addresses Note that MetaMask supports Filecoin EVM addresses that follow the Ethereum `0x` format (see [this sectionarrow-up-right](https://docs.filecoin.io/basics/assets/transfer-fil) for more info on address types). To use native Filecoin address types that begin with `f`, you can use: * [Glif.ioarrow-up-right](https://glif.io/en/wallet) wallet (also compatible with the Filecoin Ledger App), * Ledger Live and the Filecoin Ledger App or * [Filecoin MetaMask Walletarrow-up-right](https://snaps.metamask.io/snap/npm/filsnap/) installable from the right menu in Metamask under _Snaps_ Some exchanges only support specific address types (see [this table on FilecoinTl;drarrow-up-right](https://filecointldr.io/how-to-buy-filecoin#buy) for more info). Which address types are best to use may depend on your use case and goals. ### [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#install-the-ledger-app) Install the Ledger app Follow these instructions to connect your Filecoin addresses within MetaMask to your Ledger wallet. This guide assumes you have [Ledger Livearrow-up-right](https://www.ledger.com/ledger-live) and [MetaMaskarrow-up-right](https://metamask.io/) installed on your computer. Before you can connect MetaMask to your Ledger, you must install the Filecoin Ledger App on your Ledger device. 1. Open Ledger Live and navigate to **My Ledger**. 2. Connect your Ledger device and unlock it. 3. Confirm that you allow My Ledger to access your Ledger device. You can do that by clicking both buttons on your Ledger device simultaneously. 4. Go back to Ledger Live on your computer. 5. In **My Ledger**, head over to **App catalog** and search for **Filecoin**. 6. Click **Install**. For more details on the official Filecoin Ledger app, [check out the Ledger documentationarrow-up-right](https://support.ledger.com/article/4402721277329-zd?redirect=false) . ### [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#enable-expert-mode) Enable expert-mode MetaMask requires that the Filecoin app on your Ledger device is set to _Expert mode_. 1. Open the Filecoin app on your Ledger device. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-bcbd86e3eec2e63b0d84f799e81422dc36247a02%252Fbasics-assets-metamask-ledger-1-filecoin-app.jpg%3Falt%3Dmedia%26token%3Dab7b6745-8660-4515-9ffb-19af1e3d8ea4&width=768&dpr=3&quality=100&sign=3c36ff7e&sv=2) A Ledger with the Filecoin app open. 2. Use the buttons on your device to navigate to **Expert mode**. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-c0ffa4b27da478bc2ce4f358ccf6b288d309c717%252Fbasics-assets-metamask-ledger-2-expert-mode.jpg%3Falt%3Dmedia%26token%3D1d7d20ba-05b1-498a-a01f-89d356ef5d86&width=768&dpr=3&quality=100&sign=1c77cff7&sv=2) A Ledger showing the expert mode option. 3. Press both buttons simultaneously to _enable_ **Expert mode**. ### [hashtag](https://docs.filecoin.io/basics/assets/metamask-setup#connect-to-metamask) Connect to MetaMask Once you have installed the Filecoin app on your Ledger device and enabled expert mode, you can connect your device to MetaMask. 1. Open your browser and open the MetaMask extension. 2. In the **Accounts** menu, select **Add hardware wallet**. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a121bd4870a2bf7aa4305d8a9114baf233a9a6c2%252Fbasics-assets-metamask-ledger-3-add-hw-wallet.jpg%3Falt%3Dmedia%26token%3D03e5139d-7a8d-4219-99e9-b6851f44843c&width=768&dpr=3&quality=100&sign=ab5a7576&sv=2) MetaMask with the 'Add hardware wallet' option highlighted. 3. Select **Ledger** ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-6146c0bf6093d7cb34eaaa07f2d6ae70b218235c%252Fbasics-assets-metamask-ledger-4-select-ledger.jpg%3Falt%3Dmedia%26token%3Deed8a189-4ed4-498f-9f44-4a713d8fea3f&width=768&dpr=3&quality=100&sign=799c7d49&sv=2) MetaMask showing the available hardware wallet options. 4. A list of accounts should appear. Select an `0x...` account. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a640f380f25cebf02ede899f0da12f3fe395ca66%252Fbasics-assets-metamask-ledger-5-select-account.jpg%3Falt%3Dmedia%26token%3D34f77d68-1213-486b-b03b-58a8930f80fe&width=768&dpr=3&quality=100&sign=43288b88&sv=2) MetaMask showing multiple accounts from a Ledger device. 5. Done! That's it! You've now successfully connected your Ledger device to MetaMask. When you submit any transactions through MetaMask using this account, the Filecoin Ledger app will prompt you for a confirmation on the Ledger device. You may see a _blind signing_ warning on your MetaMask device. This is expected, and is the reason why **Expert Mode** must be enabled before you can interact with the Filecoin Ledger app. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-4826ed940718c93766d9bc81404f6f0dabc4d1f8%252Fbasics-assets-metamask-ledger-7-blind-signing.jpg%3Falt%3Dmedia%26token%3D14f2b8d5-0f9e-4689-8f2c-704db68f6ffa&width=768&dpr=3&quality=100&sign=8bd38887&sv=2) A Ledger device showing a blind signing warning. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/assets/metamask-setup) [PreviousWalletschevron-left](https://docs.filecoin.io/basics/assets/wallets) [NextGet FILchevron-right](https://docs.filecoin.io/basics/assets/get-fil) Last updated 5 months ago * [Using ChainID](https://docs.filecoin.io/basics/assets/metamask-setup#using-chainid) * [Manual process](https://docs.filecoin.io/basics/assets/metamask-setup#manual-process) * [Prerequisites](https://docs.filecoin.io/basics/assets/metamask-setup#prerequisites) * [Steps](https://docs.filecoin.io/basics/assets/metamask-setup#steps) * [Ledger hardware wallet](https://docs.filecoin.io/basics/assets/metamask-setup#ledger-hardware-wallet) * [Install the Ledger app](https://docs.filecoin.io/basics/assets/metamask-setup#install-the-ledger-app) * [Enable expert-mode](https://docs.filecoin.io/basics/assets/metamask-setup#enable-expert-mode) * [Connect to MetaMask](https://docs.filecoin.io/basics/assets/metamask-setup#connect-to-metamask) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin economics | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-economics) [PreviousQuickstart guidechevron-left](https://docs.filecoin.io/storage-providers/basics/quickstart-guide) [NextStorage provingchevron-right](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin deals | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals) [PreviousCommitted capacitychevron-left](https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity) [NextStorage dealschevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Social media | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/project-and-community/social-media#youtube) YouTube The [Filecoin YouTube channelarrow-up-right](https://www.youtube.com/channel/UCPyYmtJYQwxM-EUyRUTp5DA) is home to a wealth of information about the Filecoin project — everything from developer demos to recordings of mining community calls — so you can explore playlists and subscribe to ones that interest and inform you. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/social-media#blog) Blog Explore the latest news, events and other happenings on the official [Filecoin Blogarrow-up-right](https://filecoin.io/blog/) . ### [hashtag](https://docs.filecoin.io/basics/project-and-community/social-media#newsletter) Newsletter Subscribe to the [Filecoin newsletterarrow-up-right](https://filecoin.io/build/#events) for official project updates sent straight to your inbox. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/social-media#twitter) Twitter Get your Filecoin news in tweet-sized bites. Follow these accounts for the latest: * `@Filecoin` for news and other updates from the Filecoin project * `@ProtoSchool` for updates on ProtoSchool workshops and tutorials ### [hashtag](https://docs.filecoin.io/basics/project-and-community/social-media#wechat) WeChat Follow FilecoinOfficial on [WeChatarrow-up-right](https://www.wechat.com/mobile) for project updates and announcements in Chinese. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d191870c5edc5694e41cea05992ca6048d536f2a%252Fbasics-project-and-community-social-media-wechat.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=1fd7f9d9&sv=2) WeChat logo [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/social-media) [PreviousRelated projectschevron-left](https://docs.filecoin.io/basics/project-and-community/related-projects) [NextThe Filecoin projectchevron-right](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project) Last updated 1 year ago * [YouTube](https://docs.filecoin.io/basics/project-and-community/social-media#youtube) * [Blog](https://docs.filecoin.io/basics/project-and-community/social-media#blog) * [Newsletter](https://docs.filecoin.io/basics/project-and-community/social-media#newsletter) * [Twitter](https://docs.filecoin.io/basics/project-and-community/social-media#twitter) * [WeChat](https://docs.filecoin.io/basics/project-and-community/social-media#wechat) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin FAQs | Filecoin Docs #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-are-some-of-the-primary-use-cases-for-filecoin) What are some of the primary use cases for Filecoin? Filecoin is a protocol that provides core primitives, enabling a truly trustless decentralized storage network. These primitives and features include publicly verifiable cryptographic storage proofs, [cryptoeconomic mechanismsarrow-up-right](https://filecoin.io/blog/filecoin-cryptoeconomic-constructions/) , and a public blockchain. Filecoin provides these primitives to solve the really hard problem of creating a trustless decentralized storage network. On top of the core Filecoin protocol, there are a number of layer 2 solutions that enable a broad array of use cases and applications, many of which also use [IPFSarrow-up-right](https://ipfs.tech/) , such as [Lighthousearrow-up-right](https://www.lighthouse.storage/) or [Tablelandarrow-up-right](https://tableland.xyz/) . Using these solutions, any use case that can be built on top of IPFS can also be built on Filecoin! Some of the primary areas for development on Filecoin are: * Additional developer tools and layer-2 solutions and libraries that strengthen Filecoin as a developer platform and ecosystem. * IPFS apps that rely on decentralized storage solutions and want a decentralized data persistence solution as well. * Financial tools and services on Filecoin, like wallets, signing libraries, and more. * Applications that use Filecoin’s publicly verifiable cryptographic proofs in order to provide trustless and timestamped guarantees of storage to their users. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-can-a-website-or-app-be-free-if-it-costs-to-retrieve-data-from-the-filecoin-network) How can a website or app be free if it costs to retrieve data from the Filecoin network? Most websites and apps make money by displaying ads. This type of income-model could be replaced with a Filecoin incentivized retrieval setup, where users pay small amounts of FIL for whatever files they’re hoping to download. Several large datasets are hosted through Amazon’s _pay per download_ S3 buckets, which Filecoin retrieval could also easily augment or replace. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-will-filecoin-attract-developers-to-use-filecoin-for-storage) How will Filecoin attract developers to use Filecoin for storage? It’s going to require a major shift in how we think about the internet. At the same time, it is a very exciting shift, and things are slowly heading that way. Browser vendors like Brave, Opera, and Firefox are investing into decentralized infrastructure. We think that the internet must return to its _decentralized roots_ to be resilient, robust, and efficient enough for the challenges of the next several decades. Early developers in the Filecoin ecosystem are those who believe in that same vision and potential for the internet, and we’re excited to work with them to build this space. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-are-the-detailed-parameters-of-filecoins-cryptoeconomics) What are the detailed parameters of Filecoin’s cryptoeconomics? We are still finalizing our cryptoeconomic parameters, and they will continue to evolve. Here is a blog about Filecoin economics from December 2020: [Filecoin network economicsarrow-up-right](https://filecoin.io/blog/posts/filecoin-network-economics/) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-expensive-will-filecoin-storage-be-at-launch) How expensive will Filecoin storage be at launch? As Filecoin is a free market, the price will be determined by a number of variables related to the supply and demand for storage. It’s difficult to predict before launch. However, a few design elements of the network help support inexpensive storage. Along with revenue from active storage deals, Storage Miners receive block rewards, where the expected value of winning a given block reward is proportional to the amount of storage they have on the network. These block rewards are weighted heavily towards the early days of the network (with the frequency of block rewards exponentially decaying over time). As a result, Storage Miners are relatively incentivized to charge less for storage to win more deals, which would increase their expected block reward. Further, Filecoin introduces a concept called _Verified Clients_, where clients can be verified to actually be storing useful data. Storage Miners who store data from _Verified Clients_ also increase their expected block reward. Anyone running a Filecoin-backed IPFS Pinning Services should qualify as a _Verified Client_. We do not have the process of verification finalized, but we expect it to be similar to submitting a GitHub profile. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#will-it-be-cheaper-to-store-data-on-filecoin-than-other-centralized-cloud-services) Will it be cheaper to store data on Filecoin than other centralized cloud services? Filecoin creates a hyper-competitive market for data storage. There will be many storage providers offering many prices, rather than one fixed price on the network. We expect Filecoin’s permissionless model and low barriers to entry to result in some very efficient operations and low-priced storage, but it’s impossible to say what exact prices will be until the network is live. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-happens-to-the-existing-content-on-ipfs-once-filecoin-launches-what-if-nodes-continue-to-host-c) What happens to the existing content on IPFS once Filecoin launches? What if nodes continue to host content for free and undermine the Filecoin incentive layer? IPFS will continue to exist as it is, enhanced with Filecoin nodes. There are many use cases that require no financial incentive. Think of it like IPFS is HTTP, and Filecoin is a storage cloud-like S3 – only a fraction of IPFS content will be there. People with unused storage who want to earn monetary rewards should pledge that storage to Filecoin, and clients who want guaranteed storage should store that data with Filecoin storage providers. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#lotus-or-venus-which-is-better-for-storage-providers) Lotus or Venus, which is better for storage providers? Lotus is the primary reference implementation for the Filecoin protocol. At this stage, we would recommend most storage providers use lotus to participate in the Filecoin network. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-is-your-recommendation-on-the-right-hardware-to-use) What is your recommendation on the right hardware to use? While the Filecoin team does not recommend a specific hardware configuration, we document various setups [here](https://docs.filecoin.io/storage-providers/infrastructure) . Additionally, [this guide to storage mining](https://docs.filecoin.io/storage-providers/basics/quickstart-guide) details hardware considerations and setups for storage providers. However, it is likely that there are more efficient setups, and we strongly encourage storage providers to test and experiment to find the best combinations. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#we-are-worried-about-the-ability-of-our-network-to-handle-the-additional-overhead-of-running-a-filec) We are worried about the ability of our network to handle the additional overhead of running a Filecoin node and still provide fast services for our customers. What are the computational demands of a Lotus node? Are there any metrics for node performance given various requirements? For information on Lotus requirements, see [Prerequisites > Minimal requirementsarrow-up-right](https://lotus.filecoin.io/lotus/install/prerequisites/#minimal-requirements) . For information on Lotus full nodes and lite nodes, see [Types of nodesarrow-up-right](https://lotus.filecoin.io/lotus/get-started/use-cases/) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#we-bought-a-lot-of-hard-drives-of-data-through-the-discover-project.-when-will-they-be-shipped-to-ch) We bought a lot of hard drives of data through the Discover project. When will they be shipped to China? There are a number of details that are still being finalized between the verified deals construction and the associated cryptoeconomic parameters. Our aim is to allow these details to finalize before shipping, but given timelines, we’re considering enabling teams to take receipt of these drives before the parameters are set. We will publish updates on the status of the Discover project on the Filecoin blog. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#do-filecoin-storage-providers-need-a-fixed-ip) Do Filecoin storage providers need a fixed IP? For mainnet, you will need a public IP address, but it doesn’t need to be fixed (just accessible). #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-if-we-lost-a-sector-accidentally-is-there-any-way-to-fix-that) What if we lost a sector accidentally, is there any way to fix that? If you lost the data itself, then no, there’s no way to recover that, and you will be slashed for it. If the data itself is recoverable, though (say you just missed a _WindowPoSt_), then the Recovery process will let you regain the sector. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#has-filecoin-confirmed-the-use-of-the-sdr-algorithm-is-there-any-evidence-of-malicious-construction) Has Filecoin confirmed the use of the SDR algorithm? Is there any evidence of malicious construction? SDR ([Stacked DRG PoReparrow-up-right](https://spec.filecoin.io/algorithms/porep-old/stacked_drg/#section-algorithms.porep-old.stacked_drg) ) is confirmed and used, and we have no evidence of malicious construction. The algorithm is also going through both internal and external security audits. If you have any information about any potential security problem or malicious construction, reach out to our team at [\[email protected\]envelope](https://docs.filecoin.io/cdn-cgi/l/email-protection#2a594f495f58435e536a4c43464f494543440445584d) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-likely-is-it-that-the-filecoin-protocol-will-switch-to-the-nse-proof-of-replication-construction) How likely is it that the Filecoin protocol will switch to the NSE Proof-of-Replication construction later? Native storage extension (NSE) is one of the best candidates for a proof upgrade, and teams are working on implementation. But there are other candidates too, which are promising as well. It may be that another algorithm ends up better than NSE – we don’t know yet. Proof upgrades will arrive after the mainnet launch and will coexist. AMD may be optimal hardware for SDR. You can [see this descriptionarrow-up-right](https://github.com/filecoin-project/lotus/blob/master/documentation/en/sealing-procs.md) for more information on why. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-are-you-working-on-bootstrapping-the-demand-side-of-the-marketplace-the-discover-program-is-nice) How are you working on bootstrapping the demand side of the marketplace? The Discover program is nice, but who is the target market for users, and how do you get them? In addition to [Filecoin Discoverarrow-up-right](https://filecoin.io/blog/posts/introducing-filecoin-discover/) , a number of groups are actively building tools and services to support the adoption of the Filecoin network with developers and clients. For example, check out the recordings from our [Virtual Community Meetuparrow-up-right](https://filecoin.io/blog/filecoin-virtual-community-meetup-recap/) to see updates about Textile and Starling Storage. You can also read more about some of the teams building on Filecoin through HackFS in our [HackFS Week 1 Recaparrow-up-right](https://filecoin.io/blog/hackfs-teams-vol-1/) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#does-filecoin-have-an-implementation-of-client-and-storage-provider-order-matching-through-order-boo) Does Filecoin have an implementation of client and storage provider order matching through order books? There will be off-chain [order booksarrow-up-right](https://www.investopedia.com/terms/o/order-book.asp) and storage provider marketplaces – some are in development now from some teams. They will work mostly off-chain because transactions per second on-chain are not enough for the volume of usage we expect on Filecoin. These order books build on the basic deal-flow on-chain. These order books will arrive in their own development trajectory – most likely around or soon after the mainnet launch. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#why-does-filecoin-mining-work-best-on-amd) Why does Filecoin mining work best on AMD? Currently, Filecoin’s Proof of Replication (PoRep) prefers to be run on AMD processors. See this description of Filecoin sealing for more information. More accurately, it runs much slower on Intel CPUs. It runs competitively fast on some ARM processors, like the ones in newer Samsung phones, but they lack the RAM to seal the larger sector sizes. The main reason that we see this benefit on AMD processors is due to their implementation of the SHA hardware instructions. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-do-storage-providers-have-to-do-to-change-a-committed-capacity-cc-sector-into-a-real-data-secto) What do storage providers have to do to change a committed capacity (CC) sector into a “real-data” sector? Storage providers will publish storage deals that they will upgrade the CC sector with, announce to the chain that they are doing an upgrade, and prove to the chain that a new sector has been sealed correctly. We expect to evolve and make this cheaper and more attractive over time after the mainnet launch. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#what-does-terminating-a-sector-mean) What does “terminating a sector” mean? When a committed capacity sector is added to the chain, it can upgrade to a sector with deals, extend its lifetime, or terminate through either faults or voluntary actions. While we don’t expect this to happen very often on mainnet, a storage provider may deem it rational to terminate their promise to the network and their clients, and accept a penalty for doing so. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#does-the-committed-capacity-sector-still-need-to-be-sealed-before-it-upgrades-to-one-with-real-data) Does the committed capacity sector still need to be sealed before it upgrades to one with real data? For the first iteration of the protocol, yes. We have plans to make it cheaper and more economically attractive after mainnet with no resealing required and other perks. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#whats-the-minimum-time-period-for-the-storage-contract-between-the-provider-and-the-buyer) What’s the minimum time period for the storage contract between the provider and the buyer? The minimum duration for a deal is set in the storage provider’s ask. There’s also a practical limitation because sectors have a minimum duration (currently 180 days). #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#after-i-made-a-deal-with-a-storage-provider-and-sent-my-data-to-them-how-exactly-is-the-data-suppose) After I made a deal with a storage provider and sent my data to them, how exactly is the data supposed to be recoverable and healable if that storage provider goes down? Automatic repair of faulted data is a feature we’ve pushed off until after the mainnet launch. For now, the way to ensure resiliency is to store your data with multiple storage providers, to gain some level of redundancy. If you want to learn more about how we are thinking about repair in the future, [here are some notesarrow-up-right](https://github.com/filecoin-project/specs/pull/245/files) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-do-i-know-that-my-storage-provider-will-not-charge-prohibitively-high-costs-for-data-retrieval) How do I know that my storage provider will not charge prohibitively high costs for data retrieval? To avoid extortion, always ensure you store your data with a fairly decentralized set of storage providers (and note: it’s pretty difficult for a storage provider to be sure they are the only person storing a particular piece of data, especially if you encrypt the data). Storage providers currently provide a ‘dumb box’ interface and will serve anyone any data they have. Maybe in the future, storage providers will offer access control lists (ACLs) and logins and such, but that requires that you trust the storage provider. The recommended (and safest) approach here is to encrypt data you don’t want others to see yourself before storing it. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#how-do-you-update-data-stored-on-filecoin) How do you update data stored on Filecoin? We have some really good ideas around ‘warm’ storage (that is mutable and provable) that we will probably implement in the near future. But for now, your app will have to treat Filecoin as an append-only log. If you want to change your data, you just write new data. ‘Warm’ storage can be done with a small amount of trust, where you make a deal with a storage provider with a start date quite far in the future. The storage provider can choose to store your data in a sector now (but they won’t get paid for proving it until the actual start date), or they can hold it for you (and even send you proofs of it on request), and you can then send them new data to overwrite it, along with a new storage deal that overwrites the previous one. There’s a pretty large design space here, and we can do a bunch of different things depending on the levels of trust involved, the price sensitivity, and the frequency of updates clients desire. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#who-will-be-selected-to-be-verifiers-to-verify-clients-on-the-network) Who will be selected to be verifiers to verify clients on the network? Allocators, selected through an application process, serve as fiduciaries for the Filecoin network and are responsible for allocating DataCap to clients with valuable storage use cases. See [Filecoin Plus](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#will-the-existence-of-filecoin-mining-pools-lead-to-centralized-storage-and-away-from-the-vision-of) Will the existence of Filecoin mining pools lead to centralized storage and away from the vision of distributed storage? No – Filecoin creates a decentralized storage network in part by massively decreasing the barrier to entry to becoming a storage provider. Even if there were some large pools, anyone can join the network and provide storage with just a modest hardware purchase, and we expect clients to store their files with many diverse storage providers. Also, note that world location matters for mining: many clients will prefer storage providers in specific regions of the world, so this enables lots of storage providers to succeed across the world, where there is storage demand. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/filecoin-faqs#even-though-filecoin-will-be-backed-up-to-our-normal-ipfs-pinning-layer-we-still-need-to-know-how-qu) Even though Filecoin will be backed up to our normal IPFS pinning layer, we still need to know how quickly we can access data from the Filecoin network. How fast will retrieval be from the Filecoin network? If you are retrieving your data from IPFS or a remote pinning layer, retrieval should take on the order of milliseconds to seconds in the worst case. Our latest tests for retrieval from the Filecoin network directly show that a sealed sector holding data takes ~1 hour to unseal. 1-5 hours is our best real-world estimate to go from sector unsealing to delivery of the data. If you need faster data retrieval for your application, we recommend building on IPFS. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/filecoin-faqs) [PreviousFilecoin compared tochevron-left](https://docs.filecoin.io/basics/project-and-community/filecoin-compared-to) [NextRelated projectschevron-right](https://docs.filecoin.io/basics/project-and-community/related-projects) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # FIL collateral | Filecoin Docs As a storage provider on the network, you will have to create FIL wallets and add FIL to them. This is used to send messages to the blockchain but is also used for collateral. Providing storage capacity to the network requires you to provide FIL as collateral, which goes into a locked wallet on your Lotus instance. The [Lotus documentationarrow-up-right](https://lotus.filecoin.io/storage-providers/operate/addresses/) details the process of setting up your wallets and funding wallets for the initial setup. Filecoin uses upfront token collateral, as in proof-of-stake protocols, proportional to the storage hardware committed. This gets the best of both worlds to protect the network: attacking the network requires both acquiring and running the hardware, but it also requires acquiring large quantities of the token. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#types-of-collateral) Types of collateral ------------------------------------------------------------------------------------------------------------------------------------ To satisfy the varied collateral needs of storage providers in a minimally burdensome way, Filecoin includes three different collateral mechanisms: * _Initial pledge collateral_, an initial commitment of FIL that a miner must provide with each sector. * _Block rewards as collateral_, a mechanism to reduce the initial token commitment by vesting block rewards over time. * _Storage deal provider collateral_, which aligns incentives between storage provider and client and can allow storage providers to differentiate themselves in the market. For more detailed information about how collateral requirements are calculated, see the [miner collateral section in the Filecoin specarrow-up-right](https://spec.filecoin.io/systems/filecoin_mining/miner_collaterals/) . When a storage provider fails to answer to the WindowsPoSt challenges within the 30-minute deadline (see [Storage Proving](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) ), storage is taken offline, or any storage deal rules are broken, the provider is penalized against the provided collateral. This penalty is called [_slashing_](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) and means that a portion of the pledged collateral is forfeited to the `f099` address from your locked or available rewards, and your storage power is reduced. The `f099` address is the address where all burned FIL goes. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#commit-pledge) Commit Pledge ------------------------------------------------------------------------------------------------------------------------ The amount of required collateral depends on the amount of storage pledged to the Filecoin network. The bigger volume you store, the more collateral is required. Additionally, Filecoin Plus uses a [QAP](https://docs.filecoin.io/reference/general/glossary#quality-adjusted-storage-power) multiplier to increase the collateral requirement. See [Verified Deals with Filecoin Plus](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals) for more information. The formula for the required collateral is as follows: _Collateral needed for X TiB = (Current Sector Initial Pledge) x (32) x (X TiB)_ For instance, for 100 TiB at 0.20 FIL / 32 GiB sector, this means: _0.20 FIL x 32 x 100 = 640 FIL_ The “Current Sector Initial Pledge" can be found on blockchain explorers like [Filfoxarrow-up-right](https://filfox.info/en) and on the [Starboard dashboardsarrow-up-right](https://dashboard.starboard.ventures/capacity-services#commit-pledge-per-32gib-qap) . [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#gas-fees) Gas fees -------------------------------------------------------------------------------------------------------------- Another cost factor in the network is gas. Storage providers not only pledge collateral for the capacity they announce on-chain. The network also burns FIL in the form of gas fees. Most activity on-chain has some level of gas involved. For storage providers, this is the case for committing sectors. The gas fees fluctuate over time and can be followed on various websites like [Filfox - Gas Statisticsarrow-up-right](https://filfox.info/en/stats/gas/) and [Beryx - Gas Estimatorarrow-up-right](https://beryx.io/estimate_gas) . [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#fil-lending-programs) FIL lending programs -------------------------------------------------------------------------------------------------------------------------------------- The ecosystem has FIL lenders who can provide you FIL (with interest) to get you started, which you can pay back over time and with the help of earned block rewards. Every lender, though, will still require you to supply up to 20% of the required collateral. The [Filecoin Virtual Machine](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) , introduced in March 2023, enables the creation of new lending mechanisms via smart contracts. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral) [PreviousStorage provingchevron-left](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) [NextBlock rewardschevron-right](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards) Last updated 3 months ago * [Types of collateral](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#types-of-collateral) * [Commit Pledge](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#commit-pledge) * [Gas fees](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#gas-fees) * [FIL lending programs](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral#fil-lending-programs) sun-brightdesktopmoon sun-brightdesktopmoon --- # Block rewards | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards#what-are-block-rewards) What are block rewards? ------------------------------------------------------------------------------------------------------------------------------------------ WinningPoSt (short for [Winning Proof of SpaceTimearrow-up-right](https://spec.filecoin.io/algorithms/pos/post/) ) is the cryptographic challenge through which storage providers are rewarded for their contributions to the network. At the beginning of each epoch (1 epoch = 30 seconds), a small number of storage providers are elected by the network to mine new [blocks](https://docs.filecoin.io/reference/general/glossary#block) . Each elected storage provider who successfully creates a block is granted Filecoin tokens by means of a _block reward_. The amount of FIL per block reward varies over time and is listed on various blockchain explorers like [Filfoxarrow-up-right](https://filfox.info/en) . The election mechanism of the Filecoin network is based on the “storage power” of the storage providers. A minimum of 10 TiB in storage power is required to be eligible for WinningPoSt, and hence to earn block rewards. The more storage power a storage provider has, the more likely they will be elected to mine a block. This concept becomes incredibly advantageous in the context of [Filecoin Plus verified deals](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) . Note that the deadline cron, a built-in actor that processes all miner actors every 60 epochs (every 30 minutes), is responsible for updating the rewards vesting table. A miner operator wishing to process vesting manually, ahead of the per-deadline cron call, could do so by calling WithdrawFunds with an amount of zero. Such a call would require use of the miner's Owner address. More details can be found in [FIP005: Remove ineffective reward vestingarrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0005.md) . [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards#filecoins-storage-capacity) Filecoin’s storage capacity -------------------------------------------------------------------------------------------------------------------------------------------------- The Filecoin network is composed of storage providers who offer storage capacity to the network. This capacity is used to secure the network, as it takes a significant amount of storage to take part in the consensus mechanism. This large capacity makes it impractical for a single party to reach 51% of the network power, since an attacker would need 10 EiB in storage to control the network. Therefore, it is important that the raw capacity also referred to as _raw byte power_, remains high. The Filecoin spec also included a _baseline power_ above which the network yields maximum returns for the storage providers. The graph below shows the evolution of network capacity on the Filecoin network. As can be seen, the baseline power goes up over time (and becomes exponential). This means from May 2021 to February 2023 the network yielded maximum returns for storage providers. However, in recent history, Quality Adjusted Power (QAP) has taken over as a leading indicator of relevance for the Filecoin network. QAP is the result of the multiplier when storing verified deals: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-ea840e9608332d6bd59e0479175ac493600dd07a%252Fstorage-providers-filecoin-economics-block-rewards-capacity.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=dc72e98c&sv=2) Check out the Starboard dashboard for the most up-to-date [Network Storage Capacityarrow-up-right](https://dashboard.starboard.ventures/capacity-services#network-storage-capacity) . [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards#impact-of-storage-capacity-on-block-rewards) Impact of storage capacity on block rewards ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- As mentioned before, when the Raw Byte Power is above the Baseline Power, storage providers yield maximum returns. When building a business plan as a storage provider, it is important not to rely solely on block rewards. Block rewards are an incentive mechanism for storage providers. However, they are volatile and depend on the state of the network, which is largely beyond the control of storage providers. The amount of FIL that is flowing to the storage provider per earned block reward is based on a combination of simple minting and baseline minting. Simple minting is the minimum amount of FIL any block will always have, which is 5.5. Baseline minting is the extra FIL on top of the 5.5 that comes from how close the Raw Byte Power is to the Baseline Power. The below graph shows the evolution of FIL per block reward over time: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-0f2b3d6fe8e568635b99cd4711bcaeb8dabab51a%252Fstorage-providers-filecoin-economics-block-rewards-block-rewards.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=83a801fa&sv=2) There is a positive side to releasing less FIL per block reward too. As Filecoin has a capped maximum token supply of 2 billion FIL, the slower minting rate allows for minting over a longer period. A lower circulating supply also has a positive effect on the price of FIL. See the [Crypto Economics](https://docs.filecoin.io/basics/what-is-filecoin/crypto-economics) page of this documentation and the [Filecoin specarrow-up-right](https://spec.filecoin.io/#section-systems.filecoin_token.minting_model) for more information. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards) [PreviousFIL collateralchevron-left](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral) [NextSlashingchevron-right](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) Last updated 1 year ago * [What are block rewards?](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards#what-are-block-rewards) * [Filecoin’s storage capacity](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards#filecoins-storage-capacity) * [Impact of storage capacity on block rewards](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards#impact-of-storage-capacity-on-block-rewards) sun-brightdesktopmoon sun-brightdesktopmoon --- # The Filecoin project | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project#roadmap) Roadmap The [Filecoin Community Roadmaparrow-up-right](https://github.com/filecoin-project/community/discussions/456) is updated quarterly. It provides insight into the strategic development of the network and offers pathways for community members to learn more about ongoing work and connect directly with project teams. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project#research) Research Learn about the ongoing cryptography research and design efforts that underpin the Filecoin protocol on the [Filecoin Research websitearrow-up-right](https://github.com/filecoin-project/research) . The [CryptoLab at Protocol Labsarrow-up-right](https://research.protocol.ai/groups/cryptolab/) also actively researches improvements. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project#code-of-conduct) Code of conduct The Filecoin community believes that our mission is best served in an environment that is friendly, safe, and accepting, and free from intimidation or harassment. To that end, we ask that everyone involved in Filecoin read and respect our [code of conductarrow-up-right](https://github.com/filecoin-project/community/blob/master/CODE_OF_CONDUCT.md) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/the-filecoin-project) [PreviousSocial mediachevron-left](https://docs.filecoin.io/basics/project-and-community/social-media) [NextWays to contributechevron-right](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute) Last updated 1 year ago * [Roadmap](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project#roadmap) * [Research](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project#research) * [Code of conduct](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project#code-of-conduct) sun-brightdesktopmoon sun-brightdesktopmoon --- # Slashing | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing#storage-fault-slashing) Storage fault slashing ------------------------------------------------------------------------------------------------------------------------------------ This term encompasses a broad set of penalties which are to be paid by storage providers if they fail to provide sector reliability or decide to voluntarily exit the network. These include: * **Fault fees** are incurred for each day a storage provider’s sector is offline (fails to submit Proofs-of-Spacetime to the chain). Fault fees continue until the associated wallet is empty and the storage provider is removed from the network. In the case of a faulted sector, there will be an additional sector penalty added immediately following the fault fee. Sector fault fees are equal to 3.51 days of expected block rewards. * **Sector penalties** are incurred for a faulted sector that was not declared faulted before a _WindowPoSt_ check occurs. The sector will pay a fault fee after a Sector Penalty once the fault is detected. * **Termination fees** are incurred when a sector is voluntarily or involuntarily terminated and is removed from the network. * **Consensus fault slashing** is a penalty incurred when committing consensus faults. This penalty is applied to storage providers that have acted maliciously against the network’s consensus functionality. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing#honest-storage-providers) Honest Storage Providers ---------------------------------------------------------------------------------------------------------------------------------------- Note that occasionally, storage providers may experience operational issues, such as downtime or bugs, that cause them to miss their delivery of a WindowPoSt. To ensure reliability and to encourage smaller miners to join the network, there are built-in exceptions to the fault fees: * If the Storage Provider has a history of acting honestly, there is no penalty in the current proving period for a faulted sector in the case of a missed WindowPoSt. * There are no fees if the sector is successfully recovered in a later proving period. * The fault fee applies only to the sectors already faulty, meaning, they are from a previous proving period, or marked for recovery. Penalties are only applied to faulty sectors from previous proving periods, never the current proving period. To learn more about fault fee exceptions, review [FIP002: Free Faults on Newly Faulted Sectors of a Missed WindowPoStarrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0002.md) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) [PreviousBlock rewardschevron-left](https://docs.filecoin.io/storage-providers/filecoin-economics/block-rewards) [NextCommitted capacitychevron-right](https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity) Last updated 1 year ago * [Storage fault slashing](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing#storage-fault-slashing) * [Honest Storage Providers](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing#honest-storage-providers) sun-brightdesktopmoon sun-brightdesktopmoon --- # Committed capacity | Filecoin Docs One way of participating in the Filecoin network is by providing [_Committed Capacity_ (CC) sectors](https://docs.filecoin.io/reference/general/glossary#capacity-commitment) to the network. CC sectors do not contain customer data but are filled with random data when they are created. The goal for the Filecoin network is to have a distributed network of verifiers and collaborators to the network in order to run and maintain a healthy blockchain. Any public blockchain network requires enough participants in the consensus mechanism of the blockchain, in order to guarantee that transactions being logged onto the blockchain are legitimate. Because Filecoin’s consensus mechanism is based on Proof-of-Storage, we need sufficient storage providers that pledge capacity to the network, and thus take part in the consensus process. This is done via Committed Capacity sectors. This can be done in sectors of 32 GiB or 64 GiB. For more detail, see the [architectural overview](https://docs.filecoin.io/storage-providers/architecture/lotus-components) . [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity#availability-requirements) Availability requirements ---------------------------------------------------------------------------------------------------------------------------------------------------- Because the Filecoin network needs consistency, meaning all data stored is still available and unaltered, a storage provider is required to keep their capacity online, and be able to demonstrate to the network that the capacity is online. WindowPoSt verification is the process that checks that the provided capacity remains online. If not, a storage provider is penalized (or _slashed_) over the collateral FIL they provided for that capacity and their storage power gets reduced. This means an immediate reduction in capital (lost FIL), but also a reduction in future earnings because block rewards are correlated to storage power, as explained above. See [Slashing](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) , [Storage Proving](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) and [FIL Collateral](https://docs.filecoin.io/storage-providers/filecoin-economics/fil-collateral) for more information. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity#whats-next) What’s next? ------------------------------------------------------------------------------------------------------------------------ Providing committed capacity is the easiest way to get started as a storage provider, but the economics are very dependent on the price of FIL. If the price of FIL is low, it can be unprofitable to provide only committed capacity. The optimal FIL-price your business needs to be profitable will depend on your setup. Profitability can be increased by utilizing [Filecoin Plus](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) , along with [extra services you can charge for](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services) . Note that as of [FIP008: Add miner batched sector pre-commit methodarrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.md) , storage providers can now batch pre-commit up to 256 sectors at once. This change reduces gas costs, requires fewer reads/writes to the blockchain, and lowers transaction congestion. Note that if anything in the batch is invalid, nothing in the batch is pre-committed. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity) [PreviousSlashingchevron-left](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) [NextFilecoin dealschevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals) Last updated 1 year ago * [Availability requirements](https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity#availability-requirements) * [What’s next?](https://docs.filecoin.io/storage-providers/filecoin-economics/committed-capacity#whats-next) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage deals | Filecoin Docs The real purpose of Filecoin is to store humanity’s most important information. As a storage provider, that means accepting storage deals and storing deal sectors with real data in it. As before, those sectors are either 32 GiB or 64 GiB in size and require that the data be prepared as a content archive; that is, as a CAR file.. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals#data-preparation) Data preparation ------------------------------------------------------------------------------------------------------------------------- Data preparation, which includes packaging files into size appropriate CAR files, is either done by a separate Data Preparer actor, or by storage providers acting as Data Preparers. The latter option is common for new storage providers, as they normally only have a few files that need preparation. Data preparation can be done in various ways, depending on your use-case. Here are some valuable sources of information: * The [data-prep-tools repoarrow-up-right](https://github.com/filecoin-project/data-prep-tools) has a set of CLI tools for more specific use-cases. * [Singularityarrow-up-right](https://github.com/tech-greedy/singularity) is a command-line tool to put data into CAR files, create [CIDs](https://docs.filecoin.io/reference/general/glossary) , and even initiate deals with storage providers. See the following video for a demonstration on Singularity: Xinan Xu's presentation on Singularity [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals#deal-market) Deal Market --------------------------------------------------------------------------------------------------------------- In order for storage providers to accept deals and set their deal terms, they need to install some market software, such as [Boostarrow-up-right](https://boost.filecoin.io/) . This component interacts with data owners, accepts deals if they meet the configured requirements, gets a copy of the prepared data (CAR files), and puts it through the [sealing pipeline](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) , after which it is in the state required to be proven to the network. The storage provider can (and should) keep unsealed data copies available for retrieval requests from the client. It is the same software component, Boost, that is responsible for HTTP retrievals from the client and for setting the price for retrievals. Many tools and platforms act as a deal making engine in front of Boost. This is the case for [Spadearrow-up-right](https://github.com/ribasushi/spade) for instance. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals) [PreviousFilecoin dealschevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals) [NextVerified dealschevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals) Last updated 1 year ago * [Data preparation](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals#data-preparation) * [Deal Market](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals#deal-market) sun-brightdesktopmoon sun-brightdesktopmoon --- # Basics | Filecoin Docs The Filecoin network provides decentralized data storage and makes sure data is verified, always available, and immutable. Storage providers in the Filecoin network are in charge of storing, providing content and issuing new blocks. To become a storage provider in the Filecoin network you need a range of technical, financial and business skills. We will explain all the key concepts you need to understand in order to design a suitable architecture, make the right hardware investments, and run a profitable storage provider business. Follow these steps to begin your storage provider journey: 1. Understand Filecoin economics 2. Plan your business 3. Make sure you have the right skills 4. Build the right infrastructure [hashtag](https://docs.filecoin.io/storage-providers/basics#understand-filecoin-economics) Understand Filecoin economics ----------------------------------------------------------------------------------------------------------------------------- To understand how you can run a profitable business as a Filecoin storage provider, it is important to make sure you understand the economics of Filecoin. Once you understand all core concepts, you can build out a strategy for your desired ROI. Storage providers can also add additional value to clients when they offer certain certifications. These can enable a storage provider to charge customers additional fees for storing data in compliance with those standards, for example, HIPAA, SOC2, PCI, GDPR and others. [Filecoin economics ->](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) [hashtag](https://docs.filecoin.io/storage-providers/basics#plan-your-business) Plan your business ------------------------------------------------------------------------------------------------------- The hardware and other requirements for running a Filecoin storage provider business are significantly higher than regular blockchain mining operations. The mechanisms are designed this way because, in contrast to some other blockchain solutions, where you can simply configure one or more nodes to “mine” tokens, the Filecoin network’s primary goal is to provide decentralized storage for humanity’s most valuable data. You need to understand the various earning mechanisms in the Filecoin network. [Filecoin deals ->](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals) ### [hashtag](https://docs.filecoin.io/storage-providers/basics#daily-fees-and-startup-readiness-fip-0100) Daily fees and startup readiness (FIP-0100) With the activation of [FIP-0100arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0100.md) in network version 25, all new sectors — and any sectors that are extended or updated — incur a daily fee. This fee replaces the previous batch fee model and introduces a predictable cost structure tied to each sector’s quality-adjusted power and the network’s circulating supply. The fee begins accruing the day after a sector is committed or extended. It is deducted automatically at the end of each proving deadline. The network first draws from vesting block rewards. If those are insufficient, it draws from the miner’s available balance. If both are empty, the unpaid amount becomes **fee debt**. Fee debt does not directly cause faults. However, it can impact operations: * A miner with fee debt may be blocked from submitting certain messages (e.g., pre-commits or recoveries). * If the balance is too low to pay for WindowPoSt messages, sectors may fault. * Critically, a miner with outstanding fee debt cannot win block rewards until the debt is repaid. To avoid this, storage providers should: * Keep a FIL buffer in the miner actor’s balance. * Avoid fully withdrawing unlocked funds unless upcoming rewards will cover future fees. ### [hashtag](https://docs.filecoin.io/storage-providers/basics#startup-considerations) Startup considerations Miners become eligible to win block rewards once they reach **10 TiB of raw byte power (RBP)**. However, rewards are not guaranteed as soon as that threshold is met. Block production is probabilistic, and smaller miners may wait longer to win a block — especially when competing against larger ones. This creates a funding gap during the startup phase. New storage providers must plan for this by funding their miner actor with enough FIL to: * Cover daily fees during onboarding, * Support message submission (like WindowPoSt), * And continue sealing until rewards start arriving. While the amount of FIL required is relatively small compared to overall infrastructure costs, it is operationally critical. Without it, the miner may become stuck — unable to seal new sectors, submit required messages, or produce blocks and win block rewards due to fee debt or insufficient balance. To estimate how much FIL may be needed, review the [FIP-0100 discussion threadarrow-up-right](https://github.com/filecoin-project/FIPs/discussions/1105) or use the [real-time fee calculatorarrow-up-right](https://penalty.660688.xyz/dailyfee) to model your expected onboarding rate. [hashtag](https://docs.filecoin.io/storage-providers/basics#make-sure-you-have-the-right-skills) Make sure you have the right skills ----------------------------------------------------------------------------------------------------------------------------------------- As will become clear, running a storage operation is a serious business, with client data and pledged funds at stake. You will be required to run a highly-available service, and there are automatic financial penalties if you cannot demonstrate data availability to the network. There are many things that can go wrong in a data center, on your network, on your OS, or at an application level. You will need skilled people to operate your storage provider business. Depending on the size and complexity of your setup this can be 1 person with skills across many different domains, or multiple dedicated people or teams. [People and skills ->](https://docs.filecoin.io/storage-providers/skills/linux) [hashtag](https://docs.filecoin.io/storage-providers/basics#build-the-right-infrastructure) Build the right infrastructure ------------------------------------------------------------------------------------------------------------------------------- At the lowest level, you will need datacenter infrastructure. You need people capable of architecting, racking, wiring and operating infrastructure components. Alternatively, you can get it collocated, or even entirely as a service from a datacenter provider. Take availability and suitable redundancy into consideration when choosing your datacenter or collocation provider. Any unavailability of your servers, network or storage can result in automatic financial penalties on the Filecoin network. [Software architecture ->](https://docs.filecoin.io/storage-providers/architecture/lotus-components) [Infrastructure ->](https://docs.filecoin.io/storage-providers/skills/storage) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/basics) [PreviousWays to contributechevron-left](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute) [NextQuickstart guidechevron-right](https://docs.filecoin.io/storage-providers/basics/quickstart-guide) Last updated 10 months ago * [Understand Filecoin economics](https://docs.filecoin.io/storage-providers/basics#understand-filecoin-economics) * [Plan your business](https://docs.filecoin.io/storage-providers/basics#plan-your-business) * [Daily fees and startup readiness (FIP-0100)](https://docs.filecoin.io/storage-providers/basics#daily-fees-and-startup-readiness-fip-0100) * [Startup considerations](https://docs.filecoin.io/storage-providers/basics#startup-considerations) * [Make sure you have the right skills](https://docs.filecoin.io/storage-providers/basics#make-sure-you-have-the-right-skills) * [Build the right infrastructure](https://docs.filecoin.io/storage-providers/basics#build-the-right-infrastructure) sun-brightdesktopmoon sun-brightdesktopmoon --- # Network | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/network#internet-bandwidth) Internet bandwidth ----------------------------------------------------------------------------------------------------------------------- The amount of internet bandwidth required for a network largely depends on the size of the organization and customer expectations. A bandwidth between 1 Gbps and 10 Gbps is generally sufficient for most organizations, but the specific requirements should be determined based on the expected traffic. A minimum bandwidth of 10 Gbps is recommended for setups that include a [Saturnarrow-up-right](https://saturn.tech/) node. Saturn requires a high-speed connection to handle large amounts of data. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/network#lan-bandwidth) LAN bandwidth ------------------------------------------------------------------------------------------------------------- The bandwidth between different components of a network is also important, especially when transferring data between servers. The internal connectivity between servers should be at least 10 Gbps to ensure that planned sealing capacity is not limited by network performance. It is important to ensure that the servers and switches are capable of delivering the required throughput, and that firewalls are not the bottleneck for this throughput. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/network#vlans) VLANs --------------------------------------------------------------------------------------------- Virtual Local Area Networks (VLANs) are commonly used to separate network traffic and enhance security. However, if firewall rules are implemented between VLANs, the firewall can become the bottleneck. To prevent this, it is recommended to keep all sealing workers, Lotus miners, and storage systems in the same VLAN. This allows for data access and transfer without involving routing and firewalls, thus improving network performance. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/network#redundancy) Redundancy ------------------------------------------------------------------------------------------------------- Network redundancy is crucial to prevent downtime and ensure uninterrupted operations. By implementing redundancy, individual networking components can fail without disrupting the entire network. Common industry standards for network redundancy include NIC (network interface card) bonding, LACP (Link Aggregation Control Protocol), or MCLAG (Multi-Chassis Link Aggregation Group). [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/network#common-topologies) Common topologies --------------------------------------------------------------------------------------------------------------------- Depending on the size of the network, different network topologies may be used to optimize performance and scalability. For larger networks, a spine-leaf architecture may be used, while smaller networks may use a simple two-tier architecture. Spine-leaf architectures provide predictable latency and linear scalability by having multiple L2 leaf switches that connect to the spine switches. On the other hand, smaller networks can be set up with redundant L3 switches or a collapsed spine/leaf design that connect to redundant routers/firewalls. It is important to determine the appropriate topology based on the specific needs of the organization. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/infrastructure/network) [PreviousStoragechevron-left](https://docs.filecoin.io/storage-providers/infrastructure/storage) [NextBackup and disaster recoverychevron-right](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery) Last updated 1 year ago * [Internet bandwidth](https://docs.filecoin.io/storage-providers/infrastructure/network#internet-bandwidth) * [LAN bandwidth](https://docs.filecoin.io/storage-providers/infrastructure/network#lan-bandwidth) * [VLANs](https://docs.filecoin.io/storage-providers/infrastructure/network#vlans) * [Redundancy](https://docs.filecoin.io/storage-providers/infrastructure/network#redundancy) * [Common topologies](https://docs.filecoin.io/storage-providers/infrastructure/network#common-topologies) sun-brightdesktopmoon sun-brightdesktopmoon --- # Sealing-as-a-service | Filecoin Docs Storage providers with hardware cost or availability constraints can use _Sealing-as-a-service_, in which another provider performs sector sealing on the storage providers behalf. This page describes how sealing-as-a-service works, and the benefits to storage providers. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service#overview) Overview In a traditional setup, a storage provider needs high-end hardware to build out a [sealing pipeline](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) . Storage providers with hardware cost or availability constraints can use _Sealing-as-a-Service_ providers, where another provider performs sector sealing on the storage provider’s behalf. In this model, the following occurs: 1. The storage provider provides the data to the sealer 2. The sealer seals the data into sectors. 3. The sealer returns the sealed sectors in exchange for a service cost. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service#benefits) Benefits Sealing-as-a-service provides multiple benefits for storage providers: * Available storage can be filled faster, thereby maximizing block rewards, without investing in a complex, expensive sealing pipeline. * Bigger deals can be onboarded, as Sealing-as-a-Service essentially offers a burst capability in your sealing capacity. Thus, storage providers can take on larger deals without worrying about sealing time and not meeting client expectations. * Storage capacity on the Filecoin network can be expanded without investing in a larger sealing pipeline. Other solutions are possible where the sealing partner seals committed capacity (CC) sectors for you, which you in turn [snap up](https://docs.filecoin.io/storage-providers/filecoin-deals/snap-deals) to data sectors. See the following video from [Alignedarrow-up-right](https://aligned.co/sealing-as-a-service) about their offering of Sealing-as-a-Service: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) [PreviousSealing ratechevron-left](https://docs.filecoin.io/storage-providers/architecture/sealing-rate) [NextNetwork indexerchevron-right](https://docs.filecoin.io/storage-providers/architecture/network-indexer) Last updated 1 year ago * [Overview](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service#overview) * [Benefits](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service#benefits) sun-brightdesktopmoon sun-brightdesktopmoon --- # Charging for data | Filecoin Docs Charging for data stored on your storage provider network is an essential aspect of running a sustainable business. While block rewards from the network can provide a source of income, they are highly dependent on the volatility of the price of FIL, and cannot be relied on as the sole revenue stream. To build a successful business, it is crucial to develop a pricing strategy that is competitive, yet profitable. This will help you attract and retain customers, as well as ensure that your business succeeds in the long term. While some programs may require storage providers to accept deals for free, or bid in auctions to get a deal, it is generally advisable to charge customers for most client deals. When developing your pricing strategy, it is important to consider the cost of sales associated with acquiring new customers. This cost consideration should include expenses related to business development, marketing, and sales, which you should incorporate into your business’ return-on-investment (ROI) calculation. In addition to sales costs, other factors contribute to your business’ total cost of ownership. These include expenses related to backups of your setup and data, providing an access layer to ingest data and for retrievals, preparing the data when necessary, and more. Investigating these costs is essential to ensure your pricing is competitive, yet profitable. By charging for data stored on your network, you can create a sustainable business model that allows you to invest in hardware and FIL as collateral, as well as grow your business over time. This requires skilled people capable of running a business at scale and interacting with investors, venture capitalists, and banks to secure the necessary funding for growth. Next to the sales cost, there are other things that contribute to the total cost of ownership of your storage provider business. Think of backups of your setup and the data, providing an access layer to ingest data and for retrievals, preparing the data (if not done already), and more. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/charging-for-data) [PreviousSnap dealschevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/snap-deals) [NextAuxiliary serviceschevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Infrastructure | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/infrastructure) [PreviousNetwork indexerchevron-left](https://docs.filecoin.io/storage-providers/architecture/network-indexer) [NextStoragechevron-right](https://docs.filecoin.io/storage-providers/infrastructure/storage) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Verified deals | Filecoin Docs Filecoin aims to be a decentralized storage network for humanity’s essential information. To achieve this, it’s crucial to add valuable data to the network. Filecoin Plus is a social trust program encouraging storage providers to store data in _verified deals_. A deal becomes _verified_ after the data owner (client) completes a verification process, where community _allocators_ assess the client’s use of Filecoin to determine its relevance and value to the Filecoin mission: storing and preserving humanity’s vital data. Allocators conduct due diligence by questioning clients and building reasonable confidence in their trustworthiness and use case. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#datacap) DataCap -------------------------------------------------------------------------------------------------------- Notaries are responsible for allocating a resource called _DataCap_ to clients with valuable storage use cases. DataCap is a non-exchangeable asset that is allocated by notaries to data clients. DataCap gets assigned to a wallet but cannot be sold or exchanged. The client can only spend the DataCap as part of making a verified deal with a storage provider. DataCap is a single use credit, and a client’s DataCap balance is deducted based on the size of the data stored in verified deals. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#quality-adjusted-power-qap) Quality Adjusted Power (QAP) ------------------------------------------------------------------------------------------------------------------------------------------------ Storage providers are incentivized by the Filecoin network to store verified deals. A 10x quality adjustment multiplier is set at the protocol level for storage offered for verified deals. A 100 TiB dataset will account for 1 PiB of _Quality-Adjusted-Power_ (QAP). This means the storage provider has a larger share of storage power on the Filecoin network and will be more likely to get elected for WinningPoSt (see [Storage proving](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) ). The storage provider will earn 10x more block rewards for the same capacity made available to the network, if that capacity is storing verified deals. When storing real customer data and not simply [CC sectors](https://docs.filecoin.io/reference/general/glossary#capacity-commitment) , a whole new set of responsibilities arises. A storage provider must have the capacity to make deals, to be able to obtain a copy of the data, to prepare the data for the network, prove the data on-chain via sealing, and last but not least, have a means to offer retrieval of the data to the client when requested. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#responsibilities) Responsibilities -------------------------------------------------------------------------------------------------------------------------- As a storage provider, you play a crucial role in the ecosystem. Unlike miners in other blockchains, storage providers must do more than offer disk space to the network. Whether onboarding new customers to the network, or storing copies data from other storage providers for clients seeking redundancy, providing storage can involve: * Business development. * Sales and marketing efforts. * Hiring additional personnel. * Networking. * Relationship building. Acquiring data copies requires systems and infrastructure capable of ingesting large volumes of data, sometimes up to a PiB. This necessitates significant internet bandwidth, with a minimum of 10 GB. For instance, transferring 1 PiB of data takes approximately 240 hours on a 10 GB connection. However, many large storage providers use up to 100 GB internet connections. \`\`\` Data preparation, which involves separating files and folders in CAR files, is time-consuming and requires expertise. You can delegate this task to a Data Preparer for a fee or assume the role yourself. Tools like [Singularityarrow-up-right](https://singularity.storage/) simplify this process. Once the data is sealed and you are proving your copies on-chain (i.e. on the blockchain), you will need to offer retrievals to your customer as well. This obviously requires network bandwidth once more, so you may need to charge for retrievals accordingly. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#tools) Tools ---------------------------------------------------------------------------------------------------- Tools and programs exist to support Filecoin Plus, but storage providers need to know how to operate this entire workflow. See [Filecoin Plus Programs](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs) for more information on available programs. See [Architecture](https://docs.filecoin.io/storage-providers/architecture/lotus-components) for more information on the tooling and software components. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#rewards-and-penalties) Rewards & penalties ---------------------------------------------------------------------------------------------------------------------------------- With great power, comes great responsibility, which also counts for storage power: rewards on Fil+ deals are 10x, but so are the penalties. Because a sector of 32 GiB counts for 320 GiB of storage power (10x), the rewards and the penalties are calculated on the QAP of 320 GiB. Filecoin Plus allows a storage provider to earn more block rewards on a verified deal, compared to a regular data deal. The 10x multiplier on storage power that comes with a verified deal, however, also requires 10x collateral from the storage provider. If the storage provider is then not capable of keeping the data and systems online and fails to submit the daily required proofs (WindowPoSt) for that data, the penalties (_slashing_) are also 10x higher than over regular data deals or CC sectors. Larger storage power means larger block rewards, larger collateral and larger slashing. The stakes are high - after all, we’re storing humanity’s most important information with Filecoin. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals) [PreviousStorage dealschevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals) [NextFilecoin programs and toolschevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs) Last updated 1 year ago * [DataCap](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#datacap) * [Quality Adjusted Power (QAP)](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#quality-adjusted-power-qap) * [Responsibilities](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#responsibilities) * [Tools](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#tools) * [Rewards & penalties](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals#rewards-and-penalties) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage provider automation | Filecoin Docs circle-info [Find the automation code here!arrow-up-right](https://github.com/filecoin-project/sp-automation) [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#why-this-automation) Why this automation? --------------------------------------------------------------------------------------------------------------------------------- It can be rather overwhelming for new storage providers to learn everything about Filecoin and the various software components. In order to help with the learning process, we provide a fully automated installation of the Lotus and Boost stack. This automation should allow anyone to go on mainnet or the Calibration testnet in no time. [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#what-are-we-automating) What are we automating? --------------------------------------------------------------------------------------------------------------------------------------- This automation is still evolving and will receive more features and capabilities over time. In its current state, it lets you: * Install and configure Lotus Daemon to interact with the blockchain. * Initialize and configure Lotus Miner to join the network as a storage provider. * Install and configure Boost to accept storage deals from clients. * Install and configure Booster-HTTP to provide HTTP-based retrievals to clients. [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#sealing-configuration) Sealing configuration ------------------------------------------------------------------------------------------------------------------------------------ The initial use case of this automation is to use sealing-as-a-service instead of doing your own sealing. As such, there is no Lotus Worker configured for the setup. It is possible to extend the setup with a remote worker. However, this Lotus Worker will require dedicated and custom hardware. [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#composable-deployment) Composable deployment ------------------------------------------------------------------------------------------------------------------------------------ One of the next features coming to this automation is a composable deployment method. Today Lotus Daemon, Lotus Miner, and Boost are all installed on a single machine. Many production setups, however, will split out those services into their own dedicated hardware. A composable deployment will allow you to deploy singular components on separate servers. [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#prerequisites) Prerequisites -------------------------------------------------------------------------------------------------------------------- Read the `README` carefully on the [GitHub repoarrow-up-right](https://github.com/filecoin-project/sp-automation) to make sure you have all the required prerequisites in place. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/lotus-automation) [PreviousSoftware componentschevron-left](https://docs.filecoin.io/storage-providers/architecture/lotus-components) [NextSealing pipelinechevron-right](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) Last updated 1 year ago * [Why this automation?](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#why-this-automation) * [What are we automating?](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#what-are-we-automating) * [Sealing configuration](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#sealing-configuration) * [Composable deployment](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#composable-deployment) * [Prerequisites](https://docs.filecoin.io/storage-providers/architecture/lotus-automation#prerequisites) sun-brightdesktopmoon sun-brightdesktopmoon --- # PDP | Filecoin Docs triangle-exclamation **ALPHA FEATURE - UNDER DEVELOPMENT** This documentation covers the PDP (Proof of Data Possession) feature, which is currently in alpha and under active development. This tool is intended for testing and experimental use only. For production use and submitting real deals with live PDP Storage Providers, please use the [Synapse SDKarrow-up-right](https://github.com/FilOzone/synapse-sdk) . [PreviousIndustrychevron-left](https://docs.filecoin.io/storage-providers/skills/industry) [NextInstall & Run PDPchevron-right](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp) Last updated 7 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Return-on-investment | Filecoin Docs Calculating the Return-on-Investment (ROI) of your storage provider business is essential to determine the profitability and sustainability of your operations. The ROI indicates the return or profit on your investment relative to the cost of that investment. There are several factors to consider when calculating the ROI of a storage provider business. **First**, the cost of the initial hardware investment and the collateral in FIL required to participate in the network must be considered. These costs are significant and will likely require financing from investors, venture capitalists, or banks. **Second**, the income generated from the block rewards must be factored into the ROI calculation. However, this income is subject to the volatility of the FIL token price, which can be highly unpredictable. **Third**, it is important to consider the cost of sales when calculating the ROI. Sales costs include the cost of acquiring new customers, marketing, and any fees associated with payment processing. These costs can vary depending on the sales strategy and the size of the business. **Fourth**, the total cost of ownership must be considered. This includes the cost of backups, providing access to ingest and retrieve data, preparing the data, and any other costs associated with operating a storage provider business. **Finally**, the forecasted growth of the network and the demand for storage will also impact the ROI calculation. If the network and demand for storage grow rapidly, the ROI may increase. However, if the growth is slower than anticipated, the ROI may decrease. **Overall**, calculating the ROI of a storage provider business is complex and requires a thorough understanding of the costs and income streams involved. The storage provider Forecast Calculator can assist in determining the ROI by accounting for various factors such as hardware costs, token price, and expected growth of the network. Calculating the ROI of your storage provider business is important. Check out the [Storage Provider Forecast Calculatorarrow-up-right](https://calc.filecoin.eu/) for more details. For more information and context see the following video: It takes more variables than the cost vs. the income. In summary, the factors that influence your ROI are: * **Verified Deals:** How much of your total sealed capacity will be done with Verified Deals (Filecoin Plus)? Those deals give a far higher return because of the 10x multiplier that is added to your storage power and block rewards. * **Committed Capacity:** How much of your total sealed capacity will be just committed capacity (CC) sectors (sometimes also called pledged capacity)? These deals give a lower return compared to verified deals but are an easy way to get started in the network. Relying solely on this to generate income is challenging though, especially when the price of FIL is low. * **Sealing Capacity:** How fast can you seal sectors? Faster sealing means you can start earning block rewards earlier and add more data faster. The downside is that it requires a lot of [hardware](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures) . * **Deal Duration:** How long do you plan to run your storage provider? Are you taking short-term deals only, or are you in it for the long run? Taking long-term deals comes with an associated risk: if you can’t keep your storage provider online for the duration of the deals, you will get penalized. Short-term deals that require extension have the downside of higher operational costs to extend (which requires that the data be re-sealed.). * **FIL Collateral pledged:** A substantial amount of FIL is needed to start accepting deals in the Filecoin network. Verified deals require more pledged collateral than CC-deals. Although the collateral is not lost if you run your storage provider business well, it does mean an upfront investment (or lending). * **Hardware Investment:** Sealing, storing, and proving the data does require a significant hardware investment as a storage provider. Although relying on services like [sealing-as-a-service](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) can lower these requirements for you, it is still an investment in high-end hardware. Take the time to understand your requirements and your future plans so that you can invest in hardware that will support your business. * **Operational Costs:** Last but not least there’s the ongoing monthly cost of operating the storage provider business. Both the costs for technical operations as well as business operations need to be taken into consideration. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/return-on-investment) [PreviousAuxiliary serviceschevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services) [NextArchitecturechevron-right](https://docs.filecoin.io/storage-providers/architecture) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Auxiliary services | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#saturn) Saturn ---------------------------------------------------------------------------------------------------------- One of the additional services is participation in Saturn retrieval markets. [Saturnarrow-up-right](https://saturn.tech/) is a Web3 CDN (“content delivery network”), and will [launch in stages in 2023arrow-up-right](https://saturn.tech/#roadmap) . Saturn aims to be the biggest Web3 CDN, and biggest CDN overall with the introduction of Saturn, data stored on Filecoin is no longer limited to archive or cold storage, but can also be cached into a CDN layer for fast retrieval. Data that needs to be available quickly can then be stored on Filecoin and retrieved through Saturn. Saturn comes with 2 layers of caching, L1 and L2. L1 nodes typically run in data centers, require high availability and 10 GBs minimum connectivity. The L1 Saturn provider earns FIL through caching and serving data to clients. L2 nodes can be run via an app on desktop hardware. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#fvm) FVM ---------------------------------------------------------------------------------------------------- Other new opportunities are emerging since the launch of FVM (Filecoin Virtual Machine) in March 2023. The FVM allows smart contracts to be executed on the Filecoin blockchain. The FVM is Ethereum-compatible (also called the FEVM) and allows for entire new use cases to be developed in the Filecoin ecosystem. Think of on-chain FIL lending as an example, but the opportunities are countless. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#bacalhau) Bacalhau -------------------------------------------------------------------------------------------------------------- A next step after the introduction of FVM is [Bacalhauarrow-up-right](https://docs.bacalhau.org/) ), which will be offering Compute over Data (COD). After the introduction of a compute layer on Filecoin, Bacalhau’s COD promises to run compute jobs over the data where the data resides, at the storage provider. Today, data scientists have to transfer their datasets to compute farms in order for their AI, ML or other data processing activities to run. Bacalhau will allow them to run compute activities on the data where the data is located, thereby removing the expensive requirement to move data around. Storage providers will be able to offer - and get rewarded for - providing compute power to data scientists and other parties who want to execute COD. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#storage-tiering) Storage tiering ---------------------------------------------------------------------------------------------------------------------------- Another potential service to offer is storage tiers with various performance profiles. For example, storage providers can offer hot/online storage by keeping an additional copy of the unsealed data available for immediate retrieval, as well as the sealed that has been stored on the Filecoin Network. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services) [PreviousCharging for datachevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/charging-for-data) [NextReturn-on-investmentchevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/return-on-investment) Last updated 1 year ago * [Saturn](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#saturn) * [FVM](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#fvm) * [Bacalhau](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#bacalhau) * [Storage tiering](https://docs.filecoin.io/storage-providers/filecoin-deals/auxiliary-services#storage-tiering) sun-brightdesktopmoon sun-brightdesktopmoon --- # Sealing rate | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#cost) Cost ---------------------------------------------------------------------------------------------- When setting up their business, storage providers must determine how fast they should seal and, thus, how much sealing hardware they should buy. In other words, the cost is an important factor in determining a storage provider’s sealing rate. For example, suppose you have an initial storage capacity of 100 TiB, which would account for 1 PiB [QAP](https://docs.filecoin.io/reference/general/glossary#quality-adjusted-storage-power) if all the sectors contain Filecoin Plus verified deals. If your sealing capacity is 2.5 TiB per day, you will seal your full 100 TiB in 40 days. Is it worth investing in double the sealing capacity to fill your storage in just 20 days? It might be if you are planning to grow way beyond 100 TiB. This is an example of the sort of cost considerations storage providers must factor in when tuning the sealing rate. [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#customer-expectations) Customer expectations -------------------------------------------------------------------------------------------------------------------------------- A common reason that a storage provider may want or need a faster sealing rate is customer expectations. When you take on a customer deal, there are often requirements to seal a dataset of a certain size within a certain time window. If you are a new storage provider with 2.5 TiB per day in sealing capacity, you cannot take on a deal of 2 PiB that needs to be on-chain in 1 month; at the very least, you could not take the deal using your own sealing infrastructure. Instead, you can use a [Sealing-as-a-service provider](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) , which can help you scale your sealing capabilities. [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#balancing-the-sealing-pipeline) Balancing the sealing pipeline -------------------------------------------------------------------------------------------------------------------------------------------------- When designing their sealing pipeline, storage providers should consider bottlenecks, the grouping of similar tasks, and scaling out. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#bottlenecks) Bottlenecks The art of building a well-balanced sealing pipeline means having the bottlenecks where you expect them to be; any non-trivial piece of infrastructure always contains some kind of bottleneck. Ideally, you should design your systems so that the PC1 process is the bottleneck. By doing this, all other components are matched to the capacity required to perform PC1. With PC1 being the most resource-intensive task in the pipeline, it makes the most sense to architect a solution around this bottleneck. Knowing exactly how much sealing capacity you can get from your PC1 servers is vital so you can match the rest of your infrastructure to this throughput. Assuming you obtain maximum hardware utilization from your PC1 server to seal 15 sectors in parallel, and PC1 takes 3 hours on your infrastructure, that would mean a sealing rate of 3.75 TiB per day. The calculation is described below: Copy 15 sectors x 32 GiB / 3 hours PC1 runtime x 24 hours / 1024 = 3.75 TiB /day ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#grouping-similar-tasks) Grouping similar tasks While a Lotus worker can run all of the various tasks in the sealing pipeline, different storage provider configurations may split tasks between workers. Because some tasks are similar in behavior and others are insignificant in terms of resource consumption, it makes sense to group like-tasks together on the same worker. A common grouping is _AddPiece (AP)_ and PreCommit1 (PC1) because AP essentially prepares the data for the PC1 task. If you have dedicated hardware for PreCommit2 (PC2), your scratch content will move to that other server. If you are grouping PC1 and PC2 on the same server, you won’t have the sealing scratch copied, but you will need a larger NVMe volume. Eventually, you may run out of sealing scratch space and not be able to start sealing additional sectors. Consider a very large bandwidth (40Gb or even 100Gb) between the servers that copy over the sealing space. As PC1 is CPU-bound and PC2 is GPU-bound, this is another good reason to separate those tasks into dedicated hardware, especially if you are planning to scale. Because PC2 is GPU-bound, it makes sense to have PC2, C1, and C2 collocated on the same worker. Another rule of thumb is to have two PC2 workers for every PC1 worker in your setup. The _WaitSeed_ phase occurs after PC2, which locks the scratch space for a sector until C1 and C2. In order to keep sealing sectors in PC1, PC2 must have sufficient capacity. You can easily host multiple PC2 workers on a single server though, ideally with separate GPU's. circle-info You can run multiple lotus-workers on the same GPU by splitting out their`tmp`folders. Give the environment variable `TMPDIR=`to the lotus-worker. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#scaling-out) Scaling out A storage provider’s sealing capacity scales linearly with the hardware you add to it. For example, if your current setup allows for a sealing rate of 3 TiB per day, doubling the number of workers could bring you to 6 TiB per day. This requires that all components of your infrastructure are able to handle this additional throughput. Using [Sealing-as-a-Service providers](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) allows you to scale your sealing capacity without adding more hardware. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/sealing-rate) [PreviousSealing pipelinechevron-left](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) [NextSealing-as-a-servicechevron-right](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) Last updated 1 year ago * [Cost](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#cost) * [Customer expectations](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#customer-expectations) * [Balancing the sealing pipeline](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#balancing-the-sealing-pipeline) * [Bottlenecks](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#bottlenecks) * [Grouping similar tasks](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#grouping-similar-tasks) * [Scaling out](https://docs.filecoin.io/storage-providers/architecture/sealing-rate#scaling-out) sun-brightdesktopmoon sun-brightdesktopmoon --- # Venus | Filecoin Docs Venus is a full-featured implementation of the Filecoin protocol, providing storage, retrieval, and mining functionalities. It is compatible with the Lotus implementation and can interoperate with other Filecoin nodes on the network. One of the key features of Venus is its support for the Chinese language and market. Venus provides a Chinese language user interface and documentation, making it easier for Chinese users to participate in the Filecoin network. Venus also includes several advanced features, such as automatic fault tolerance, intelligent storage allocation, and decentralized data distribution. These features are designed to improve the reliability and efficiency of the storage and retrieval processes on the Filecoin network. [hashtag](https://docs.filecoin.io/nodes/implementations/venus#interact-with-venus) Interact with Venus ------------------------------------------------------------------------------------------------------------ Here are some of the most common ways to interact with Venus: ### [hashtag](https://docs.filecoin.io/nodes/implementations/venus#venus-api) Venus API Venus provides a comprehensive API that allows developers to interact with the Filecoin network programmatically. The API includes methods for performing various operations such as storing and retrieving data, mining blocks, and transferring FIL tokens. You can use the API to build custom applications or integrate Filecoin functionality into your existing applications. ### [hashtag](https://docs.filecoin.io/nodes/implementations/venus#command-line-interface) Command-line interface Venus includes a powerful command-line interface that allows developers to interact with the Filecoin network from the terminal. You can use the CLI to perform various operations such as creating wallets, sending FIL transactions, and querying the network. The CLI is a quick and easy way to interact with the network and is particularly useful for testing and development purposes. ### [hashtag](https://docs.filecoin.io/nodes/implementations/venus#contribute-to-source) Contribute to source If you are interested in contributing to the development of Venus itself, you can do so by contributing to the open-source codebase on GitHub. You can submit bug reports, suggest new features, or submit code changes to improve the functionality, security, or performance of the network. [hashtag](https://docs.filecoin.io/nodes/implementations/venus#more-information) More information ------------------------------------------------------------------------------------------------------ For more information about Venus, including advanced configuration, see the [Venus documentation sitearrow-up-right](https://venus.filecoin.io/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/implementations/venus) [PreviousLotuschevron-left](https://docs.filecoin.io/nodes/implementations/lotus) [NextFull-nodeschevron-right](https://docs.filecoin.io/nodes/full-nodes) Last updated 1 year ago * [Interact with Venus](https://docs.filecoin.io/nodes/implementations/venus#interact-with-venus) * [Venus API](https://docs.filecoin.io/nodes/implementations/venus#venus-api) * [Command-line interface](https://docs.filecoin.io/nodes/implementations/venus#command-line-interface) * [Contribute to source](https://docs.filecoin.io/nodes/implementations/venus#contribute-to-source) * [More information](https://docs.filecoin.io/nodes/implementations/venus#more-information) sun-brightdesktopmoon sun-brightdesktopmoon --- # Pre-requisites | Filecoin Docs Before installing Lotus on your computer, you will need to meet the following prerequisites: * **Operating system**: Lotus is compatible with Windows, macOS, and various Linux distributions. Ensure that your operating system is compatible with the version of Lotus you intend to install. * **CPU architecture**: Lotus is compatible with 64-bit CPU architectures. Ensure that your computer has a 64-bit CPU. * **Memory**: Lotus requires at least 8GB of RAM to run efficiently. * **Storage**: Lotus requires several GB of free disk space for the blockchain data, as well as additional space for the Lotus binaries and other files. * **Internet connection**: Lotus requires a stable and high-speed internet connection to synchronize with the Filecoin network and communicate with other nodes. * **Firewall and port forwarding**: Ensure that your firewall settings and port forwarding rules allow incoming and outgoing traffic on the ports used by Lotus. * **Command-line interface**: Lotus is primarily operated through the command line interface. Ensure that you have a basic understanding of command-line usage and are comfortable working in a terminal environment. [hashtag](https://docs.filecoin.io/nodes/full-nodes/pre-requisites#lotus-documentation) Lotus documentation ---------------------------------------------------------------------------------------------------------------- To get more information, check out the official [Lotus documentationarrow-up-right](https://lotus.filecoin.io/lotus/install/prerequisites/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/full-nodes/pre-requisites) [PreviousFull-nodeschevron-left](https://docs.filecoin.io/nodes/full-nodes) [NextBasic setupchevron-right](https://docs.filecoin.io/nodes/full-nodes/basic-setup) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Network indexer | Filecoin Docs A _network indexer_, also referred to as an _indexer node_ or _indexer_, is a node that maps content identifiers (CIDs) to records of who has the data and how to retrieve that data. These records are called _provider data records_. Indexers are built to scale in environments with massive amounts of data, like the Filecoin network, and are also used by the IPFS network to locate data. Because the Filecoin network stores so much data, clients can’t perform efficient retrieval without proper indexing. Indexer nodes work like a specialized key-value store for efficient retrieval of content-addressed data. There are two groups of users within the network indexer process: * _Storage providers_ advertise their available content by storing data in the indexer. This process is handled by the indexer’s _ingest_ logic. * _Retrieval clients_ query the indexer to determine which storage providers have the content and what protocol to use, such as Graphsync, Bitswap, etc. This process is handled by the indexer’s _find_ logic. [hashtag](https://docs.filecoin.io/storage-providers/architecture/network-indexer#how-the-indexer-works) How the indexer works ----------------------------------------------------------------------------------------------------------------------------------- This diagram summarizes the different _actors_ in the indexer ecosystem and how they interact with each other. In this context, these actors are not the same as [smart-contract actors](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types) . ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-ef38f81d11b84334c7fd3d190e0e97eea36c56c1%252Fstorage-providers-architecture-network-indexer-indexer.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=f1c6c55f&sv=2) For more info on how the indexer works, read the [Filecoin blog postarrow-up-right](https://filecoin.io/blog/posts/how-does-the-network-indexer-work/) . [hashtag](https://docs.filecoin.io/storage-providers/architecture/network-indexer#ipni-and-storage-providers) IPNI and storage providers --------------------------------------------------------------------------------------------------------------------------------------------- Storage providers publish data to indexers so that clients can find that data using the CID or multihash of the content. When a client queries the indexer using a CID or multihash, the indexer then responds to the client with the provider data record, which tells the client where and how the content can be retrieved. As a storage provider, you will need to run an indexer in your setup so that your clients know where and how to retrieve data. For more information on how to create an index provider, see the [IPNI documentationarrow-up-right](https://github.com/ipni/storetheindex/blob/main/doc/creating-an-index-provider.md) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/network-indexer) [PreviousSealing-as-a-servicechevron-left](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) [NextInfrastructurechevron-right](https://docs.filecoin.io/storage-providers/infrastructure) Last updated 1 year ago * [How the indexer works](https://docs.filecoin.io/storage-providers/architecture/network-indexer#how-the-indexer-works) * [IPNI and storage providers](https://docs.filecoin.io/storage-providers/architecture/network-indexer#ipni-and-storage-providers) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/storage#raid-configurations) RAID configurations ------------------------------------------------------------------------------------------------------------------------- Storage systems use RAID for protection against data corruption and data loss. Since cost is an important aspect for storage providers, and you are dealing with cold storage mostly, you will be opting for SATA disks is RAID configurations that favor capacity (and read performance). This leads to RAID5, RAID6, RAIDZ and RAIDZ2. Double parity configurations like RAID6 and RAIDZ2 are preferred. The _width of a volume_ is defined by how many spindles (SATA disks) there are in a RAID group. Typical configurations range between 10+2 and 13+2 disks in a group (in a VDEV in the case of ZFS). [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/storage#raid-implications) RAID implications --------------------------------------------------------------------------------------------------------------------- Although RAIDZ2 provides high fault tolerance, configuring wide VDEVs also has an impact on performance and availability. ZFS performs an automatic healing task called _scrubbing_ which performs a checksum validation over the data and recovers from data corruption. This task is I/O intensive and might get in the way of other tasks that should get priority, like _storage proving_ of sealed sectors. Another implication of large RAID sets that gets aggravated with very large capacity per disk is the time it takes to rebuild. Rebuilding is the I/O intensive process that takes place when a disk in a RAID group is replaced (typically after a disk failed). If you choose to configure very wide VDEVs while using very large spindles (20TB+) you might experience very long rebuild times which again get in the way of high priority tasks like storage proving. It is possible though to configure wider VDEVs (RAID groups) for the unsealed sectors. Physically separating sealed and unsealed copies has other advantages, which are explained in [Custom Storage Layoutarrow-up-right](https://lotus.filecoin.io/storage-providers/operate/custom-storage-layout/) . [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/storage#i-o-behavior) I/O Behavior ----------------------------------------------------------------------------------------------------------- Storage providers keep copies of sealed sectors and unsealed sectors (for fast retrieval) on their storage systems. However the I/O behavior on sealed sectors is very different from the I/O behavior on unsealed sectors. When [storage proving](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) happens only a very small portion of the data is read by WindowPoSt. A large storage provider will have many sectors in multiple partitions for which WindowPoSt requires fast access to the disks. This is unusual I/O behavior for any storage system. The unsealed copies are used for fast retrieval of the data towards the customer. Large datasets in chunks of 32 GiB (or 64 GiB depending on the configured sector size) are read. In order to avoid different tasks competing for read I/O on disk it is recommended to create separate disk pools with their own VDEVs (when using ZFS) for sealed and unsealed copies. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/storage#write-performance) Write performance --------------------------------------------------------------------------------------------------------------------- Write access towards the storage also requires your attention. Depending how your storage array is connected (SAS or Ethernet) you will have different transfer speeds towards the sealed storage path. At a sealing capacity of 6 TiB/day you will effectively be writing 12 TiB/day towards the storage (6 TiB sealed, 6 TiB unsealed copies). Both your storage layout and your network need to be able to handle this. If this 12 TiB were equally spread across the 24 hrs of a day, this would already require 1.14 Gbps. > 12 TiB _1024 / 24 hr / 3600 sec_ 8 = 1.14 Gbps The sealing pipeline produces 32 GiB sectors (64 GiB depending on your configured sector size) which are written to the storage. If you configured _batching_ of the commit messages (to reduce total gas fees) then you will write multiple sectors towards disk at once. A minimum network bandwidth of 10 Gbps is recommended and write cache at the storage layer will be beneficial too. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/storage#read-performance) Read performance ------------------------------------------------------------------------------------------------------------------- Read performance is optimal when choosing for RAIDZ2 VDEVs of 10 to 15 disks. RAID-sets using parity like RAIDZ and RAIDZ2 will employ all spindles for read operations. This means read throughput is a lot better compared to reading from a single or a few spindles. There are 2 types of read operations that are important in the context of Filecoin: * random read I/O: When storage proving happens, a small portion of a sector is read for proving. * sequential read I/O: When retrievals happens, entire sectors are read from disk and streamed towards the customer via Boost. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/infrastructure/storage) [PreviousInfrastructurechevron-left](https://docs.filecoin.io/storage-providers/infrastructure) [NextNetworkchevron-right](https://docs.filecoin.io/storage-providers/infrastructure/network) Last updated 1 year ago * [RAID configurations](https://docs.filecoin.io/storage-providers/infrastructure/storage#raid-configurations) * [RAID implications](https://docs.filecoin.io/storage-providers/infrastructure/storage#raid-implications) * [I/O Behavior](https://docs.filecoin.io/storage-providers/infrastructure/storage#i-o-behavior) * [Write performance](https://docs.filecoin.io/storage-providers/infrastructure/storage#write-performance) * [Read performance](https://docs.filecoin.io/storage-providers/infrastructure/storage#read-performance) sun-brightdesktopmoon sun-brightdesktopmoon --- # Full-nodes | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/full-nodes) [PreviousVenuschevron-left](https://docs.filecoin.io/nodes/implementations/venus) [NextPre-requisiteschevron-right](https://docs.filecoin.io/nodes/full-nodes/pre-requisites) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Skills | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills) [PreviousReference architectureschevron-left](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures) [NextLinuxchevron-right](https://docs.filecoin.io/storage-providers/skills/linux) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Backup and disaster recovery | Filecoin Docs It is crucial to have a backup of any production system. It is even more crucial to be able to restore from that backup. These concepts are vital to a Filecoin storage provider because not only are you storing customer data for which you have (on-chain) contracts, you have also pledged a large amount of collateral for that data. If you are unable to restore your Lotus miner and start proving your storage on-chain, you risk losing a lot of money. If you are unable to come back online in 6 weeks, you are losing **all** of your collateral, which will most likely lead to bankruptcy. As such it matters less what kind of backup you have, as long as you are able to restore from it fast. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#high-availability-ha-versus-disaster-recovery-dr) High availability (HA) versus Disaster recovery (DR) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ It is a common misconception to assume you are covered against any type of failure by implementing a highly available (HA) setup. HA will protect against unplanned unavailability in many cases, such as a system failure. It will **not** protect you against data corruption, data loss, ransomware, or a complete disaster at the datacenter level. Backups and (tested) restores are the basis for a DR (disaster recovery) plan and should be a major point of attention for any Filecoin storage provider, regardless of your size of operation. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#recovery-time-objective-rto-and-recovery-point-objective) Recovery Time Objective (RTO) and Recovery Point Objective -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- When planning for backup and recovery, the terms RPO and RTO are important concepts to know about. * **Recovery Time Objective (RTO)** is the time taken to recover a certain application or dataset in the event of a failure. Fast recovery means a shorter RTO (typically measured in hours/minutes/seconds). Enterprises plan for very short RTOs when downtime is not acceptable to their business. Application and file system snapshots typically provide the lowest possible RTO. * **Recovery Point Objective (RPO)** is the last known working backup from which you can recover. A shorter RPO means the time between the last backup and the failure is short. Enterprises plan for very short RPOs for systems and data that changes very often (like databases). Synchronous replication of systems and data typically provides the lowest possible RPO. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#rpo-rto-for-storage-providers) RPO/RTO for storage providers Although ‘RPO zero’ and ‘RTO zero’ are the ideal, in practice it is rarely economical. DR planning requires compromises and if you are a storage provider you need to consider cost versus RPO. RTO is typically less concerning for storage providers. The most critical parts to recover are your sealed storage and your wallets. Wallet addresses typically do not change, so the only thing to worry about is your sealed storage. With storage level snapshots (such as ZFS snapshots), you can reduce your RTO to almost zero. For RPO, although synchronous replication, together with snapshots, can reduce RPO to nearly zero, that is not a cost-efficient solution. Asynchronous replication of sealed storage is the most viable option if you are running at small-to-medium scale. Once you grow beyond 10PB of storage, even replicating the data will become an expensive solution. In such cases you might want to look into _storage cluster_ solutions with built-in redundancy. Very large storage providers will operate [Ceph clustersarrow-up-right](https://en.wikipedia.org/wiki/Ceph_(software)) or other solutions with built-in _erasure coding_. Although this does more become more like a HA setup than a DR setup, at scale, it becomes the only economically viable option. Running a storage cluster comes with its own operational challenges though, which does not make this a good fit for small-to-medium setups. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#rpo-rto-for-customers) RPO/RTO for customers Both storage providers and data owners (customers) should look at RPO and RTO options. As a customer, you can achieve HA/DR by having multiple copies of your data stored (and proven) across multiple storage providers. In the event of data loss at one provider, other providers will hold a copy of your data from which you can retrieve. As a customer, you choose how much redundancy you need, by doing storage deals with more providers. RTO for data owners is a matter of how fast the storage provider(s) can provide you the data. * Do your storage providers offer “fast retrieval” of the data through unsealed copies? If not, the unsealing process (typically multiple hours) must be calculated into the RTO. * Do your storage providers offer retrieval through [Saturn, (the Web3 CDN)arrow-up-right](https://saturn.tech/) for ultra-fast retrieval? * Do your storage providers pin your data on IPFS, in addition to storing it on Filecoin? RPO for data owners is less of a concern, especially once the data is sealed. The Filecoin blockchain will enforce availability and durability of the data being stored, once it is sealed. It is therefore important, as a data owner, to know how fast your storage provider can prove the data on-chain. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#backup-techniques) Backup techniques ------------------------------------------------------------------------------------------------------------------------------------------ * A first level of protection comes from ZFS (if you are using ZFS as the file system for your storage). Having ZFS snapshots available protects you against data loss caused by human error or tech failure, and potentially even against ransomware. Other file systems typically also have a way to make snapshots, albeit not as efficiently as ZFS. * A second level of defense comes from a dedicated backup system. Not only should you have backup storage (on a different storage array than the original data), you also need to have a backup server that can at a minimum run the Lotus daemon, Lotus miner and 1 WindowPoSt worker (note: this requires a GPU). With that you can sync the chain, offer retrievals and prove your storage on-chain, from your backup system, whilst you bring your primary back online. * An alternative technique to having a dedicated backup system and copy is to have a storage cluster. This still requires a backup system to run the Lotus daemon, Lotus miner and PoST worker on. Implementing a storage cluster is usually only done for large-scale deployments as it comes with additional operational tasks. For maximum resilience, you could host your backup system (server + storage) in a different datacenter than your primary system. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#dr-failover-techniques) DR failover techniques ---------------------------------------------------------------------------------------------------------------------------------------------------- One way to prepare for an easy failover of the software components in the event of a failure is to configure floating IP addresses. Instead of pinning lotus daemon and lotus-miner to the host IP address of the server they are running on, you can configure a secondary IP address and pin the daemon to its own IP, and lotus-miner to yet another IP. This helps to reduce the amount of manual tasks for a failover drastically. If the recovered daemon or miner instance changes IP address it requires quite a lot of reconfiguration in various places. Having the services on a floating IP allows to assign this IP to another machine and start the service on it. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#no-penalty-for-recovered-faults) No Penalty for Recovered Faults ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Note that as of [FIP006: No repay debt requirement for DeclareFaultsRecoveredarrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0006.md) , storage providers are no longer required to pay [fee debtarrow-up-right](https://docs.filecoin.io/storage-providers/filecoin-economics/slashing) prior to recovering a new storage fault. This enables a storage provider that currently has accrued fee debt to recover faults without being further penalized with additional fees. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery) [PreviousNetworkchevron-left](https://docs.filecoin.io/storage-providers/infrastructure/network) [NextReference architectureschevron-right](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures) Last updated 1 year ago * [High availability (HA) versus Disaster recovery (DR)](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#high-availability-ha-versus-disaster-recovery-dr) * [Recovery Time Objective (RTO) and Recovery Point Objective](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#recovery-time-objective-rto-and-recovery-point-objective) * [RPO/RTO for storage providers](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#rpo-rto-for-storage-providers) * [RPO/RTO for customers](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#rpo-rto-for-customers) * [Backup techniques](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#backup-techniques) * [DR failover techniques](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#dr-failover-techniques) * [No Penalty for Recovered Faults](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery#no-penalty-for-recovered-faults) sun-brightdesktopmoon sun-brightdesktopmoon --- # Implementations | Filecoin Docs [hashtag](https://docs.filecoin.io/nodes/implementations#lotus) Lotus -------------------------------------------------------------------------- ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-b5b535e1089778542a48ab7160447d37dc96f44b%252Fnodes-implementations-overview-lotus-logo.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=b1682b3f&sv=2) The Lotus implementation logo. Lotus is the reference implementation of the Filecoin protocol, developed by Protocol Labs, the organization behind Filecoin. Lotus is a full-featured implementation of the Filecoin network, including the storage, retrieval, and mining functionalities. It is written in Go and is designed to be modular, extensible, and highly scalable. [Learn more about Lotus](https://docs.filecoin.io/nodes/implementations/lotus) [hashtag](https://docs.filecoin.io/nodes/implementations#venus) Venus -------------------------------------------------------------------------- ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-1d205d64b1b5ddfbf9d8ead365af47d31eeaa0d3%252Fnodes-implementations-overview-venus-logo.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=73629dfc&sv=2) The Venus implementation logo. Venus is an open-source implementation of the Filecoin network, developed by IPFSForce. The project is built in Go and is designed to be fast, efficient, and scalable. Venus is a full-featured implementation of the Filecoin protocol, providing storage, retrieval, and mining functionalities. It is compatible with the Lotus implementation and can interoperate with other Filecoin nodes on the network. One of the key features of Venus is its support for the Chinese language and market. Venus provides a Chinese language user interface and documentation, making it easier for Chinese users to participate in the Filecoin network. [Learn more about Venus](https://docs.filecoin.io/nodes/implementations/venus) [hashtag](https://docs.filecoin.io/nodes/implementations#implementation-differences) Implementation differences -------------------------------------------------------------------------------------------------------------------- While Lotus and Venus share many similarities, they differ in their development, feature sets, focus, and community support. Depending on your needs and interests, you may prefer one implementation over the other: ### [hashtag](https://docs.filecoin.io/nodes/implementations#compatibility) Compatibility Both Lotus and Venus are fully compatible with the Filecoin network and can interoperate with other Filecoin nodes on the network. ### [hashtag](https://docs.filecoin.io/nodes/implementations#features) Features While both implementations provide storage, retrieval, and mining functionalities, they differ in their feature sets. Lotus includes features such as a decentralized storage market, a retrieval market, and a built-in consensus mechanism, while Venus includes features such as automatic fault tolerance, intelligent storage allocation, and decentralized data distribution. ### [hashtag](https://docs.filecoin.io/nodes/implementations#focus) Focus Lotus has a more global focus, while Venus has a stronger focus on the Chinese market. Venus provides a Chinese language user interface and documentation, making it easier for Chinese users to participate in the Filecoin network. [hashtag](https://docs.filecoin.io/nodes/implementations#other-implementations) Other implementations ---------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/nodes/implementations#forest) Forest ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-d8f352ac01f660f37d5eba2dd0eb458248fd9ea0%252Fnodes-implementations-overview-venus-forest.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=20161e2f&sv=2) Forest logo. Forest is the Rust implementation of the Filecoin protocol with low hardware requirements (16 GiB, 4 cores), developed by ChainSafe. Forest is focused on blockchain analytics, and does not support storage, retrieval or mining. Forest is currently used for generating up-to-date snapshots and managing archival copies of the Filecoin blockchain. Currently, the Forest team is hosting the entire Filecoin archival data for the community to use. This can be downloaded for free [herearrow-up-right](https://forest-archive.chainsafe.dev/list/) . You can learn more about Forest at the [codebase on GitHubarrow-up-right](https://github.com/ChainSafe/forest) and [documentation sitearrow-up-right](https://docs.forest.chainsafe.io/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/implementations) [PreviousInstall & Run PDPchevron-left](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp) [NextLotuschevron-right](https://docs.filecoin.io/nodes/implementations/lotus) Last updated 1 year ago * [Lotus](https://docs.filecoin.io/nodes/implementations#lotus) * [Venus](https://docs.filecoin.io/nodes/implementations#venus) * [Implementation differences](https://docs.filecoin.io/nodes/implementations#implementation-differences) * [Compatibility](https://docs.filecoin.io/nodes/implementations#compatibility) * [Features](https://docs.filecoin.io/nodes/implementations#features) * [Focus](https://docs.filecoin.io/nodes/implementations#focus) * [Other implementations](https://docs.filecoin.io/nodes/implementations#other-implementations) * [Forest](https://docs.filecoin.io/nodes/implementations#forest) sun-brightdesktopmoon sun-brightdesktopmoon --- # Lotus | Filecoin Docs [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#interact-with-lotus) Interact with Lotus ------------------------------------------------------------------------------------------------------------ There are many ways to interact with a Lotus node, depending on your specific needs and interests. By leveraging the powerful tools and APIs provided by Lotus, you can build custom applications, extend the functionality of the network, and contribute to the ongoing development of the Filecoin ecosystem. ### [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#lotus-api) Lotus API Lotus provides a comprehensive API that allows developers to interact with the Filecoin network programmatically. The API includes methods for performing various operations such as storing and retrieving data, mining blocks, and transferring FIL tokens. You can use the API to build custom applications or integrate Filecoin functionality into your existing applications. ### [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#lotus-cli) Lotus CLI Lotus includes a powerful command-line interface that allows developers to interact with the Filecoin network from the terminal. You can use the CLI to perform various operations such as creating wallets, sending FIL transactions, and querying the network. The CLI is a quick and easy way to interact with the network and is particularly useful for testing and development purposes. ### [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#custom-plugin) Custom plugin Lotus is designed to be modular and extensible, allowing developers to create custom plugins that add new functionality to the network. You can develop plugins that provide custom storage or retrieval mechanisms, implement new consensus algorithms, or add support for new network protocols. ### [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#source-contributions) Source contributions If you are interested in contributing to the development of Lotus itself, you can do so by contributing to the open-source codebase on GitHub. You can submit bug reports, suggest new features, or submit code changes to improve the functionality, security, or performance of the network. [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#hosted-nodes) Hosted nodes ---------------------------------------------------------------------------------------------- Many hosting service provide access to Lotus nodes on the Filecoin network. Check out the [RPC section for more information](https://docs.filecoin.io/networks/mainnet/rpcs) [hashtag](https://docs.filecoin.io/nodes/implementations/lotus#more-information) More information ------------------------------------------------------------------------------------------------------ For more information about Lotus, including advanced configuration, check out the Lotus documentation site [lotus.filecoin.ioarrow-up-right](https://lotus.filecoin.io/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/implementations/lotus) [PreviousImplementationschevron-left](https://docs.filecoin.io/nodes/implementations) [NextVenuschevron-right](https://docs.filecoin.io/nodes/implementations/venus) Last updated 1 year ago * [Interact with Lotus](https://docs.filecoin.io/nodes/implementations/lotus#interact-with-lotus) * [Lotus API](https://docs.filecoin.io/nodes/implementations/lotus#lotus-api) * [Lotus CLI](https://docs.filecoin.io/nodes/implementations/lotus#lotus-cli) * [Custom plugin](https://docs.filecoin.io/nodes/implementations/lotus#custom-plugin) * [Source contributions](https://docs.filecoin.io/nodes/implementations/lotus#source-contributions) * [Hosted nodes](https://docs.filecoin.io/nodes/implementations/lotus#hosted-nodes) * [More information](https://docs.filecoin.io/nodes/implementations/lotus#more-information) sun-brightdesktopmoon sun-brightdesktopmoon --- # Snap deals | Filecoin Docs Instead of destroying a previously sealed sector and recreating a new sector that needs to be sealed, Snap Deals allow data to be ingested into CC-sectors without the requirement of re-sealing the sector. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/snap-deals#why-would-you-do-snap-deals) Why would you do snap deals? --------------------------------------------------------------------------------------------------------------------------------------------- There are two main reasons why a storage provider could be doing Snap Deals, also known as _“snapping up their sectors”_ in the Filecoin community: * The first reason is that the 10x storage power on the same volume of data stored is a strong incentive to upgrade to verified deals for those storage providers who started out on CC-sectors and wish to upgrade to verified deals with Filecoin Plus. * The second reason applies to storage providers who decide to start sealing CC-sectors, but later then fill them with verified deals. When you start as a storage provider or when you expand your storage capacity, it might be a good idea to fill your capacity with CC-sectors in the absence of verified deals. Not only do you start earning block rewards over that capacity, but more importantly, you can plan the sealing throughput, and balance your load over the available hardware. If your [sealing rate](https://docs.filecoin.io/storage-providers/architecture/sealing-rate) is 3 TiB/day, it makes no sense to feed 5 TiB/day into the pipeline. This creates congestion and possibly negative performance. If you are sealing 3 TiB/day for 33 days in a row, you end up with 99 TiB of sealed sectors that were sealed evenly and consistently. If you then take on a 99 TiB verified deal (accounting for 1 PiB QAP), the only thing required is to snap up the sectors. Snapping up sectors with snap deals puts a lot less stress on the storage provider’s infrastructure. The only task that is executed from the [sealing pipeline](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) is the replica-update and prove-replica-update phase, which is similar to the PC2 process. The CPU-intensive PreCommit 1 phase is not required in this process. Do not forget to provide the collateral funds when snapping up a verified deal. The same volume requires more collateral when it counts as Filecoin Plus data, namely 10x the collateral compared to raw storage power. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/snap-deals) [PreviousFilecoin programs and toolschevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs) [NextCharging for datachevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/charging-for-data) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Software components | Filecoin Docs The diagram below shows the major components of Lotus: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-89d64ac6cd61a6acdc439352f156c77992a7ea4b%252Fstorage-provider-architecture-software-components-components.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=db749bc3&sv=2) The following components are the most important to understand: * Lotus daemon * Lotus miner * Lotus worker * Boost [Click herearrow-up-right](https://boost.filecoin.io/getting-started) for a compatibility matrix of the different components and the required Golang version. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#lotus-daemon) Lotus daemon The daemon is a key Lotus component that does the following: * Syncs the chain * Holds the wallets of the storage provider The machine running the Lotus daemon must be connected to the public internet for the storage provider to function. See the [Lotus documentationarrow-up-right](https://lotus.filecoin.io/storage-providers/setup/initialize/#connectivity-to-the-storage-provider) for more in-depth information on connectivity requirements. #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#syncing-the-chain) Syncing the chain Syncing the chain is a key role of the daemon. It communicates with the other nodes on the network by sending messages, which are, in turn, collected into [blocksarrow-up-right](https://docs.filecoin.io/reference/general/glossary/#block) . These blocks are then collected into [tipsetsarrow-up-right](https://docs.filecoin.io/reference/general/glossary/#tipset) . Your Lotus daemon receives the messages on-chain, enabling you to maintain consensus about the state of the Filecoin network with all the other participants. Due to the growth in the size of the chain since its genesis, it is not advised for storage providers to sync the entire history of the network. Instead, providers should use the available [lightweight snapshotsarrow-up-right](https://forest-archive.chainsafe.dev/list) to import the most recent messages. One exception in which a provider would need to sync the entire chain would be to run a blockchain explorer. Synced chain data should be stored on an SSD; however, faster NVMe drives are strongly recommended. A slow chain sync can lead to delays in critical messages being sent on-chain from your Lotus miner, resulting in the faulting of sectors and the slashing of collateral. Another important consideration is the size of the file system and available free space. Because the Filecoin chain grows as much as 50GB a day, any available space will eventually fill up. It is up to storage providers to manage the size of the chain on disk and prune it as needed. Solutions like [SplitStorearrow-up-right](https://lotus.filecoin.io/lotus/configure/splitstore/) (enabled by default) and [compactingarrow-up-right](https://lotus.filecoin.io/lotus/manage/chain-management/#compacting-the-chain-data) reduce the storage space used by the chain. Compacting involves replacing the built-up chain data with a recent lightweight snapshot. #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#holding-wallets) Holding wallets Another key role of the Lotus daemon is to host the Filecoin wallets that are required to run a storage provider (SP). As an SP, you will need a minimum of 2 wallets: an _owner wallet_ and a _worker wallet_. A third wallet called the _control_ wallet) is required to scale your operations in a production environment. To keep wallets safe, providers should consider physical access, network access, software security, and secure backups. As with any cryptocurrency wallet, access to the private key means access to your funds. Lotus supports [Ledger hardware walletsarrow-up-right](https://lotus.filecoin.io/lotus/manage/ledger/) , the use of which is recommended, or remote wallets with `lotus-wallet` on a remote machine (see [remote lotus walletarrow-up-right](https://lotus.filecoin.io/tutorials/lotus/remote-lotus-wallet/) for instructions). The worker and control wallets can not be kept on a hardware device because Lotus requires frequent access to those types of wallets. For instance, Lotus may require access to a worker or control wallet to send WindowPoSt proofs on-chain. **Control wallets** Control wallets are required to scale your operations in a production environment. In production, only using the general worker wallet increases the risk of message congestion, which can result in delayed message delivery on-chain and potential sector faulting, slashing, or lost block rewards. It is recommended that providers create wallets for each subprocess. There are five different types of control wallets a storage provider can create: * PoSt wallet * PreCommit wallet * Commit wallet * Publish storage deals wallet * Terminate wallet The `lotus-miner` also gets an address to which funds can/should be sent. This address can be used to pay any fees and collateral. Withdrawal from this address is **only** possible with the _owner wallet_ private key. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#lotus-miner) Lotus miner The Lotus miner, often referred to using the daemon naming syntax `lotus-miner`, is the process that coordinates most of the storage provider activities. It has 3 main responsibilities: * Storing sectors and data * Scheduling jobs * Proving the stored data #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#storing-sectors-and-data) Storing sectors and data Storage Providers on the Filecoin network store sectors. There are two types of sectors that a provider may store: * Sealed sectors: these sectors may or may not actually contain data, but they provide capacity to the network, for which the provider is rewarded. * Unsealed sectors: used when storing data deals, as retrievals happen from unsealed sectors. Originally, `lotus-miner` was the component with storage access. This resulted in `lotus-miner` hardware using internal disks, directly attached storage shelves like [JBODsarrow-up-right](https://en.wikipedia.org/wiki/Non-RAID_drive_architectures#JBOD) , Network-Attached-Storage (NAS), or a storage cluster. However, this design introduced a bottleneck on the Lotus miner. More recently, Lotus has added a more scalable storage access solution in which workers can also be assigned storage access. This removes the bottleneck from the Lotus miner. Low-latency storage access is critical because of the impact on storage-proving processes. Keeping a backup of your sealed sectors, the cache directory, and any unsealed sectors is crucial. Additionally, you should keep a backup of the `sectorstore.json` file that lives under your storage path. The `sectorestore.json` file is required to restore your system in the event of a failure. You can read more about the `sectorstore.json` file in the [lotus docsarrow-up-right](https://lotus.filecoin.io/storage-providers/seal-workers/seal-workers/#sector-storage-groups) . It is also imperative to have at least a daily backup of your `lotus-miner` state. Backups can be made with: The `sectorstore.json` file, which lives under your storage path, is also required for restoration in the event of a failure. You can read more about the file in the [Lotus docsarrow-up-right](https://lotus.filecoin.io/storage-providers/seal-workers/seal-workers/#sector-storage-groups) . ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#scheduling-jobs) Scheduling jobs Another key responsibility of the Lotus Miner is the scheduling of jobs for the sealing pipeline and storage proving. #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#storage-proving) Storage proving One of the most important roles of `lotus-miner` is the Storage proving. Both [WindowPoStarrow-up-right](https://docs.filecoin.io/reference/general/glossary/#window-proof-of-spacetime-windowpost) and [WinningPoStarrow-up-right](https://docs.filecoin.io/reference/general/glossary/#winning-proof-of-spacetime-winningpost) processes are usually handled by the `lotus-miner` process. For scalability and reliability purposes it is now also possible to run these proving processes on dedicated servers (proving workers) instead of using the Lotus miner. The proving processes require low-latency access to sealed sectors. The proving challenge requires a GPU to run on. The resulting `zkProof` will be sent to the chain in a message. Messages must arrive within 30 minutes for WindowPoSt, and 30 seconds for WinningPoSt. It is extremely important that providers properly size and configure the proving workers, whether they are using just the Lotus miner or separate workers. Additionally, dedicated wallets, described in Control wallets, should be set up for these processes. Always check if there are upcoming proving deadlines before halting any services for maintenance. For detailed instructions, refer to the [Lotus maintenance guidearrow-up-right](https://lotus.filecoin.io/storage-providers/operate/maintenance/) . ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#lotus-worker) Lotus worker The Lotus worker is another important component of the Lotus architecture. There can be - and most likely will be - multiple workers in a single storage provider setup. Assigning specific roles to each worker enables higher throughput, sealing rate, and improved redundancy. As mentioned above, proving tasks can be assigned to dedicated workers, and workers can also get storage access. The remaining worker tasks encompass running a sealing pipeline, which is discussed in the next section. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#boost) Boost [Boostarrow-up-right](https://boost.filecoin.io/) is the market component for storage providers to interact with clients. Boost is made of several components (such as boostd, boostd-data, yugabytedb, booster-http etc.). It works as a deal-taking engine (from deals made by clients or other tools), and serves data retrievals to clients who request a copy of the data over graphsync, bitswap or http. Boost has become a critical component in the software stack of a storage provider and it is therefore necessary to read the Boost documentation carefully. Boost requires YugabyteDB as of version 2.0. Plan your deployment so that you understand the concepts of Yugabyte well enough. See the [Boostarrow-up-right](https://boost.filecoin.io/) documentation for more details. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#helpful-commands) Helpful commands The following commands can help storage providers with their setup. #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#backup-lotus-miner-state) Backup Lotus miner state It is imperative to have at least one daily backup of your Lotus miner state. Backups can be made using the following command: #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#view-wallets-and-funds) View wallets and funds You can use the following command to view wallets and their funds: #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#check-storage-configuration) Check storage configuration Run the following command to check the storage configuration for your Lotus miner instance: This command return information on your _sealed space_ and your _scratch space_, otherwise known as a cache. These spaces are only available if you have properly configured your Lotus miner by following the steps described in the [Lotus documentationarrow-up-right](https://lotus.filecoin.io/storage-providers/operate/custom-storage-layout/) . In some cases it might be useful to check if the system has access to the storage paths to a certain sector. To check the storage paths to sector 1 for instance, use: #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#view-scheduled-jobs) View scheduled jobs To view the scheduled sealing jobs, run the following: #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#view-available-workers) View available workers To see the workers on which the miner can schedule jobs, run: #### [hashtag](https://docs.filecoin.io/storage-providers/architecture/lotus-components#view-proving-deadlines) View proving deadlines To check if there are upcoming proving deadlines, run the following: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/lotus-components) [PreviousArchitecturechevron-left](https://docs.filecoin.io/storage-providers/architecture) [NextStorage provider automationchevron-right](https://docs.filecoin.io/storage-providers/architecture/lotus-automation) Last updated 1 year ago * [Lotus daemon](https://docs.filecoin.io/storage-providers/architecture/lotus-components#lotus-daemon) * [Lotus miner](https://docs.filecoin.io/storage-providers/architecture/lotus-components#lotus-miner) * [Scheduling jobs](https://docs.filecoin.io/storage-providers/architecture/lotus-components#scheduling-jobs) * [Lotus worker](https://docs.filecoin.io/storage-providers/architecture/lotus-components#lotus-worker) * [Boost](https://docs.filecoin.io/storage-providers/architecture/lotus-components#boost) * [Helpful commands](https://docs.filecoin.io/storage-providers/architecture/lotus-components#helpful-commands) sun-brightdesktopmoon Copy lotus-miner backup Copy lotus-miner backup Copy lotus wallet list Copy lotus-miner storage list Copy lotus-miner storage find 1 Copy lotus-miner sealing jobs Copy lotus-miner sealing workers Copy lotus-miner proving deadlines sun-brightdesktopmoon --- # Sales | Filecoin Docs Running a storage provider business is not just about having technical expertise and providing storage services. It is also about building and maintaining relationships with clients, negotiating contracts, and managing finances effectively. A storage provider must be able to communicate the value of their services to potential clients, as well as ensure that current clients are satisfied and receive the support they need. **Sales skills** are important for storage providers to differentiate themselves from the competition, market their services effectively, and attract new customers. This requires an understanding of the market, the needs of potential clients, and how to tailor their services to meet those needs. Storage providers should also be able to identify opportunities for growth and expansion, and have a strategy in place for pursuing those opportunities. In addition to sales skills, financial management skills are also crucial for running a successful storage provider business. This includes budgeting, forecasting, and managing cash flow effectively. It is important for storage providers to understand the costs associated with providing their services, and to price their services appropriately in order to generate revenue and cover their expenses. Overall, sales skills are essential for storage providers to succeed in a competitive market. By combining technical expertise with strong business and commercial skills, storage providers can build a successful and sustainable business. [hashtag](https://docs.filecoin.io/storage-providers/skills/sales#business-aspects) Business aspects --------------------------------------------------------------------------------------------------------- Running a storage provider business involves several business aspects that require careful attention to ensure long-term success. The first and most obvious aspect is investment in hardware and FIL as collateral. Hardware is the backbone of any storage provider’s business, and ensuring that you have the right equipment to provide reliable and high-performance storage is critical. Additionally, FIL is the primary currency used within the Filecoin network, and as a storage provider, you need to ensure that you have a sufficient amount of FIL as collateral to cover your storage deals. As your business grows, the amount of hardware and FIL needed will increase, and it is important to have a clear plan for scaling your business. This involves not only investing in additional hardware and FIL but also managing operational costs such as electricity, cooling, and maintenance. Having a skilled business team that can manage and plan for these costs is essential. Another important aspect of running a storage provider business is managing your relationships with investors, venture capitalists, and banks. These organizations can provide much-needed funding to help grow your business, but they will only invest if they are confident in your ability to manage your business effectively. This means having a strong business plan, a skilled team, and a clear strategy for growth. In summary, the business aspects of running a storage provider business are critical to its success. This involves managing investments in hardware and FIL, planning for scalability and managing operational costs, and building strong relationships with investors, venture capitalists, and banks. [hashtag](https://docs.filecoin.io/storage-providers/skills/sales#commercial-aspects) Commercial aspects ------------------------------------------------------------------------------------------------------------- A storage provider needs to get storage deals to grow his network power and to earn money. There are at least 2 ways to get storage deals, each one requiring specific sales skills. * Obtaining data replicas from other storage providers and programs: Certain Filecoin data programs will specify the minimum amount of replicas needed to perform a deal. This means deals need to be stored across multiple storage providers in the ecosystem, so you can work with peers in the network to share clients’ data replicas. Working in the ecosystem and building connections with other storage providers takes time and effort, and is essentially a sales activity. * Onboarding your own customers: Acquiring your own customers, and bringing their data onto the Filecoin network, requires business development skills and people on your team who actively work with data owners (customers) to educate them about the advantages of decentralized storage. It takes additional effort to work with customers and their data, but it has the additional advantage of being able to charge your customer for the data being stored. This means an additional revenue stream compared to only storing copies of deals, and earning block rewards. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills/sales) [PreviousStoragechevron-left](https://docs.filecoin.io/storage-providers/skills/storage) [NextIndustrychevron-right](https://docs.filecoin.io/storage-providers/skills/industry) Last updated 1 year ago * [Business aspects](https://docs.filecoin.io/storage-providers/skills/sales#business-aspects) * [Commercial aspects](https://docs.filecoin.io/storage-providers/skills/sales#commercial-aspects) sun-brightdesktopmoon sun-brightdesktopmoon --- # Industry | Filecoin Docs When working with customers from certain industries, it is important to understand that specific requirements may apply. This can include certifications and compliance standards that are necessary to meet regulatory and legal obligations. Some examples of such standards include: **HIPAA**: This standard applies to the handling of medical data and is essential for healthcare providers and organizations. **SOC2**: This standard applies to service providers and is used to ensure that they have adequate controls in place to protect sensitive data. **PCI-DSS**: This standard applies to businesses that handle payments and ensures that they have adequate security measures in place to protect payment card data. [PCI-DSSarrow-up-right](https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard) **SOX**: This standard applies to businesses operating in the financial sector and is used to ensure that they have adequate controls in place to protect against fraud and financial misconduct. **GDPR**: This standard applies to businesses that store personally identifiable information (PII) for European customers and is used to ensure that customer data is protected in accordance with European data privacy regulations. **Local regulations**: These regulations can vary per country and are especially important to consider when doing business with government agencies. **ISO 27001**: This is a security standard that provides a framework for establishing, implementing, maintaining, and continually improving an information security management system. Having one or more of these certifications can demonstrate to customers that you have the necessary skills and expertise to handle their data and meet their regulatory requirements. This can be a valuable asset for businesses looking to work with customers in specific industries, as it can provide a competitive edge and help attract new customers. Therefore, it is important for storage providers to stay informed about industry-specific requirements and obtain relevant certifications as necessary. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills/industry) [PreviousSaleschevron-left](https://docs.filecoin.io/storage-providers/skills/sales) [NextPDPchevron-right](https://docs.filecoin.io/storage-providers/pdp) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Network | Filecoin Docs Network skills are crucial for building and maintaining a well-functioning storage provider setup. The network architecture plays a vital role in the overall performance of the storage system. Without a proper network architecture, the system can easily become bogged down and suffer from poor performance. To ensure optimal performance, it is essential to understand where the bottlenecks in the network setup are. This requires a good understanding of network topology, protocols, and hardware. It is also important to be familiar with network monitoring tools that can help identify performance issues and optimize network traffic. In **addition**, knowledge of security protocols and best practices is essential for protecting the storage provider setup from unauthorized access, data breaches, and other security threats. Understanding network security principles can help ensure the integrity and confidentiality of data stored on the network. **Overall**, network skills are essential for building a high-performing, well-balanced storage provider setup. A solid understanding of network architecture, topology, protocols, and security principles can help optimize performance, prevent bottlenecks, and protect against security threats. For example, a storage provider setup may have multiple servers that are connected to a network. If the network architecture is not designed properly, data transfer between the servers can become slow and cause delays. This can lead to poor performance and frustrated users. By understanding network architecture and designing the network properly, such bottlenecks can be avoided. **Monitoring** the network is also crucial in identifying potential performance issues. Network monitoring tools can provide insights into network traffic patterns, bandwidth usage, and other metrics that can be used to optimize performance. Monitoring the network can help identify bottlenecks and areas where improvements can be made. **Network security** is another important consideration for storage provider setups. A network that is not properly secured can be vulnerable to unauthorized access, data breaches, and other security threats. Network security principles such as firewalls, encryption, and access control can be used to protect the storage provider setup from these threats. **In summary**, network skills are essential for building and maintaining a high-performing storage provider setup. A solid understanding of network architecture, topology, protocols, and security principles can help optimize performance, prevent bottlenecks, and protect against security threats. Monitoring the network is also crucial in identifying potential issues and ensuring smooth data flow. [hashtag](https://docs.filecoin.io/storage-providers/skills/network#network-infrastructure) Network infrastructure ----------------------------------------------------------------------------------------------------------------------- Network infrastructure, including switches, routers, and firewalls, plays a crucial role in the performance, reliability, and security of any network. Having the right infrastructure in place is essential to ensuring smooth and seamless network connectivity. **Switches** are essential for connecting multiple devices within a network. They direct data traffic between devices on the same network, allowing for efficient communication and data transfer. Switches come in a variety of sizes and configurations, from small desktop switches for home networks to large modular switches for enterprise networks. Choosing the right switch for your network can help ensure optimal performance and reliability. **Routers**, on the other hand, are responsible for connecting different networks together. They enable communication between devices on different networks, such as connecting a home network to the internet or connecting multiple offices in a business network. Routers also provide advanced features such as firewall protection and traffic management to help ensure network security and optimize network performance. **Firewalls** act as a first line of defense against external threats. They filter traffic coming into and out of a network, blocking malicious traffic and allowing legitimate traffic to pass through. Firewalls come in various forms, from hardware firewalls to software firewalls, and can be configured to block specific types of traffic or restrict access to certain parts of the network. When it comes to network infrastructure, it’s important to choose switches, routers, and firewalls that are reliable, efficient, and secure. This means taking into account factors such as network size, bandwidth requirements, and security needs when selecting infrastructure components. In addition to choosing the right components, it’s also important to properly configure and maintain them. This includes tasks such as setting up VLANs, implementing security features such as access control lists (ACLs), and regularly updating firmware and software to ensure optimal performance and security. **In summary**, network infrastructure, including switches, routers, and firewalls, is essential for building a reliable and secure network. Whether you are building a small home network or a large-scale enterprise network, investing in the right infrastructure components and properly configuring and maintaining them can help ensure optimal network performance, reliability, and security. [hashtag](https://docs.filecoin.io/storage-providers/skills/network#performance) Performance ------------------------------------------------------------------------------------------------- Performance is a critical aspect of a storage provider setup, particularly when dealing with high network throughput requirements between multiple systems. To ensure optimal performance, it is important to use network benchmarking tools such as iperf and iperf3. These tools make it easy to test network throughput and identify bottlenecks in the network setup. By using iperf or iperf3, you can determine the maximum network throughput between two systems. This can help you identify potential performance issues, such as network congestion or insufficient bandwidth. By running network benchmarks, you can also determine the impact of changes to the network setup, such as adding or removing hardware components. As we are dealing with high network throughput requirements between multiple systems (to and from Boost, between the PC1 and PC2 workers and from PC2 to lotus-miner) it is worth learning to work with [`iperf` and `iperf3`arrow-up-right](https://iperf.fr/) , which allow for easy network benchmarking. As a storage provider, you also need to make trade-offs between performance and cost. Higher bandwidth networks typically offer better performance but come with a higher cost. Therefore, you need to perform calculations to determine whether investing in a higher bandwidth network is worth the cost. **For example**, if your storage provider setup requires high network throughput, but your budget is limited, you may need to prioritize certain network components, such as switches and network cards, over others. By analyzing the performance impact of each component and comparing it to the cost, you can make informed decisions about which components to invest in. **In summary**, performance is a critical aspect of a storage provider setup, particularly when dealing with high network throughput requirements. Network benchmarking tools such as iperf and iperf3 can help identify potential performance issues and optimize the network setup. To make informed decisions about the network setup, you also need to make trade-offs between performance and cost by analyzing the impact of each component and comparing it to the cost. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills/network) [PreviousLinuxchevron-left](https://docs.filecoin.io/storage-providers/skills/linux) [NextSecuritychevron-right](https://docs.filecoin.io/storage-providers/skills/security) Last updated 1 year ago * [Network infrastructure](https://docs.filecoin.io/storage-providers/skills/network#network-infrastructure) * [Performance](https://docs.filecoin.io/storage-providers/skills/network#performance) sun-brightdesktopmoon sun-brightdesktopmoon --- # Node providers | Filecoin Docs Nodes are essential components of the Filecoin network. They maintain copies of the blockchain’s entire transaction history and verify the validity of new transactions and blocks. Running a node requires significant computational resources and storage capacity, which can be demanding for individual developers or teams. ### [hashtag](https://docs.filecoin.io/nodes/full-nodes/node-providers#benefits) Benefits Remote node providers address this challenge by hosting and maintaining Filecoin nodes on behalf of their clients. By utilizing a remote node provider, developers can access blockchain data, submit transactions, and query the network without the need to synchronize the entire blockchain or manage the infrastructure themselves. This offers convenience and scalability, particularly for applications or services that require frequent and real-time access to blockchain data. Remote node providers typically offer APIs or other communication protocols to facilitate seamless integration with their hosted nodes. These APIs allow developers to interact with the Filecoin network, retrieve data, and execute transactions programmatically. ### [hashtag](https://docs.filecoin.io/nodes/full-nodes/node-providers#potential-drawbacks) Potential drawbacks It’s important to note that when using a remote node provider, developers are relying on the provider’s infrastructure and trustworthiness. You should carefully choose a reliable and secure provider to ensure the integrity and privacy of their interactions with the blockchain network. Node providers often limit the specifications of the nodes that they offer. Some developers may need particularly speedy nodes or nodes that contain the entire history of the blockchain (which can be incredibly expensive to store). ### [hashtag](https://docs.filecoin.io/nodes/full-nodes/node-providers#node-providers) Node providers There are multiple node providers for the Filecoin mainnet and each of the testnets. Checkout the [Networks sectionarrow-up-right](https://docs.filecoin.io/nodes/full-nodes/node-providers/) for details. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/full-nodes/node-providers) [PreviousBasic setupchevron-left](https://docs.filecoin.io/nodes/full-nodes/basic-setup) [NextLite-nodeschevron-right](https://docs.filecoin.io/nodes/lite-nodes) Last updated 1 year ago * [Benefits](https://docs.filecoin.io/nodes/full-nodes/node-providers#benefits) * [Potential drawbacks](https://docs.filecoin.io/nodes/full-nodes/node-providers#potential-drawbacks) * [Node providers](https://docs.filecoin.io/nodes/full-nodes/node-providers#node-providers) sun-brightdesktopmoon sun-brightdesktopmoon --- # Architecture | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture) [PreviousReturn-on-investmentchevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/return-on-investment) [NextSoftware componentschevron-right](https://docs.filecoin.io/storage-providers/architecture/lotus-components) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Sealing pipeline | Filecoin Docs Each step in the sealing process has different performance considerations, and fine-tuning is required to align the different steps optimally. For example, storage providers that don’t understand the process expected throughput may end up overloading the sealing pipeline by trying to seal too many sectors at once or taking on a dataset that is too large for available infrastructure. This can lead to a slower _sealing rate_, which is discussed in greater detail in [Sealing Rate](https://docs.filecoin.io/storage-providers/architecture/sealing-rate) . [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#overview) Overview ---------------------------------------------------------------------------------------------------------- The sealing pipeline can be broken into the following steps: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-793d48b8a4dc504d42c14b1a294f1bc8781f5eea%252Fstorage-provider-architecture-sealing-pipeline-tasks.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=acef801e&sv=2) ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#addpiece) AddPiece The sealing pipeline begins with _AddPiece_ (AP), where the pipeline takes a _Piece_ and prepares it into the sealing scratch space for the _PreCommit 1_ task (PC1) to take over. In Filecoin, a _Piece_ is data in CAR-file format produced by an [IPLD DAGarrow-up-right](https://ipld.io/) with a corresponding `PayloadCID` and `PieceCID`. The maximum Piece size is equal to the sector size, which is either 32 GiB or 64 GiB. If the content is larger than the sector size, it must be split into more than one `PieceCID` during data preparation. The AddPiece process is only uses some CPU cores; it doesn’t require the use of a GPU. It does write a lot of data on the sealing volume though. Therefore it is recommended to limit the concurrent AP processes to 1 or 2 via the environment variable `AP_32G_MAX_CONCURRENT=1`. It is typically co-located on a server with other worker processes from the sealing pipeline. As PC1 is the next process in the sealing pipeline, running AddPiece on the same server as the PC1 process is a logical architecture configuration. Consider limiting the AP process to a few cores by using the [`taskset` commandarrow-up-right](https://man7.org/linux/man-pages/man1/taskset.1.html) , where `` is the range on which cores the process needs to run on: ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#precommit-1) PreCommit 1 PreCommit 1 (PC1) is the most CPU intensive process of the entire sealing pipeline. PC1 is the step in which a sector, regardless of whether it contains data or not, is cryptographically secured. The worker process loads cryptographic parameters from a cache location, which should be stored on enterprise NVMe for latency reduction. These parameters are then used to run Proof-of-Replication (PoRep) SDR encoding against the sector that was put into the sealing scratch space. This task is single-threaded and very CPU intensive, so it requires a CPU with SHA256 extensions. Typical CPUs that meet this requirement include the AMD Epyc Milan/Rome or an Intel Xeon Ice Lake with 32 cores or more. Using the scratch space, the PC1 task will create 11 layers of the sector. Storage providers must host scratch space for this on enterprise NVMe. This means that: * Every sector consumes memory equal to 1+11 times its size on the scratch volume. * For a 32 GiB sector, PC1 requires 384 GiB on the scratch volume * For a 64 GiB sector, PC1 requires 768 GiB. In order to seal at a decent rate and to make use of all the sealing capacity in a PC1 server, you will maximize the concurrent PC1 jobs on a system. Set the `PC1_32G_MAX_CONCURRENT=` environment variable for the PC1 worker. You can learn more about this in the chapter on [Sealing Rate](https://docs.filecoin.io/storage-providers/architecture/sealing-rate) . Sealing several sectors multiplies the requirements on CPU cores, RAM, and scratch space by the number of sectors being sealed in parallel. The process of sealing a single 32 GiB sector takes roughly **3 hours** but that time depends largely on your hardware and what other jobs are running on that hardware. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#precommit-2) PreCommit 2 When PC1 has completed on a given sector, the entire scratch space for that sector is moved over to the _PreCommit 2 (PC2)_ task. This task is typically executed on a different server than the PC1 server because it behaves differently. In short, PC2 validates PC1 using the Poseidon hashing algorithm over the Merkle Tree DAG that was created in PC1. As mentioned in the previous section, the entire scratch space is either 384 GiB or 768 GiB, depending on the sector size. Where PC1 is CPU-intensive, PC2 is executed on GPU. This task is also notably shorter in duration than PC1, typically 10 to 20 minutes on a capable GPU. This requires a GPU with at least 10 GiB of memory and 3500+ CUDA cores or shading units, in the case of Nvidia. Storage providers can use slower GPUs, but this may create a bottleneck in the sealing pipeline. For best performance, compile Lotus with CUDA support instead of OpenCL. For further information, see the Lotus [CUDA Setuparrow-up-right](https://lotus.filecoin.io/tutorials/lotus-miner/cuda/) . In the case of a [Snap Deal](https://docs.filecoin.io/storage-providers/filecoin-deals/snap-deals) , an existing committed capacity sector is filled with data. When this happens, the entire PC1 task does not run again; however, the snapping process employs PC1’s `replica-update` and `prove-replica-update` to add the data to the sector. This can run on the PC2 worker or on a separate worker depending on your sealing pipeline capacity. When PC2 has completed for a sector, a _precommit_ message is posted on-chain. If batching is configured, Lotus will batch these messages to avoid sending messages to the chain for every single sector. In addition, there is a configurable timeout interval, after which the message will be sent on-chain. This timeout is set to 24 hours by default. These configuration parameters are found in the `.lotusminer/config.toml` file. If you want to force the pre-commit message on-chain for testing purposes, run: The sealed sector and its 11 layers are kept on the scratch volume until Commit 2 (C2) is complete. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#waitseed) WaitSeed WaitSeed is not an actual task that is executed, but it is a step in the pipeline in which the blockchain forces the pipeline to wait for 150 epochs as a built-in security mechanism. With Filecoin’s 30 second epochs, this means 75 minutes must elapse between PC2 and the next task, Commit 1 (C1). ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#commit-1) Commit 1 The Commit 1 (C1) phase is an intermediate phase that performs the preparation necessary to generate a proof. It is CPU-bound and typically completes in seconds. It is recommended that storage providers run this process on the server where C2 is running. ### [hashtag](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#commit-2) Commit 2 The last and final step in the sealing pipeline is Commit 2 (C2). This step involves the creation of zk-SNARK proof. Like PC2, this task is GPU-bound and is, therefore, best co-located with the PC2 task. Finally, the proof is committed on-chain in a message. As with the pre-commit messages, the commit messages are batched and held for 24 hours by default before committing on-chain to avoid sending messages for each and every sector. You can again avoid batching by running: Finally, the sealed sector is stored in the miner’s long-term storage space, along with unsealed sectors, which are required for retrievals if configured to do so. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) [PreviousStorage provider automationchevron-left](https://docs.filecoin.io/storage-providers/architecture/lotus-automation) [NextSealing ratechevron-right](https://docs.filecoin.io/storage-providers/architecture/sealing-rate) Last updated 1 year ago * [Overview](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#overview) * [AddPiece](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#addpiece) * [PreCommit 1](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#precommit-1) * [PreCommit 2](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#precommit-2) * [WaitSeed](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#waitseed) * [Commit 1](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#commit-1) * [Commit 2](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline#commit-2) sun-brightdesktopmoon Copy taskset -c lotus-worker run ... Copy lotus-miner sectors batching precommit --publish-now Copy lotus-miner sectors batching commit --publish-now sun-brightdesktopmoon --- # Ways to contribute | Filecoin Docs ### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#ways-to-contribute) Ways to contribute #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#code) Code Filecoin and its sister-projects are big, with lots of code written in multiple languages. We always need help writing and maintaining code, but it can be daunting to just jump in. We use the label _Help Wanted_ on features or bug fixes that people can help out with. They are an excellent place for you to start contributing code. The biggest and most active repositories we have today are: * [`filecoin-project/venus`arrow-up-right](https://github.com/filecoin-project/venus) * [`filecoin-project/lotus`arrow-up-right](https://github.com/filecoin-project/lotus) * [`filecoin-project/rust-fil-proofs`arrow-up-right](https://github.com/filecoin-project/rust-fil-proofs) If you want to start contributing to the core of Filecoin, those repositories are a great place start. But the _Help Wanted_ label exists in several related projects: * [IPFSarrow-up-right](https://github.com/ipfs) * [libp2parrow-up-right](https://github.com/libp2p) * [IPLDarrow-up-right](https://github.com/libp2p) * [Multiformatsarrow-up-right](https://github.com/multiformats) #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#documentation) Documentation Filecoin is a huge project and undertaking, and with lots of code comes the need for lots of good documentation! However, we need a lot more help to write the awesome docs the project needs. If writing technical documentation is your area, any and all help is welcome! Before contributing to the Filecoin docs, please read these quick guides; they’ll save you time and help keep the docs accurate and consistent! 1. [Style and formatting guide](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#style) 2. [Writing guide](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#writing-guide) If you have never contributed to an open-source project before, or just need a refresher, take a look at the [contribution tutorial](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#contribution-tutorial) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#community) Community If interacting with people is your favorite thing to do in this world, join the [Filecoin chat and discussion forums](https://docs.filecoin.io/basics/project-and-community/forums-and-fips) to say hello, meet others who share your goals, and connect with other members of the community. You should also consider joining [Filecoin Slackarrow-up-right](https://filecoin.io/slack) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#build-applications) Build Applications Filecoin is designed for you to integrate into your own applications and services. Get started by looking at the list of projects currently built on Filecoin. Build anything you think is missing! If you’re unsure about something, you can join the chat and discussion forums to get help or feedback on your specific problem/idea. You can also join a Filecoin Hackathon, apply for a Filecoin Developer Grant or apply to the Filecoin accelerator program to support the development of your project. * [Filecoin Hackathonsarrow-up-right](https://hackathons.filecoin.io/) * [Filecoin Developer Grantsarrow-up-right](https://filecoin.io/grants/) * [Filecoin Accelerator Programarrow-up-right](https://ecosystem-wg.notion.site/Protocol-Labs-Accelerator-Program-d45d8792a7d544eca9beb7d3e3d3b05d) #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#protocol-design) Protocol Design Filecoin is ultimately about building better protocols, and the community always welcome ideas and feedback on how to improve those protocols. * [`filecoin-project/specs`arrow-up-right](https://github.com/filecoin-project/specs) #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#research) Research Finally, we see Protocol Labs as a research lab, where YOUR ideas can become technologies that have a real impact on the world. If you’re interested in contributing to our research, please reach out to [\[email protected\]envelope](https://docs.filecoin.io/cdn-cgi/l/email-protection#5123342234302332391121233e253e323e3d7f3038) for more information. Include what your interests are so we can make sure you get to work on something fun and valuable. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#writing-guide) Writing guide This guide explains things to keep in mind when writing for Filecoin’s documentation. While the [grammar, formatting, and style guide](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#style) lets you know the rules you should follow, this guide will help you to properly structure your writing and choose the correct tone for your audience. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#walkthroughs) Walkthroughs The purpose of a walkthrough is to tell the user _how_ to do something. They do not need to convince the reader of something or explain a concept. Walkthroughs are a list of steps the reader must follow to achieve a process or function. The vast majority of documentation within the Filecoin documentation project falls under the _Walkthrough_ category. Walkthroughs are generally quite short, have a neutral tone, and teach the reader how to achieve a particular process or function. They present the reader with concrete steps on where to go, what to type, and things they should click on. There is little to no _conceptual_ information within walkthroughs. **Goals** Use the following goals when writing walkthroughs: Goal Keyword Explanation **Audience** _General_ Easy for anyone to read with minimal effort. **Formality** _Neutral_ Slang is restricted, but standard casual expressions are allowed. **Domain** _Technical_ Acronyms and tech-specific language is used and expected. **Tone** _Neutral_ Writing contains little to no emotion. **Intent** _Instruct_ Tell the reader _how_ to do something. **Function or process** The end goal of a walkthrough is for the reader to achieve a very particular function. _Installing the Filecoin Desktop application_ is an example. Following this walkthrough isn’t going to teach the reader much about working with the decentralized web or what Filecoin is. Still, by the end, they’ll have the Filecoin Desktop application installed on their computer. **Short length** Since walkthroughs cover one particular function or process, they tend to be quite short. The estimated reading time of a walkthrough is somewhere between 2 and 10 minutes. Most of the time, the most critical content in a walkthrough is presented in a numbered list. Images and GIFs can help the reader understand what they should be doing. If a walkthrough is converted into a video, that video should be no longer than 5 minutes. **Walkthrough structure** Walkthroughs are split into three major sections: 1. What we’re about to do. 2. The steps we need to do. 3. Summary of what we just did, and potential next steps. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#conceptual-articles) Conceptual articles Articles are written with the intent to inform and explain something. These articles don’t contain any steps or actions that the reader has to perform _right now_. These articles are vastly different in tone when compared to walkthroughs. Some topics and concepts can be challenging to understand, so creative writing and interesting diagrams are highly sought-after for these articles. Whatever writers can do to make a subject more understandable, the better. **Article goals** Use the following goals when writing conceptual articles: Goal Keyword Explanation **Audience** _Knowledgeable_ Requires a certain amount of focus to understand. **Formality** _Neutral_ Slang is restricted, but standard casual expressions are allowed. **Domain** _Any_ Usually _technical_, but depends on the article. **Tone** _Confident and friendly_ The reader must feel confident that the writer knows what they’re talking about. **Intent** _Describe_ Tell the reader _why_ something does the thing that it does, or why it exists. **Article structure** Articles are separated into five major sections: 1. Introduction to the thing we’re about to explain. 2. What the thing is. 3. Why it’s essential. 4. What other topics it relates to. 5. Summary review of what we just read. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#tutorials) Tutorials When writing a tutorial, you’re teaching a reader how to achieve a complex end-goal. Tutorials are a mix of walkthroughs and conceptual articles. Most tutorials will span several pages, and contain multiple walkthroughs within them. Take the hypothetical tutorial _Get up and running with Filecoin_, for example. This tutorial will likely have the following pages: 1. A brief introduction to what Filecoin is. 2. Choose and install a command line client. 3. Understanding storage deals. 4. Import and store a file. Pages `1` and `3` are conceptual articles, describing particular design patterns and ideas to the reader. All the other pages are walkthroughs instructing the user how to perform one specific action. When designing a tutorial, keep in mind the walkthroughs and articles that already exist, and note down any additional content items that would need to be completed before creating the tutorial. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#grammar-and-formatting) Grammar and formatting Here are some language-specific rules that the Filecoin documentation follows. If you use a writing service like [Grammarlyarrow-up-right](https://www.grammarly.com/) , most of these rules are turned on by default. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#american-english) American English While Filecoin is a global project, the fact is that American English is the most commonly used _style_ of English used today. With that in mind, when writing content for the Filecoin project, use American English spelling. The basic rules for converting other styles of English into American English are: 1. Swap the `s` for a `z` in words like _categorize_ and _pluralize_. 2. Remove the `u` from words like _color_ and _honor_. 3. Swap `tre` for `ter` in words like _center_. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#the-oxford-comma) The Oxford comma In a list of three or more items, follow each item except the last with a comma `,`: Use Don’t use One, two, three, and four. One, two, three and four. Henry, Elizabeth, and George. Henry, Elizabeth and George. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#references-to-filecoin) References to Filecoin As a proper noun, the name “Filecoin” (capitalized) should be used only to refer to the overarching project, to the protocol, or to the project’s canonical network: > Filecoin \[the project\] has attracted contributors from around the globe! Filecoin \[the protocol\] rewards contributions of data storage instead of computation! Filecoin \[the network\] is currently storing 50 PiB of data! The name can also be used as an adjective: > The Filecoin ecosystem is thriving! I love contributing to Filecoin documentation! When referring to the token used as Filecoin’s currency, the name `FIL`, is preferred. It is alternatively denoted by the Unicode symbol for an integral with a double stroke ⨎: * Unit prefix: **100 FIL**. * Symbol prefix: **⨎ 100**. The smallest and most common denomination of FIL is the `attoFIL` (10^-18 FIL). > The collateral for this storage deal is 5 FIL. I generated ⨎100 as a storage provider last month! Examples of discouraged usage: > Filecoin rewards storage providers with Filecoin. There are many ways to participate in the filecoin community. My wallet has thirty filecoins. Consistency in the usage of these terms helps keep these various concepts distinct. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#references-to-lotus) References to Lotus Lotus is the main implementation of Filecoin. As such, it is frequently referenced in the Filecoin documentation. When referring to the Lotus implementation, use a capital _L_. A lowercase _l_ should only be used when referring to the Lotus executable commands such as `lotus daemon`. Lotus executable commands should always be within code blocks: #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#acronyms) Acronyms If you have to use an acronym, spell the full phrase first and include the acronym in parentheses `()` the first time it is used in each document. Exception: This generally isn’t necessary for commonly-encountered acronyms like _IPFS_, unless writing for a stand-alone article that may not be presented alongside project documentation. > Virtual Machine (VM), Decentralized Web (DWeb). ### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#formatting) Formatting How the Markdown syntax looks, and code formatting rules to follow. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#syntax) Syntax The Filecoin Docs project follows the _GitHub Flavoured Markdown_ syntax for markdown. This way, all articles display properly within GitHub itself. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#rules) Rules We use the rules set out in the [VSCode Markdownlintarrow-up-right](https://github.com/DavidAnson/vscode-markdownlint) extension. You can import these rules into any text editor like Vim or Sublime. All rules are listed [within the Markdownlint repositoryarrow-up-right](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md) . We highly recommend installing [VSCodearrow-up-right](https://code.visualstudio.com/) with the [Markdownlintarrow-up-right](https://github.com/DavidAnson/vscode-markdownlint) extension to help with your writing. The extension shows warnings within your markdown whenever your copy doesn’t conform to a rule. ### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#style) Style The following rules explain how we organize and structure our writing. The rules outlined here are in addition to the [rulesarrow-up-right](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md) found within the [Markdownlinter extensionarrow-up-right](https://github.com/DavidAnson/vscode-markdownlint) . #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#text) Text The following rules apply to editing and styling text. **Titles** 1. All titles follow sentence structure. Only _names_ and _places_ are capitalized, along with the first letter of the title. All other letters are lower-case: 1. Every article starts with a _front-matter_ title and description: In the above example `title:` serves as a `

` or `#` tag. There is only ever one title of this level in each article. 1. Titles do not contain punctuation. If you have a question within your title, rephrase it as a statement: **Bold text** Double asterisks `**` are used to define **boldface** text. Use bold text when the reader must interact with something displayed as text: buttons, hyperlinks, images with text in them, window names, and icons. **Italics** Underscores `_` are used to define _italic_ text. Style the names of things in italics, except input fields or buttons: Quotes or sections of quoted text are styled in italics and surrounded by double quotes `"`: **Code blocks** Tag code blocks with the syntax of the core they are presenting: Output from command-line actions can be displayed by adding another codeblock directly after the input codeblock. Here’s an example telling the use to run `go version` and then the output of that command in a separate codeblock immediately after the first: Command-line examples can be truncated with three periods `...` to remove extraneous information: **Inline code tags** Surround directories, file names, and version numbers between inline code tags `` ` ``. **List items** All list items follow sentence structure. Only _names_ and _places_ are capitalized, along with the first letter of the list item. All other letters are lowercase: 1. Never leave Nottingham without a sandwich. 2. Brian May played guitar for Queen. 3. Oranges. List items end with a period `.`, or a colon `:` if the list item has a sub-list: 1. Charles Dickens novels: 1. Oliver Twist. 2. Nicholas Nickelby. 3. David Copperfield. 2. J.R.R Tolkien non-fiction books: 1. The Hobbit. 2. Silmarillion. 3. Letters from Father Christmas. **Unordered lists** Use the dash character `-` for un-numbered list items: **Special characters** Whenever possible, spell out the name of the special character, followed by an example of the character itself within a code block. **Keyboard shortcuts** When instructing the reader to use a keyboard shortcut, surround individual keys in code tags: The plus symbol `+` stays outside of the code tags. #### [hashtag](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#images) Images The following rules and guidelines define how to use and store images. **Alt text** All images contain alt text so that screen-reading programs can describe the image to users with limited sight: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/basics/project-and-community/ways-to-contribute) [PreviousThe Filecoin projectchevron-left](https://docs.filecoin.io/basics/project-and-community/the-filecoin-project) [NextBasicschevron-right](https://docs.filecoin.io/storage-providers/basics) Last updated 1 year ago * [Ways to contribute](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#ways-to-contribute) * [Writing guide](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#writing-guide) * [Grammar and formatting](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#grammar-and-formatting) * [Formatting](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#formatting) * [Style](https://docs.filecoin.io/basics/project-and-community/ways-to-contribute#style) sun-brightdesktopmoon Copy 1. Start the Lotus daemon: ```shell lotus daemon ``` 2. After your Lotus daemon has been running for a few minutes, use `lotus` to check the number of other peers that it is connected to in the Filecoin network: ```shell lotus net peers ``` Copy ## This is a title ### Only capitalize names and places ### The capital city of France is Paris Copy --- title: Example article description: This is a brief description that shows up in link teasers in services like Twitter and Slack. --- ## This is a subtitle Example body text. Copy ## What is Filecoin? ## Filecoin explained Copy In the **Login** window, enter your email into the **Username** field and click **Sign in**. Copy Here are some American things: - The _Spirit of St Louis_. - The _White House_. - The United States _Declaration of Independence_. Try entering them into the **American** field and clicking **Accept**. Copy In the wise words of Winnie the Pooh _"People say nothing is impossible, but I do nothing every day."_ Copy ```javascript console.log(error); ``` Copy ```shell go version ``` ```plaintext go version go1.19.7 darwin/arm64 ``` Copy ```shell lotus-miner info ``` ```shell Miner: t0103 Sector Size: 16.0 MiB ... Sectors: map[Committing:0 Proving:0 Total:0] ``` Copy Version `1.2.0` of the program is stored in `~/code/examples`. Open `exporter.exe` to run the program. Copy - An apple. - Three oranges. - As many lemons as you can carry. - Half a lime. Copy Use the dollar sign `$` to enter debug-mode. Copy Press `ctrl` + `c` to copy the highlighted text. Copy ![Screenshot of an image being uploaded through the Filecoin command line.](filecoin-image-upload-screen.png) sun-brightdesktopmoon --- # Security | Filecoin Docs Being a Filecoin storage provider involves more than just storing customer data. You are also responsible for managing Filecoin wallets and running systems that require 24/7 uptime to avoid losing collateral. This means that if your network or systems are compromised due to a security intrusion, you risk experiencing downtime or even losing access to your systems and storage. Therefore, maintaining proper security is of utmost importance. As a storage provider, you must have the necessary skills and expertise to identify and mitigate potential security threats. This includes understanding common attack vectors such as phishing, malware, and social engineering. On top of that, you must be proficient at implementing appropriate security controls such as firewalls, intrusion detection and prevention systems, and access controls. Additionally, you must also be able to keep up with the latest security trends and technologies to ensure that your systems remain secure over time. This can involve ongoing training and education, as well as staying informed about new threats and vulnerabilities. In summary, as a Filecoin storage provider, you have a responsibility to ensure the security of your customer’s data, your own systems, and the Filecoin network as a whole. This requires a thorough understanding of security best practices, ongoing training and education, and a commitment to staying informed about the latest security trends and technologies. [hashtag](https://docs.filecoin.io/storage-providers/skills/security#network-security) Network security ------------------------------------------------------------------------------------------------------------ When it comes to network security, it is important to have a solid first line of defense in place. One effective strategy is to implement a redundant firewall setup that can filter incoming traffic as well as traffic between your VLANs. A next-generation firewall (NGFW) can provide even more robust security by incorporating an intrusion prevention system (IPS) at the network perimeter. This can help to detect and prevent potential threats before they can do any harm. However, it is important to note that implementing a NGFW with IPS enabled can also have an impact on your internet bandwidth. This is because the IPS will inspect all incoming and outgoing traffic, which can slow down your network performance. As such, it is important to carefully consider your bandwidth requirements and plan accordingly. [hashtag](https://docs.filecoin.io/storage-providers/skills/security#system-security) System security ---------------------------------------------------------------------------------------------------------- A second layer of defense is system security. There are multiple concepts that contribute to good system security: * Host-based firewall (UFW) Implement a host-based firewall on your systems (also called UFW on Ubuntu), which is `iptables` based. * SELinux Linux comes with an additional security implementation called `SELinux` (Security Enhanced Linux). Most system administrators will not implement this by default because it takes additional consideration and administration. Once activated though it offers the highest grade of process and user isolation possible on Linux and contributes greatly to better security. * Not running as root It is a common mistake to run processes or containers as `root`. This is a serious security risk because any attacker who compromises a service running as root automatically obtains root privileges on that system. Lotus software does not require root privileges and therefore should run under a normal account (such as a service account, for instance called `lotus`) on the system. * Privilege escalation Since it is not required that Lotus runs as root, it is also not required for the service account to have privilege escalation. This means you should not allow the `lotus` account to use `sudo`. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills/security) [PreviousNetworkchevron-left](https://docs.filecoin.io/storage-providers/skills/network) [NextStoragechevron-right](https://docs.filecoin.io/storage-providers/skills/storage) Last updated 1 year ago * [Network security](https://docs.filecoin.io/storage-providers/skills/security#network-security) * [System security](https://docs.filecoin.io/storage-providers/skills/security#system-security) sun-brightdesktopmoon sun-brightdesktopmoon --- # Explorers | Filecoin Docs [hashtag](https://docs.filecoin.io/networks/calibration/explorers#beryx) Beryx ----------------------------------------------------------------------------------- https://beryx.zondax.ch [hashtag](https://docs.filecoin.io/networks/calibration/explorers#filfox) FILFOX ------------------------------------------------------------------------------------- https://calibration.filfox.info [hashtag](https://docs.filecoin.io/networks/calibration/explorers#filscan) Filscan --------------------------------------------------------------------------------------- https://calibration.filscan.io/ [hashtag](https://docs.filecoin.io/networks/calibration/explorers#blockscout-open-source-fevm-explorer) Blockscout Open-Source FEVM Explorer ------------------------------------------------------------------------------------------------------------------------------------------------- https://filecoin-testnet.blockscout.com [hashtag](https://docs.filecoin.io/networks/calibration/explorers#starboard) Starboard ------------------------------------------------------------------------------------------- https://fvm.starboard.ventures/ [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/calibration/explorers) [PreviousCalibrationchevron-left](https://docs.filecoin.io/networks/calibration) [NextRPCschevron-right](https://docs.filecoin.io/networks/calibration/rpcs) Last updated 6 months ago * [Beryx](https://docs.filecoin.io/networks/calibration/explorers#beryx) * [FILFOX](https://docs.filecoin.io/networks/calibration/explorers#filfox) * [Filscan](https://docs.filecoin.io/networks/calibration/explorers#filscan) * [Blockscout Open-Source FEVM Explorer](https://docs.filecoin.io/networks/calibration/explorers#blockscout-open-source-fevm-explorer) * [Starboard](https://docs.filecoin.io/networks/calibration/explorers#starboard) sun-brightdesktopmoon sun-brightdesktopmoon --- # Lite-nodes | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/lite-nodes) [PreviousNode providerschevron-left](https://docs.filecoin.io/nodes/full-nodes/node-providers) [NextSpin up a lite-nodechevron-right](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Basic setup | Filecoin Docs To install Lotus on your computer, follow these steps: 1. First, you need to download the appropriate binary file for your operating system. Go to the [official Lotus GitHub repositoryarrow-up-right](https://github.com/filecoin-project/lotus) and select the latest release that is compatible with your system. You can choose from Windows, macOS, and Linux distributions. 2. Once you have downloaded the binary file, extract the contents to a directory of your choice. For example, if you are using Linux, you can extract the contents to the `/usr/local/bin directory` by running the command: Copy sudo tar -C /usr/local/bin -xzf lotus-1.34.1-linux-amd64.tar.gz 1. After extracting the contents, navigate to the `lotus` directory in your terminal. For example, if you extracted the contents to `/usr/local/bin`, you can navigate to the lotus directory by running the command: Copy cd /usr/local/bin/lotus-1.34.1 1. Run the `lotus` binary file to start the Lotus daemon. You can do this by running the command: Copy ./lotus daemon 1. This will start the Lotus daemon, which will connect to the Filecoin network and start synchronizing with other nodes on the network. 2. Optionally, you can also run the lotus-miner binary file if you want to participate in the Filecoin mining process. You can do this by running the command: Copy ./lotus-miner run 1. This will start the Lotus miner, which will use your computer’s computing power to mine new blocks on the Filecoin network. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/full-nodes/basic-setup) [PreviousPre-requisiteschevron-left](https://docs.filecoin.io/nodes/full-nodes/pre-requisites) [NextNode providerschevron-right](https://docs.filecoin.io/nodes/full-nodes/node-providers) Last updated 6 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin EVM-runtime | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime) [PreviousFAQschevron-left](https://docs.filecoin.io/smart-contracts/fundamentals/faqs) [NextActor typeschevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Support | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/support#slack) Slack ----------------------------------------------------------------------------------------- Like many other distributed teams, the Filecoin developer relations, lead by the [FIL Buildersarrow-up-right](https://fil.builders/) team, works mostly on Slack and Discord. You can join the Filecoin Project Slack for free by going to [`filecoin.io/slack`arrow-up-right](https://filecoin.io/slack) and the Discord by going to [https://discord.com/invite/filecoinarrow-up-right](https://discord.com/invite/filecoin) . The following Slack channels are most relevant for Filecoin builders: * [`#fil-builders`arrow-up-right](https://filecoinproject.slack.com/archives/CRK2LKYHW) for building solutions on FVM and Filecoin * [`#fil-fvm-dev`arrow-up-right](https://filecoinproject.slack.com/archives/C029MT4PQB1) for development of the FVM * [`#fvm-docs`arrow-up-right](https://filecoinproject.slack.com/archives/C03MDFERKMJ) for FVM documentation [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/support#forum) Forum ----------------------------------------------------------------------------------------- If you just need a general pointer or looking for technical FAQs, you can head over to the [FVM GitHub Discussion tabarrow-up-right](https://github.com/filecoin-project/community/discussions/categories/developers) . [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/support#developer-grants) Developer grants --------------------------------------------------------------------------------------------------------------- The [Filecoin Grant Platformarrow-up-right](https://github.com/filecoin-project/devgrants) connects grant makers with builders and researchers in the Filecoin community. Whether you represent a foundation that wants to move the space forward, a company looking to accelerate development on the features your application needs, or a developer team itching to hack on the FVM, [take a look at the supported grant types and available opportunities →arrow-up-right](https://github.com/filecoin-project/devgrants) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/support) [PreviousRoadmapchevron-left](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap) [NextFAQschevron-right](https://docs.filecoin.io/smart-contracts/fundamentals/faqs) Last updated 10 months ago * [Slack](https://docs.filecoin.io/smart-contracts/fundamentals/support#slack) * [Forum](https://docs.filecoin.io/smart-contracts/fundamentals/support#forum) * [Developer grants](https://docs.filecoin.io/smart-contracts/fundamentals/support#developer-grants) sun-brightdesktopmoon sun-brightdesktopmoon --- # Storage | Filecoin Docs Storage is a critical component of running a successful storage provider in the Filecoin network. While it may seem obvious that having strong storage skills is important, Filecoin requires a unique end-to-end skill set to run a 24/7 application. [Storage proving](https://docs.filecoin.io/storage-providers/filecoin-economics/storage-proving) requires atypical read-behavior from a storage system. This means that the storage administrator must be able to design for this behavior and analyze the storage system accordingly. In addition, it is important for storage providers to understand the importance of reliable and efficient storage. Filecoin is designed to incentivize storage providers to keep data safe and secure, and as such, the storage system must be able to maintain high levels of reliability and availability. Storage providers need to be able to implement and maintain storage infrastructure that meets the needs of clients who require large amounts of storage space. This requires knowledge of various storage technologies, as well as the ability to troubleshoot issues that may arise. Overall, storage is a critical aspect of the Filecoin network and storage providers must have the necessary skills and knowledge to provide high-quality storage services to clients. [hashtag](https://docs.filecoin.io/storage-providers/skills/storage#zfs) ZFS --------------------------------------------------------------------------------- Zettabyte File System (ZFS) is a combined file system and logical volume manager that provides advanced features such as pooled storage, data integrity verification and automatic repair, and data compression. It is a popular choice among storage providers due to its reliability, scalability, and performance. Configuring ZFS requires knowledge and skills that go beyond the basics of traditional file systems. As a storage provider you need to understand how ZFS manages data, including how it distributes data across disks and how it handles data redundancy and data protection. You must also know how to configure ZFS for optimal performance and how to troubleshoot issues that may arise with ZFS. In addition to configuring ZFS, storage providers must also be able to manage the disks and other hardware used for storage. This includes selecting and purchasing appropriate hardware, installing and configuring disks and disk controllers, and monitoring disk health and performance. Having the knowledge and skills to configure ZFS is crucial as a storage providers, as it enables you to provide reliable and high-performance storage services to your clients. Without this expertise, you may struggle to deliver the level of service that your clients expect, which could lead to decreased customer satisfaction and loss of business. ### [hashtag](https://docs.filecoin.io/storage-providers/skills/storage#raidz2) RAIDZ2 ZFS is a combined file system and volume manager, designed to work efficiently on large-scale storage systems. One of the unique features of ZFS is its built-in support for various types of RAID configurations, which makes it an ideal choice for data storage in a Filecoin network. As a storage provider, it is crucial to have knowledge and skills in configuring ZFS. This includes understanding how to create virtual devices (VDEVs), which are the building blocks of ZFS storage pools. A VDEV can be thought of as a group of physical devices, such as hard disks, solid-state drives, or even virtual disks, that are used to store data. In addition, storage providers must also understand how wide VDEVs should ideally be, and how to create storage pools with a specific RAID protection level. RAID is a method of protecting data by distributing it across multiple disks in a way that allows for redundancy and fault tolerance. ZFS has its own types of RAID, known as RAID-Z, which come in different levels of protection. For example, `RAIDZ2` is a configuration that provides double parity, meaning that two disks can fail simultaneously without data loss. As a storage provider, it is important to understand how to create storage pools with the appropriate level of RAID protection to ensure data durability. Finally, creating datasets is another important aspect of ZFS configuration. Datasets are logical partitions within a ZFS storage pool that can have their own settings and attributes, such as compression, encryption, and quota. As a storage provider, it is necessary to understand how to create datasets to effectively manage storage and optimize performance. ### [hashtag](https://docs.filecoin.io/storage-providers/skills/storage#snapshots-and-replication) Snapshots and replication ZFS provides built-in protection for data in the form of snapshots. Snapshots are read-only copies of a ZFS file system at a particular point in time. By taking regular snapshots, you can protect your data against accidental deletions, file corruption, or other disasters. To ensure that your data is fully protected, it is important to configure a snapshot rotation schema. This means defining a schedule for taking snapshots and retaining them for a specified period of time. For example, you might take hourly snapshots and retain them for 24 hours, and then take daily snapshots and retain them for a week. In addition to snapshots, ZFS also allows you to replicate them to another system running ZFS. This can be useful for creating backups or for replicating data to a remote site for disaster recovery purposes. ZFS replication works by sending incremental changes to the destination system, which ensures that only the changes are sent over the network, rather than the entire dataset. This can significantly reduce the amount of data that needs to be transferred and can help minimize network bandwidth usage. [hashtag](https://docs.filecoin.io/storage-providers/skills/storage#performance-analysis) Performance analysis ------------------------------------------------------------------------------------------------------------------- As a storage provider, it is crucial to be able to troubleshoot and resolve any performance issues that may arise. This requires a deep understanding of the underlying storage system and the ability to use Linux performance analytic tools such as `iostat`. These tools can help identify potential bottlenecks in the storage system, such as high disk utilization or slow response times. In addition to troubleshooting, you must also be able to optimize the performance of your storage system. One way to improve performance is by implementing an NVMe write-cache. NVMe is a protocol designed specifically for solid-state drives, which can greatly improve the speed of write operations. By adding an NVMe write-cache to the storage system, you can reduce the latency of write operations and improve overall system performance. Read-cache on the other hand is typically not useful in the context of Filecoin. This is because sealed sectors are read very randomly, and unsealed sectors will typically not be read twice. Therefore, storing data in a read-cache would be redundant and add unnecessary overhead to the system. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills/storage) [PreviousSecuritychevron-left](https://docs.filecoin.io/storage-providers/skills/security) [NextSaleschevron-right](https://docs.filecoin.io/storage-providers/skills/sales) Last updated 1 year ago * [ZFS](https://docs.filecoin.io/storage-providers/skills/storage#zfs) * [RAIDZ2](https://docs.filecoin.io/storage-providers/skills/storage#raidz2) * [Snapshots and replication](https://docs.filecoin.io/storage-providers/skills/storage#snapshots-and-replication) * [Performance analysis](https://docs.filecoin.io/storage-providers/skills/storage#performance-analysis) sun-brightdesktopmoon sun-brightdesktopmoon --- # Explorers | Filecoin Docs Block explorers allow you to view the details of the Filecoin network on a single website. Individual block explorers contain different features that may be useful. None of these sites are created or maintained by Protocol Labs or the Filecoin Foundation. This list is in alphabetical order: ### [hashtag](https://docs.filecoin.io/networks/mainnet/explorers#beryx) Beryx Website [beryx.zondax.charrow-up-right](https://beryx.zondax.ch/) ### [hashtag](https://docs.filecoin.io/networks/mainnet/explorers#filfox) Filfox Website: [filfox.infoarrow-up-right](https://filfox.info/en/) ### [hashtag](https://docs.filecoin.io/networks/mainnet/explorers#filscan) Filscan Website: [filscan.ioarrow-up-right](https://filscan.io/) ### [hashtag](https://docs.filecoin.io/networks/mainnet/explorers#starboard) Starboard Website: [fvm.starboard.venturesarrow-up-right](https://fvm.starboard.ventures/) ### [hashtag](https://docs.filecoin.io/networks/mainnet/explorers#blockscout-open-source-fevm-explorer) Blockscout Open-Source FEVM Explorer Website: [filecoin.blockscout.comarrow-up-right](https://filecoin.blockscout.com/) [hashtag](https://docs.filecoin.io/networks/mainnet/explorers#api-requests) API requests --------------------------------------------------------------------------------------------- If you have access to a Filecoin node, you can send a JSON-RPC request to get block information. To get the head tipset: Print a block: Print message information: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/mainnet/explorers) [PreviousMainnetchevron-left](https://docs.filecoin.io/networks/mainnet) [NextRPCschevron-right](https://docs.filecoin.io/networks/mainnet/rpcs) Last updated 3 months ago * [Beryx](https://docs.filecoin.io/networks/mainnet/explorers#beryx) * [Filfox](https://docs.filecoin.io/networks/mainnet/explorers#filfox) * [Filscan](https://docs.filecoin.io/networks/mainnet/explorers#filscan) * [Starboard](https://docs.filecoin.io/networks/mainnet/explorers#starboard) * [Blockscout Open-Source FEVM Explorer](https://docs.filecoin.io/networks/mainnet/explorers#blockscout-open-source-fevm-explorer) * [API requests](https://docs.filecoin.io/networks/mainnet/explorers#api-requests) sun-brightdesktopmoon Copy curl --location --request POST 'https://api.node.glif.io/rpc/v1' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":"2.0", "method":"Filecoin.ChainHead", "params": null, "id":1 }' | jq Copy curl --location --request POST 'https://api.node.glif.io/rpc/v1' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":"2.0", "method":"Filecoin.ChainGetBlock", "params": [{"/": "bafy2bzacebpgpa7elb5uwqxbiljlzgbmpenv4yw2e3gpcjk7ssxv2ijv3ecv2"}], "id":1 }' | jq Copy curl --location --request POST 'https://api.node.glif.io/rpc/v1' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":"2.0", "method":"Filecoin.ChainGetMessage", "params": [{"/": "bafy2bzacebpgpa7elb5uwqxbiljlzgbmpenv4yw2e3gpcjk7ssxv2ijv3ecv2"}], "id":1 }' | jq sun-brightdesktopmoon --- # Linux | Filecoin Docs Becoming a storage provider requires a team with a variety of skills. Of all the technical skills needed to run a storage provider business, storage knowledge is important, but arguably, it is even more important to have deep understanding of the Linux operating system. Where most enterprise storage systems (NAS, SAN and other types) do not require the administrator to have hands-on Linux experience, Filecoin does require a lot more knowledge about Linux. For starters, this is because Filecoin is not just a storage system. It is a blockchain platform that offers decentralized storage. As a storage provider, you must ensure that your production system is always available, not just providing the storage. [hashtag](https://docs.filecoin.io/storage-providers/skills/linux#ubuntu-server-lts) Ubuntu Server LTS ----------------------------------------------------------------------------------------------------------- Although Lotus also runs on Mac, production systems generally all run on Linux. More specifically, most storage providers run on Ubuntu. Any Linux distribution should be possible but running Ubuntu makes it easier to find support in the community. Every distribution is a bit different and knowing that all components have been built and tested on Ubuntu, and knowing you have the same OS variables in your environment as someone else, lowers the barrier to starting as a storage provider significantly. Go for Ubuntu Server and choose the latest **LTS** version. Install Ubuntu LTS as a **headless server**. This means there is no desktop environment or GUI installed. It requires you to do everything on the command line. Not having a desktop environment on your server(s) has multiple advantages: * It reduces the attack surface of your systems. Fewer packages installed means fewer patches and updates, but more importantly, fewer potential vulnerabilities. * As you will be running several tasks on GPU (see [Reference Architectures](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures) ), it’s best to avoid running a desktop environment, which might compete for resources on the GPU. Exclude the `nvidia-drivers` and `cuda` packages from your updates using [the appropriate commandarrow-up-right](https://tecadmin.net/exclude-packages-from-apt-upgrade/) set. Once you have a working setup for your specific GPU, you will want to test these packages before you risk breaking them. Many storage providers may need to [install CUDAarrow-up-right](https://linux.how2shout.com/how-to-install-cuda-on-ubuntu-20-04-lts-linux/) since some operating systems do not include this package by default. [hashtag](https://docs.filecoin.io/storage-providers/skills/linux#command-line-and-environment-variables) Command-line and environment variables ----------------------------------------------------------------------------------------------------------------------------------------------------- All installation tasks and operational activities happen from the CLI. When installing and upgrading Lotus, it is recommended to build the binaries from source code. Upgrades to Lotus happen every two months or so. If you are unable to perform a mandatory Lotus upgrade, you may become disconnected from the Filecoin network, which means you could be penalized and lose money, so it’s vital to keep Lotus up-to-date. Configuration parameters for the Lotus client are stored in 2 places: * into `config.toml` files in `~/.lotus`, `~/.lotusminer` and `~/.lotusworker` * into environment variables in `~/.bashrc` if you are using Bash as your shell Configuration parameters, and most environment variables, are covered in the [Lotus documentationarrow-up-right](https://lotus.filecoin.io/storage-providers/setup/configuration/) . More specific environment variables around performance tuning can be found on the [Rust FIL Proofsarrow-up-right](https://github.com/filecoin-project/rust-fil-proofs) repository on GitHub. [hashtag](https://docs.filecoin.io/storage-providers/skills/linux#linux-performance-optimization) Linux performance optimization ------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/storage-providers/skills/linux#scheduler) Scheduler Some storage providers fine-tune their setups by enabling CPU-core-pinning of certain tasks (especially PC1), as a starting storage provider it’s not necessary to do that level of tuning. It is essential, however, to have some level of understanding of the [Linux kernel schedulerarrow-up-right](https://www.kernel.org/doc/html/latest/scheduler/index.html) to know how to prioritize and deprioritize other tasks in the OS. In the case of Lotus workers you certainly want to prioritize the `lotus-worker` process(es). ### [hashtag](https://docs.filecoin.io/storage-providers/skills/linux#configuring-open-file-limits) Configuring open file limits Lotus needs to open a lot of files simultaneously, and it is necessary to reconfigure the OS to support this. This is one of the examples where not every Linux distribution is the same. On Ubuntu, run the following commands: ### [hashtag](https://docs.filecoin.io/storage-providers/skills/linux#performance-analysis) Performance analysis Diagnosing performance bottlenecks on a system is vital to keeping a well balanced [sealing pipeline](https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline) . There are many good resources to check out when it comes to Linux performance troubleshooting. Brendan Gregg’s [Linux performance analysis in 60 secondsarrow-up-right](https://www.brendangregg.com/blog/2015-12-03/linux-perf-60s-video.html) is an excellent introduction. Each one of these commands deserves a chapter on its own but can be further researched in their man pages. The commands used are: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/skills/linux) [PreviousSkillschevron-left](https://docs.filecoin.io/storage-providers/skills) [NextNetworkchevron-right](https://docs.filecoin.io/storage-providers/skills/network) Last updated 8 months ago * [Ubuntu Server LTS](https://docs.filecoin.io/storage-providers/skills/linux#ubuntu-server-lts) * [Command-line and environment variables](https://docs.filecoin.io/storage-providers/skills/linux#command-line-and-environment-variables) * [Linux performance optimization](https://docs.filecoin.io/storage-providers/skills/linux#linux-performance-optimization) * [Scheduler](https://docs.filecoin.io/storage-providers/skills/linux#scheduler) * [Configuring open file limits](https://docs.filecoin.io/storage-providers/skills/linux#configuring-open-file-limits) * [Performance analysis](https://docs.filecoin.io/storage-providers/skills/linux#performance-analysis) sun-brightdesktopmoon Copy sudo echo "* soft nofile 32000000" >> /etc/security/limits.conf sudo echo "* hard nofile 128000000" >> /etc/security/limits.conf sudo echo "fs.nr_open=128000000" >> /etc/sysctl.conf sudo echo "fs.file-max=128000000" >> /etc/sysctl.conf sudo sysctl -p Copy uptime dmesg | tail vmstat 1 mpstat -P ALL 1 pidstat 1 iostat -xz 1 free -m sar -n DEV 1 sar -n TCP,ETCP 1 top sun-brightdesktopmoon --- # Reference architectures | Filecoin Docs [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#id-1-pib-raw-architecture) 1 PiB raw architecture -------------------------------------------------------------------------------------------------------------------------------------------------- ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-97e474db6cd249151ddb4ac07715b19b53092247%252Fstorage-provider-infrastructure-reference-architectures-1PIB.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=bc999a4a&sv=2) 1 PiB raw reference architecture. The following reference architecture is designed for 1 PiB of raw sectors or raw data to be stored. Let’s discuss the various design choices of this architecture. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#virtual-machines) Virtual machines * 32 CPU Cores * 512 GB RAM * 8x 2 TB SSD storage * 2x 10 GbE ethernet NICs Lotus daemon and Boost run as Virtual Machines in this architecture. The advantages of virtualization are well-known, including easy reconfiguration of parameters (CPU, memory, disk) and portability. The daemon is not a very intensive process by itself, but must be available at all times. We recommend having a second daemon running as another VM or on backup infrastructure to which you can fail over. Boost is a resource-intensive process, especially when deals are being ingested over the internet. It also feeds data payload of the deals into the Lotus miner. We recommend 12-16 cores per VM and 128 GiB of memory. Lotus daemon and Boost need to run on fast storage (SSD or faster). The capacity requirements of Boost depend on the size of deals you are accepting as a storage provider. Its capacity must be sufficient to be landing space for deals until the data can be processed by your sealing cluster in the backend. Both Lotus daemon and Boost require public internet connectivity. In the case of Boost you also need to consider bandwidth. Depending on the deal size you are accepting, you might require 1 Gbps or 10 Gbps internet bandwidth. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#lotus-miner) Lotus miner * 16 CPU Cores * 256 GB RAM * 2x 1TB SSD storage * 2x 10 GbE ethernet NICs Lotus miner becomes a less intensive process with dedicated PoST workers separated from it (as in this design). If you use a dedicated storage server or NAS system as the storage target for your sealed and unsealed sectors, Lotus miner eventually could also become a VM. This requires additional CPU and memory on the hypervisor host. We opted for a standalone Lotus miner in this design and gave it 256 GiB of memory. This is because we operate ZFS at the storage layer, which requires a lot of memory for caching. Lotus miner has enough with 128 GiB of memory when you opt for a dedicated storage server or NAS system for your storage. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#sata-storage) SATA Storage In this architecture we have attached storage shelves to the Lotus miner with 2.4 PiB of usable capacity. This is the capacity after the creation of a RAIDZ2 file system (double parity). We recommend vdevs of 12 disks wide. In RAIDZ2 this results in 10 data disks and 2 parity disks. Storage systems also don’t behave well at 100% used capacity, so we designed for 20% extra capacity. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#post-workers) PoST workers * 16 CPU Cores * 128 GB RAM * 2x 1TB SSD storage * 1x GPU 10+ GB memory, 3500+ CUDA cores * 2x 10 GbE ethernet NICs We have split off the Winning PoST and Window PoST tasks from the Lotus miner. Using dedicated systems for those processes increase the likelihood of winning block rewards and reduces the likelihood of missing a proving deadline. For redundancy, you can run a standby WindowPoSt worker on the WinningPoSt server and vice versa. PoST workers require 128 GiB of memory at the minimum and require a capable GPU with 10GB of memory and 3500 or more CUDA cores. ### [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#sealing-workers) Sealing workers The sealing workers require the most attention during the design of a solution. Their performance will define the sealing rate of your setup, and hence, how fast you can onboard client deals. Keep in mind that using [Sealing-as-a-Service](https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service) reduces the requirements to have a fast performing sealing setup. In this design, however, we plan for an on-premise sealing setup of maximum 7 TiB/day. This theoretical sealing capacity is based on the entire sealing setup running at full speed for 24 hrs/day. **AP / PC1 worker** * 32 CPU Cores **with SHA-extensions** * 1 TB RAM * 2x 1TB SSD OS storage * 15+ TB U.3 NVMe sealing / scratch storage * 2x 10 GbE (or faster) ethernet NICs We put the AddPiece and PreCommit1 tasks together on a first worker. This makes sense because AddPiece prepares the scratch space that will be used by the PC1 tasks thereafter. The first critical hardware component for PC1 is the CPU. This must be a CPU with SHA-256 extensions. Most storage providers opt for AMD Epyc (Rome, Milan or Genova) processors, although Ice Lake and newer Intel Xeon processors also support these extensions. To verify if your CPU has the necessary extensions, run: PC1 is a single-threaded process so we require enough CPU cores to run multiple PC1 tasks in parallel. This reference architecture has 32 cores in a PC1, which would allow for ~30 parallel PC1 processes. For this, we also need 1TB of memory in the PC1 server. Every PC1 processes requires approximately 450 GiB of sealing scratch space. This scratch space is vital to the performance of the entire sealing setup. It requires U.2 or U.3 NVMe media. For 30 parallel PC1 processes we then need ~15 TiB of scratch space. RAID protection on this volume is not mandatory, however losing 30 sectors during sealing and having to start over does have an impact on your sealing rate. **PC2 / C1 / C2 workers** * 32 CPU Cores * 512 GB RAM * 2x 1TB SSD * 1x GPU 10+ GB memory, 3500+ CUDA cores * 2x 10 GbE (or faster) The next step in the sealing pipeline is PreCommit2 (PC2). You could decide to keep it together with PC1, but given the size of our setup (1 PiB) and the likely requirement to scale beyond that later, we split off PC2 in this architecture. We plan for twice the amount of PC2 workers compared to PC1, as explained under [sealing rate](https://docs.filecoin.io/storage-providers/architecture/sealing-rate) . Apart from the memory requirements this process specifically requires a capable GPU with preferably 24GB of memory and 6000 or more CUDA cores. The scratch space contents from PC1 is copied over to the PC2 worker. This PC2 worker also requires fast NVMe scratch space. Since we plan for 2 PC2 workers against 1 PC1 worker, the capacity of the scratch space per PC2 worker is half of the total scratch space capacity of the PC1 worker, 8 TiB in our case. C1 doesn’t require much attention for our architecture. C2 however requires a capable GPU again. [hashtag](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#solo-storage-providing) Solo storage providing ----------------------------------------------------------------------------------------------------------------------------------------------- Please take a look at the presentation Benjamin Hoejsbo from [PIKNIKarrow-up-right](https://www.piknik.com/) gave, in which solo storage provider setups are examined. The presentation is from 2022, but the content is still relevant as of March 2023. circle-info We are working to improve this section. If you would like to share your mining setup, please create an issue in the [Filecoin documentation GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-docs/issues) ! [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures) [PreviousBackup and disaster recoverychevron-left](https://docs.filecoin.io/storage-providers/infrastructure/backup-and-disaster-recovery) [NextSkillschevron-right](https://docs.filecoin.io/storage-providers/skills) Last updated 1 year ago * [1 PiB raw architecture](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#id-1-pib-raw-architecture) * [Virtual machines](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#virtual-machines) * [Lotus miner](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#lotus-miner) * [SATA Storage](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#sata-storage) * [PoST workers](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#post-workers) * [Sealing workers](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#sealing-workers) * [Solo storage providing](https://docs.filecoin.io/storage-providers/infrastructure/reference-architectures#solo-storage-providing) sun-brightdesktopmoon Copy cat /proc/cpuinfo | grep --color sha_ni sun-brightdesktopmoon --- # Filecoin programs and tools | Filecoin Docs Although it is possible to find your own data storage customers with valuable datasets they want to store, and have them verified through KYC ([Know Your Customerarrow-up-right](https://en.wikipedia.org/wiki/Know_your_customer) ) to create verified deals for [Filecoin Plus](https://docs.filecoin.io/basics/how-storage-works/filecoin-plus) , there are also programs and platforms that make it easier for storage providers to receive verified deals. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#web3.storage) [Web3.storagearrow-up-right](https://web3.storage/) ------------------------------------------------------------------------------------------------------------------------------------------------------------- [![GitHub Repo stars](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fstars%2Fweb3-storage%2Fweb3.storage%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=a59956d2&sv=2)arrow-up-right](https://github.com/web3-storage/web3.storage) [![GitHub last commit](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Flast-commit%2Fweb3-storage%2Fweb3.storage%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=6ef10af5&sv=2)arrow-up-right](https://github.com/web3-storage/web3.storage/graphs/commit-activity) [![Docs site](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdocs-web3.storage-blue%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=9e6a0955&sv=2)arrow-up-right](https://web3.storage/docs/) Web3.storage runs on “Elastic IPFS” as the inbound storage protocol offering scalability, performance and reliability as the platform grows. It guarantees the user (typically developers) that the platform will always serve your data when you need it. In the backend the data is uploaded onto the Filecoin Network for long-term storage. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#filecoin-green) [Filecoin Greenarrow-up-right](https://green.filecoin.io/) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [![Read the doc](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdocs-gitbook.io-blue%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=8b9f42fe&sv=2)arrow-up-right](https://filecoin-green.gitbook.io/) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=6175c412&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C02HZ215B7Y) Filecoin Green aims to measure the environmental impacts of Filecoin and verifiably drive them below zero, building infrastructure along the way that allows anyone to make transparent and substantive environmental claims. The team maintains the [Filecoin Energy Dashboardarrow-up-right](https://filecoin.energy/) and works with storage providers to decarbonize their operations through the [Energy Validation Processarrow-up-right](https://filecoin.energy/methodology) . Connect with the team on Slack at [#fil-greenarrow-up-right](https://filecoinproject.slack.com/archives/C02HZ215B7Y) , or via email at [\[email protected\]envelope](https://docs.filecoin.io/cdn-cgi/l/email-protection#c5a2b7a0a0ab85a3aca9a0a6aaacabebaab7a2) . [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#spade) [Spadearrow-up-right](https://github.com/data-preservation-programs/spade) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [![GitHub Repo stars](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fstars%2Fdata-preservation-programs%2Fspade%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=721b0dd9&sv=2)arrow-up-right](https://github.com/data-preservation-programs/spade) [![GitHub last commit](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Flast-commit%2Fdata-preservation-programs%2Fspade%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=c322f718&sv=2)arrow-up-right](https://github.com/data-preservation-programs/spade/graphs/commit-activity) [![Read the doc](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdocs-README-blue%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=3d193367&sv=2)arrow-up-right](https://github.com/data-preservation-programs/spade/blob/master/README.md) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-Slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=fe6d4972&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C0377FJCG1L) Spade automates the process of renewing storage deals on the Filecoin network, ensuring the longevity of data stored on the blockchain. This is particularly useful for datasets that need to be preserved for extended periods, far beyond the standard deal duration. By using Spade, organizations and individuals can manage and maintain their data storage deals more efficiently, guaranteeing that valuable data remains accessible and secure over time. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#singularity) [Singularityarrow-up-right](https://github.com/data-preservation-programs/singularity) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [![Github Repo stars](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fstars%2Fdata-preservation-programs%2Fsingularity%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=75d2eb1f&sv=2)arrow-up-right](https://github.com/data-preservation-programs/singularity) [![GitHub last commit](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Flast-commit%2Fdata-preservation-programs%2Fsingularity%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=670e45ea&sv=2)arrow-up-right](https://github.com/data-preservation-programs/spade/graphs/commit-activity) [![Read the doc](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdocs-gitbook.io-blue%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=8b9f42fe&sv=2)arrow-up-right](https://data-programs.gitbook.io/singularity) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-Slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=fe6d4972&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C05JABREATH) Singularity is an end-to-end solution for onboarding datasets to Filecoin storage providers, supporting [PiB-scale dataarrow-up-right](https://stats.singularity.storage/) . It offers modular compatibility with various data preparation and deal-making tools, allowing efficient processing from local or remote storage. Singularity integrates with over 40 storage solutions and introduces inline preparation, which links CAR files to their original data sources, preserving dataset hierarchies. It also supports content distribution and retrieval through multiple protocols and provides push and pull modes for deal making along with robust wallet management features. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#partner-tools-and-programs) Partner tools and programs ------------------------------------------------------------------------------------------------------------------------------------------------- Many other programs and tools exist in the Filecoin community, developed by partners or storage providers. We list some examples below. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#akave) [Akavearrow-up-right](https://www.akave.ai/) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-Slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=fe6d4972&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C07FN47FCFJ) Akave is revolutionizing data management with a decentralized, modular solution that combines the robust storage of Filecoin with cutting-edge encryption and easy-to-use interfaces. Read more on the [Akave Docsarrow-up-right](https://docs.akave.ai/) . ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#cidgravity) [CIDGravityarrow-up-right](https://www.cidgravity.com/) [![Read the doc](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdocs-cidgravity.com-blue%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=ec85e93a&sv=2)arrow-up-right](https://docs.cidgravity.com/) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-Slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=fe6d4972&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C04SCAG37FH) CIDGravity is a software-as-a-service that allows storage providers to handle dynamic pricing and client management towards your solution. It integrates with deal engines such as [Boostarrow-up-right](https://boost.filecoin.io/) . ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#swan-filswan) [Swan (Filswan)arrow-up-right](https://github.com/filswan) [![GitHub Org's stars](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fstars%2Ffilswan%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=9187a698&sv=2)arrow-up-right](https://github.com/filswan) [![Read the doc](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdocs-filswan.com-blue%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=58f7d042&sv=2)arrow-up-right](https://docs.filswan.com/) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-Slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=fe6d4972&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C04LBAMBDPD) Swan is a provider of cross-chain cloud computing solutions. Developers can use its suite of tools to access resources across multiple chains. Swan Cloud provides decentralized cloud computing solutions for Web3 projects by integrating storage, computing, and payment into one suite. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#open-panda) [Open Pandaarrow-up-right](https://github.com/data-preservation-programs/open-panda) Open Panda was a platform for data researchers, analysts, students, and enthusiasts to interact with the largest open datasets in the world. Data available through the platform was stored on Filecoin, a decentralized storage network comprised of thousands of independent Storage Providers around the world. [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#former-programs-and-tools) Former programs and tools ----------------------------------------------------------------------------------------------------------------------------------------------- Here is a comprehensive list of deprecated tools and projects. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#evergreen) Evergreen ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%2F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=4958b8bf&sv=2) Evergreen extended the [Slingshot](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#slingshot) program by aiming to store open datasets forever. Standard deals had a maximum duration of 540 days, which was not long enough for valuable, open datasets that might need to be stored forever. Evergreen used the [Spade](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#spade) deal engine, which automatically renewed deals to extend the lifetime of the dataset on-chain. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#co2.storage) CO2.Storage ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%2F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=4958b8bf&sv=2) CO2.Storage was a decentralized storage solution for structured data based on content-addressed data schemas. CO2.Storage primarily focused on structured data for environmental assets, such as Renewable Energy Credits, Carbon Offsets, and geospatial datasets, and mapped inputs to base data schemas (IPLD DAGs) for off-chain data (like metadata, images, attestation documents, and other assets) to promote the development of standard data schemas for environmental assets. This project was in alpha, and while many features could be considered stable, it was waiting until being feature complete to fully launch. The Filecoin Green team was actively working on this project and welcomed contributions from the community. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#filecoin-tracker) Filecoin Tracker ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%2F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=4958b8bf&sv=2) Filecoin Tracker was deprecated on April 20, 2024. Here are great existing and working Filecoin dashboards that cover similar topics: * [Starboardarrow-up-right](https://dashboard.starboard.ventures/dashboard) * [Filecoin Dune Daily Metricsarrow-up-right](https://dune.com/kalen/filecoin-daily-metrics) * [Filecoin Pulse (PoC)arrow-up-right](https://filecoinpulse.pages.dev/) ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#slingshot) Slingshot [![GitHub Repo stars](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Fstars%2Ffilecoin-project%2Fslingshot%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=62d76547&sv=2)arrow-up-right](https://github.com/filecoin-project/slingshot) ![GitHub last commit](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fgithub%2Flast-commit%2Ffilecoin-project%2Fslingshot%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=6b9acda2&sv=2) ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated-red.svg%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=b2f115fd&sv=2) [![Join Slack](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fjoin-Slack-purple%3Fstyle%3Dfor-the-badge&width=300&dpr=3&quality=100&sign=fe6d4972&sv=2)arrow-up-right](https://filecoinproject.slack.com/archives/C01AZP8BKRQ) Slingshot was a program that united Data clients, Data preparers and storage providers in a community to onboard data and share replicas of publicly valuable [_Open Datasets_arrow-up-right](https://datasets.filecoin.io/) . Rather than providing a web interface like Estuary, Slingshot was a program that provides a workflow and tools for onboarding of large open datasets. The Slingshot Deal Engine provided deals to registered and certified storage providers. The data was prepared and uploaded using a tool called [Singularity](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#singularity) . ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#dataprograms.org) Dataprograms.org ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%252F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=96609045&sv=2) dataprograms.org listed tools, products, and incentive programs designed to drive growth and make data storage on Filecoin more accessible. It was discontinued in April 2024. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#moonlanding) Moonlanding ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%252F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=96609045&sv=2) Moon Landing was designed to ramp up storage providers in the Filecoin network by enabling them to serve verified deals at scale. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#filecoin-dataset-explorer) Filecoin Dataset Explorer ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%252F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=96609045&sv=2) Filecoin Dataset Explorer showcased data stored on the Filecoin network between 2020 and 2022, including telemetry, historical archives, Creative Commons media, entertainment archives, scientific research, and machine learning datasets. It highlighted Filecoin's capability to store large datasets redundantly, ensuring availability from multiple Storage Providers worldwide. Each dataset is identified by a unique content identifier (CID). The platform aimed to make diverse datasets accessible to users globally. See also: Legacy Explorer (legacy.datasets.filecoin.io) [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#estuary) Estuary ----------------------------------------------------------------------------------------------------------- ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_07%252F2023-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=66929bc7&sv=2) Estuary was an experimental software platform designed for sending public data to the Filecoin network, facilitating data retrieval from anywhere. It integrated IPFS and Filecoin technologies to provide a seamless end-to-end example for data storage and retrieval. When a file was uploaded, Estuary immediately made multiple storage deals with different providers to ensure redundancy and security. The software automated many aspects of deal making and retrieval, offering tools for managing connections, block storage, and deal tracking. Estuary aimed to simplify the use of decentralized storage networks for developers and users. Estuary was discontinued in July 2023, and the website shut down in April 2024. ### [hashtag](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#big-data-exchange) Big Data Exchange ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fimg.shields.io%2Fbadge%2Fmaintenance-deprecated_04%252F2024-red.svg%3Fstyle%3Dfor-the-badge&width=768&dpr=3&quality=100&sign=96609045&sv=2) Big Data Exchange was a program that allowed storage providers easy access to Filecoin+ deals through an auction where Storage Providers could bid on datasets by offering to pay clients FIL to choose the bidder as their Storage Provider. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs) [PreviousVerified dealschevron-left](https://docs.filecoin.io/storage-providers/filecoin-deals/verified-deals) [NextSnap dealschevron-right](https://docs.filecoin.io/storage-providers/filecoin-deals/snap-deals) Last updated 3 months ago * [Web3.storage](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#web3.storage) * [Filecoin Green](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#filecoin-green) * [Spade](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#spade) * [Singularity](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#singularity) * [Partner tools and programs](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#partner-tools-and-programs) * [Akave](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#akave) * [CIDGravity](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#cidgravity) * [Swan (Filswan)](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#swan-filswan) * [Open Panda](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#open-panda) * [Former programs and tools](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#former-programs-and-tools) * [Evergreen](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#evergreen) * [CO2.Storage](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#co2.storage) * [Filecoin Tracker](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#filecoin-tracker) * [Slingshot](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#slingshot) * [Dataprograms.org](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#dataprograms.org) * [Moonlanding](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#moonlanding) * [Filecoin Dataset Explorer](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#filecoin-dataset-explorer) * [Estuary](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#estuary) * [Big Data Exchange](https://docs.filecoin.io/storage-providers/filecoin-deals/filecoin-programs#big-data-exchange) sun-brightdesktopmoon sun-brightdesktopmoon --- # The Filecoin Virtual Machine | Filecoin Docs NOTE: As of January 2025, for developer support, please visit the [FILBarrow-up-right](https://fil.builders/) website. For Filecoin product updates, please visit the [FILOzarrow-up-right](https://www.filoz.org/) website or see the Lotus [Github discussion pagearrow-up-right](https://github.com/filecoin-project/lotus/discussions) . [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm#introduction) Introduction ------------------------------------------------------------------------------------------------------- Filecoin’s storage and retrieval capabilities can be thought of as the base layer of the Filecoin blockchain, and [FVMarrow-up-right](https://fvm.filecoin.io/) can be thought of as a layer on top of Filecoin that unlocks programmability on the network (e.g. programmable storage primitives). Whereas other blockchains do have smart contract capabilities, FVM’s smart contracts can use Filecoin storage and retrieval primitives with computational logic conditions. FVM will also enable Layer 2 capabilities, such as “compute over data” and [content delivery networksarrow-up-right](https://saturn.tech/) . Some additional notes about FVM’s technical specifications: * WASM-based: The FVM is a WASM-based polyglot execution environment for IPLD data, meaning that FVM gives developers access to IPFS / IPLD data primitives and can accommodate smart contracts (actors) written in any programming language that compiles to WASM. * FEVM Compatibility: Are you an Ethereum / Solidity developer? You can build the next killer app on FVM and make use of the [Filecoin Solidity libraryarrow-up-right](https://docs.zondax.ch/fevm/filecoin-solidity/) . Learn more about how FVM is Ethereum runtime and solidity compatible in the next section. * VM Agnostic: The FVM is built to be VM-agnostic, meaning support for other foreign VMs can be added in the near future. Future versions of FVM can serve as a useful hypervisor enabling cross run-time invocations. FVM brings user programmability to Filecoin, unleashing the enormous potential of an open data economy through various applications. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm#use-cases) Use Cases FVM Actors enable a huge range of use cases to be built on Filecoin. Here are just a few potential examples: * Data Access Control: FVM Actors can enable a client to grant retrieval permission for certain files to a limited set of third-party Filecoin wallet addresses. * DataDAO: FVM Actors can enable the creation of decentralized autonomous organizations where members govern and manage the storage, accessibility, and monetization of certain data sets and pool returns into a shared treasury. * Perpetual Storage: Because all Filecoin storage deals are time-limited, when a client makes a deal with a storage provider to store a data set with them, the client has to begin to consider whether they will want to renew this deal for the next time-period with the same storage provider or seek out other storage providers that may be cheaper. However, FVM enables a client to automatically renew deals or find a cheaper storage provider when the time limit of a given deal has reached maturity. This automated renewal of deals can persist, even in perpetuity, for as many cycles as can be financed by an associated endowment of FIL. FVM Actors enable the creation and management of this endowment. * Replication: In addition to allowing a client to store one data set with one storage provider in perpetuity, FVM Actors enable data resiliency by allowing a client to store one data set once manually and then have the Actor replicate that data with multiple other storage providers automatically. Additional conditions that can be set in an automated replication Actor include choices about the geographic region of the storage providers, latency, and deal price limits. * Leasing: FVM Actors enable a FIL token holder to provide collateral to clients looking to do a storage deal, and be repaid the principal and interest over time. FVM Actors can also trace the borrowing and repayment history of a given client, generating a community-developed reputation score. Additional use cases enabled by FVM include, but are not limited to, tokenized data sets, trustless reputation systems, NFTs, storage bounties and auctions, Layer 2 bridges, futures and derivatives, or conditional leasing. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm#start-building-on-the-fvm) Start building on the FVM If you’re ready to start building on the FVM, here are some resources you should explore: * FVM Reference Implementation: The [Github repoarrow-up-right](https://github.com/filecoin-project/ref-fvm) containing the reference implementation for FVM. * FVM Quickstart Guide: The Quickstart guide will walk you through deploying your first ERC-20 contract on FVM. In addition to being provided this code, we also walk you through the developer environment set-up. * Developing Contracts: If you are ready to build your dApp on FVM, you can skip ahead and review our [best practices](https://docs.filecoin.io/smart-contracts/developing-contracts/best-practices) section for developing contracts. Here, you can find a guide for the Filecoin solidity libraries, details on tools such as Foundry, Remix, and Hardhat, and tutorials for calling built-in actors and building client contracts. The next page will walk you through the process of deciding whether you need to use FVM’s programmatic storage when building a dApp with storage on Filecoin. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) [PreviousFundamentalschevron-left](https://docs.filecoin.io/smart-contracts/fundamentals) [NextFilecoin EVM runtimechevron-right](https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime) Last updated 1 year ago * [Introduction](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm#introduction) * [Use Cases](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm#use-cases) * [Start building on the FVM](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm#start-building-on-the-fvm) sun-brightdesktopmoon sun-brightdesktopmoon --- # dApps | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps) [PreviousPrivacy & Access Controlchevron-left](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control) [NextChain-Data Querychevron-right](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Get test tokens | Filecoin Docs Before we begin, you must have a local testnet running. Follow the [Run a local network guide](https://docs.filecoin.io/networks/local-testnet) if you haven’t got a local testnet set up yet. 1. Change directory to where you created the `lotus` and `lotus-miner` binaries. If you followed the [Run a local network guide](https://docs.filecoin.io/networks/local-testnet) these binaries will be in `~/lotus-devnet`:\\ Copy cd ~/lotus-devnet 2. View the wallets available on this node with `lotus wallet list`:\\ Copy ./lotus wallet list This command will output something like:\\ Copy Address Balance Nonce Default t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 0 FIL 0 t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq 49999999.999763880085417692 FIL 2 X 3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\\ Copy ./lotus send --from For example:\\ Copy ./lotus send --from t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 2000 This command will output something like:\\ Copy bafy2bzaceaqzbgiazwvtpago6wpkxl42puxfkvwv5cwjpime2irqatamji2bq 4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\\ Copy ./lotus wallet balance
For example:\\ Copy ./lotus wallet balance t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq This command will output something like:\\ Copy 2000 FIL If you want to manage your local testnet tokens in MetaMask you will need to create a `t4` address. You can create a `t4` address using `lotus wallet new deleated`. Once you have a `t4` address you can connect MetaMask to your local testnet to see the new balance within the MetaMask extension. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/local-testnet/get-test-tokens) [PreviousLocal testnetchevron-left](https://docs.filecoin.io/networks/local-testnet) [NextDeprecated networkschevron-right](https://docs.filecoin.io/networks/deprecated-networks) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Data replication, renewal and repair (RaaS) | Filecoin Docs RaaS refers to replication, renew and repair of storage deals. It is a feature of programmatic storage on Filecoin, enabled by FVM. This page covers the basic features of RaaS and handy tutorial to help you get started. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#introduction) Introduction ------------------------------------------------------------------------------------------------------------ What does it mean to replicate, renew, or repair data storage deals through a Filecoin smart contract? * RaaS refers to replication, renewal and repair as a service, for data stored in storage deals on Filecoin: * Replication refers to the option to store a user-defined number of replicas of your data. * Renewal refers to the option to automatically observe on-chain storage deals until the expiry of their deal term, and automatically renew the deal. * Repair refers to the automatic observation of storage deals, to ensure they are not in a faulted sector. If they are, these workers repair them automatically. The motivation behind RaaS is to enable perpetual data storage on Filecoin. “As a service" refers to the opportunity to provide these RaaS features as services, to incentivize clients to use them and/or storage platforms to enable them. These are a part of the Filecoin programmable storage market with FVM. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#raas-modules) RaaS modules ------------------------------------------------------------------------------------------------------------ There are two ways available to use with RaaS, for different purposes - the self-hosted RaaS where the Client runs all components and aggregator-hosted RaaS, which refers to a fully hosted RaaS service that is provided to the Client by aggregators. At the RaaS, any contract or storage platform that has the metadata of the stored data, can request the RaaS node to perform its functions. However, the RaaS node has to be self-hosted in order to function. Storage platforms have the opportunity to build an aggregator-hosted RaaS node, to provide hosted replication, renewal, and repair services to clients. A RaaS node, which monitors deals done through aggregators on Filecoin, will take action if replication, renew, or repair requirements are not observed. RaaS nodes are only able to monitor deals from aggregators, since the nodes listen to the SubmitAggregatorRequest event in order to pick these deals up. Here is a brief outline of the RaaS process: 1. An Aggregator sends a CID to the RaaS node, requesting for replication, renewal and/or repair as needed. 2. The RaaS smart contracts maintains the information of deals created by the RaaS, including deal\_id and miner\_id. 3. The RaaS node periodically checks the deal status on the Filecoin network, by interacting with the RaaS\` smart contract. 4. If the deal requires replication, renewal and/or repair, the RaaS node resubmit deals to aggregators and requests the aggregator to make a new deal. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#tutorial) Tutorial ---------------------------------------------------------------------------------------------------- We're now going to quickly cover how to create storage deals with replication, renew and repair requirements using smart contracts. This utilizes the [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) . ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#interacting-with-the-smart-contract) Interacting with the Smart Contract First, you need to either: * Start an instance of the BaseInterface by deploying a contract that inherits from `IAggregatorOracle` (you can do so via. `yarn deploy` in the [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) ) OR * Use an existing instance of the `FullInterface` located at `0x6ec8722e6543fB5976a547434c8644b51e24785b`. This instance is on the Calibration testnet only, for the moment. Interact with the smart contract by submitting a CID of your choice to the `submit` function. This will create a new deal request that will be picked up by the RaaS services. The [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) provides you with a frontend that allows you to upload your file to Lighthouse, get a CID for the uploaded file, then seamlessly submit the CID to the smart contract (accessible via `yarn start`). Before that, you need to know how to register the various RaaS workers. Note that RaaS functionality will NOT function automatically if deals are only created using submit function. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#replicate-renew-and-repair) Replicate, renew, and repair You can add workers to perform replication, renewal, and repair jobs by having them listen to the `SubmitAggregatorRequest`. The methods for doing so differ between the Base and Full interfaces. If you are running a base interface (specifically, the one in the [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) ), there's an event listener inside the RaaS service node that you can use to listen for new deal requests. This event listener performs processing for each job submitted to the contract to add RaaS service workers and eventually to call `complete` on the contract. To use this, call `yarn service` in the terminal and proceed through the frontend, as you normally would when uploading a file. Register the workers using the autocompleted CID that appears in the box. If you want to register the workers manually for a job that you didn't upload, paste in the known CID of your file into the box and register the jobs. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/raas) [PreviousCross-Chain Data Bridge(CCDB)chevron-left](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb) [NextRaaS interfaceschevron-right](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces) Last updated 1 year ago * [Introduction](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#introduction) * [RaaS modules](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#raas-modules) * [Tutorial](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#tutorial) * [Interacting with the Smart Contract](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#interacting-with-the-smart-contract) * [Replicate, renew, and repair](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas#replicate-renew-and-repair) sun-brightdesktopmoon Copy // contractInstance is the address of the contract you deployed or the FullInterface address above. const dealStatus = await ethers.getContractAt("DealStatus", contractInstance); // Submit the CID of the file you want to upload to the Filecoin network in the following way. await dealStatus.submit(ethers.utils.toUtf8Bytes(newJob.cid)); Copy // Initialize the listener for the Deal Creation event async function initializeDealCreationListener() { const dealStatus = await ethers.getContractAt(contractName, contractInstance); /// Logic for handling SubmitAggregatorRequest events function handleEvent(transactionId, cid) { console.log(`Received SubmitAggregatorRequest event: (Transaction ID: ${transactionId}, CID: ${cid})`); // ... other code to handle the event emission (async () => { // ... other code // After processing this event, reattach the event listener if (dealStatus.listenerCount("SubmitAggregatorRequest") === 0) { dealStatus.once("SubmitAggregatorRequest", handleEvent); } })(); } // Start listening to the first event and recursively handle the next events if (dealStatus.listenerCount("SubmitAggregatorRequest") === 0) { dealStatus.once("SubmitAggregatorRequest", handleEvent); } } sun-brightdesktopmoon --- # RPCs | Filecoin Docs circle-info [Chainlistarrow-up-right](https://chainlist.org/?search=filecoin&testnets=true) contains a dynamically updated list of available Filecoin RPCs. Select **Include Testnets** to view available test networks. [Find out more at chainlist.org's Filecoin listingsarrow-up-right](https://chainlist.org/?search=filecoin&testnets=true) . These endpoints are limited to [read-only Filecoin JSON RPC API calls](https://docs.filecoin.io/reference/json-rpc) and [`MPoolPush`](https://docs.filecoin.io/reference/json-rpc/mpool) for sending messages that have already been signed. [hashtag](https://docs.filecoin.io/networks/calibration/rpcs#ankr) [Ankrarrow-up-right](https://www.ankr.com/rpc/filecoin) -------------------------------------------------------------------------------------------------------------------------------- * HTTPS: `https://rpc.ankr.com/filecoin_testnet` * [Ankr documentationarrow-up-right](https://www.ankr.com/docs/rpc-service/chains/chains-list/#filecoin) [hashtag](https://docs.filecoin.io/networks/calibration/rpcs#chainupcloud) [ChainupCloudarrow-up-right](https://cloud.chainup.com/) ----------------------------------------------------------------------------------------------------------------------------------------- * HTTPS: `https://filecoin-calibration.chainup.net/rpc/v1` * [ChainupCloud documentationarrow-up-right](https://docs.chainupcloud.com/blockchain-api/filecoin/public-apis) [hashtag](https://docs.filecoin.io/networks/calibration/rpcs#glif) [Glifarrow-up-right](https://api.calibration.node.glif.io/) ------------------------------------------------------------------------------------------------------------------------------------ Please note that publicly available hosted endpoints **only guarantee 2000 of the latest blocks.** * HTTPS: `https://api.calibration.node.glif.io/rpc/v1` * WebSocket: `wss://wss.calibration.node.glif.io/apigw/lotus/rpc/v1` * Lotus lite-node command: Copy FULLNODE_API_INFO=wss://wss.calibration.node.glif.io/apigw/lotus lotus daemon --lite * When using a lite-node, omit `/rpc/v1` from Glif’s WebSocket address. * [Glif documentationarrow-up-right](https://hosting.glif.io/) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/calibration/rpcs) [PreviousExplorerschevron-left](https://docs.filecoin.io/networks/calibration/explorers) [NextLocal testnetchevron-right](https://docs.filecoin.io/networks/local-testnet) Last updated 5 months ago * [Ankr](https://docs.filecoin.io/networks/calibration/rpcs#ankr) * [ChainupCloud](https://docs.filecoin.io/networks/calibration/rpcs#chainupcloud) * [Glif](https://docs.filecoin.io/networks/calibration/rpcs#glif) sun-brightdesktopmoon sun-brightdesktopmoon --- # Specifications | Filecoin Docs The Filecoin specification is the technical document that outlines the details of how the Filecoin network operates, including the rules for participating in the network, the format of the transactions that are used to manage data storage, and the algorithms and data structures that are used to store and retrieve data on the network. The specification is an important reference for developers who are building applications on top of Filecoin, as it provides them with the necessary information to create integrations that are compatible with the rest of network. The Filecoin specification is a _living_ document, with frequent updates and changes as the Filecoin network grows. The specification is available to view at [specs.filecoin.ioarrow-up-right](https://spec.filecoin.io/) . You can suggest changes to the specification [over on GitHubarrow-up-right](https://github.com/filecoin-project/specs) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/general/specifications) [PreviousGlossarychevron-left](https://docs.filecoin.io/reference/general/glossary) [NextToolschevron-right](https://docs.filecoin.io/reference/general/tools) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Deprecated networks | Filecoin Docs The following networks have been deprecated: [hashtag](https://docs.filecoin.io/networks/deprecated-networks#nerpanet) Nerpanet --------------------------------------------------------------------------------------- The Nerpa test network, often called _Nerpanet_, was designed with tiny sector sizes. This network was for application developers to test the very basic functionality of their applications before moving over to the calibration test network. It was deprecated on 2021-08-16. [hashtag](https://docs.filecoin.io/networks/deprecated-networks#spacenet) Spacenet --------------------------------------------------------------------------------------- The Spacenet test network was created for the Interplanetary Consensus (IPC) project. This network was deprecated on 2023-09-11. [hashtag](https://docs.filecoin.io/networks/deprecated-networks#wallaby) Wallaby ------------------------------------------------------------------------------------- The Wallaby test network, often just called _Wallaby_, was designed for internal Filecoin developers to test new features before rolling them out to the Hyperspace testnet, and then onto Mainnet. Wallaby was designed to be reset every week. It was deprecated on 2023-02-07. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/deprecated-networks) [PreviousGet test tokenschevron-left](https://docs.filecoin.io/networks/local-testnet/get-test-tokens) [NextGeneralchevron-right](https://docs.filecoin.io/reference/general) Last updated 1 year ago * [Nerpanet](https://docs.filecoin.io/networks/deprecated-networks#nerpanet) * [Spacenet](https://docs.filecoin.io/networks/deprecated-networks#spacenet) * [Wallaby](https://docs.filecoin.io/networks/deprecated-networks#wallaby) sun-brightdesktopmoon sun-brightdesktopmoon --- # Exchanges | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/exchanges) [PreviousToolschevron-left](https://docs.filecoin.io/reference/general/tools) [NextExchange integrationchevron-right](https://docs.filecoin.io/reference/exchanges/exchange-integration) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin EVM runtime | Filecoin Docs The Ethereum Virtual Machine is an execution environment initially designed, built for, and run on the Ethereum blockchain. The EVM was revolutionary because, for the first time, any arbitrary code could be deployed to and run on a blockchain. This code inherited all the decentralized properties of the Ethereum blockchain. Before the EVM, a new blockchain had to be created with custom logic and then bootstrapped with validators every time a new type of decentralized application needed to be built. Code deployed to EVM is typically written in the high-level language Solidity, although other languages, such as Vyper, exist. The high-level Solidity code is compiled to EVM bytecode which is what is actually deployed to and run on the EVM. Due to it being the first virtual machine to run on top of a blockchain, the EVM has developed one of the strongest developer ecosystems in Web3 to date. Today, many different blockchains run their own instance of the EVM to allow developers to easily port their existing applications into the new blockchain’s ecosystem. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime#ethereum-virtual-machine) Ethereum Virtual Machine -------------------------------------------------------------------------------------------------------------------------------------------- The Filecoin EVM, often just referred to as _FEVM_, is the Ethereum virtual machine virtualized as a runtime on top of the Filecoin virtual machine. It allows developers to port any existing EVM-based smart contracts straight onto the FVM. The Filecoin EVM runtime is completely compatible with any EVM development tools, such as Hardhat, Brownie, and MetaMask, making deploying and interacting with EVM-based actors easy! This is because Filecoin nodes offer the Ethereum JSON-RPC API. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime#deep-dive) Deep dive -------------------------------------------------------------------------------------------------------------- For a deeper dive into the concepts discussed on this page, see this presentation Ethereum compatibility of FVM, see: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime) [PreviousThe Filecoin Virtual Machinechevron-left](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) [NextERC-20 quickstartchevron-right](https://docs.filecoin.io/smart-contracts/fundamentals/erc-20-quickstart) Last updated 1 year ago * [Ethereum Virtual Machine](https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime#ethereum-virtual-machine) * [Deep dive](https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime#deep-dive) sun-brightdesktopmoon sun-brightdesktopmoon --- # Roadmap | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#goal) Goal --------------------------------------------------------------------------------------- The goal of the FVM project is to add general programmability to the Filecoin blockchain. Doing so will give developers all kinds of creative options, including: * Orchestrating storage. * Creating L2 networks on top of the Filecoin blockchain. * Providing new incentive structures for providers and users. * Frequently verifying that providers are storing data correctly. * Automatically finding which storage providers are storing what data. * Many more data-based applications. Filecoin was the first network deploying programmability, post-genesis, to ensure that layer 0 of the Filecoin blockchain was stable and fully functional. Due to the large amounts of capital already secured within the Filecoin network, the development of the FVM needs to be careful and gradual. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#roadmap) Roadmap --------------------------------------------------------------------------------------------- The FVM roadmap is split into three initiatives: * Milestone 1: Initialize the project and allow built-in actors to run on the FVM. * Milestone 2: Enable the deployment of Ethereum virtual machine (EVM) compatible smart contracts onto the FVM. Also, allow developers to create and deploy their own native actors to the FVM. * Milestone 3: Continue to enhance programmability on FVM. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-0) ✅ Milestone 0 **✅ Lotus mainnet canaries with FVM support** _Completed in February 2022_ The reference FVM implementation has been integrated into a fork of Lotus (the Filecoin reference client). A fleet of canary nodes have been launched on mainnet, running WASM-compiled built-in actors on the FVM. The canaries are monitored for consensus faults and to gather telemetry. This milestone is a testing milestone that’s critical to collect raw execution data to feed into the overhaul of the gas model, in preparation for user-programmability. It implies no network upgrade. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-0.5) ✅ Milestone 0.5 **✅ Ability to run FVM node and sync mainnet** _Completed in March 2022_ Any node operator can sync the Filecoin Mainnet using the FVM and Rust built-in actors, integrated in Lotus, Venus, Forest, and Fuhon implementations. It implies no network upgrade. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-1) ✅ Milestone 1 **✅ Introduction of non-programmable WASM-based FVM** _Completed in May 2022_ Mainnet will atomically switch from the current legacy virtual machines to the WASM-based reference FVM. A new gas model will be activated that accounts for actual WASM execution costs. Only Rust built-in actors will be supported at this time. This milestone requires a network upgrade. **✅ Network Version 17 (nv17): Initial protocol refactors for programmability** _Completed in November 2022_ An initial set of protocol refactors targeting built-in actors, including the ability to introduce new storage markets via user-defined smart contracts. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-2.1) ✅ Milestone 2.1 **✅ Ability to deploy EVM contracts to mainnet (FEVM)** _Completed in March 2023_ The Filecoin network will become user-programmable for the first time. Developers will be able to deploy smart contracts written in Solidity or Yul, and compiled to EVM. Smart contracts will be able to access Filecoin functionality by invoking built-in actors. Existing Ethereum tooling will be compatible with Filecoin. This milestone requires a network upgrade. **✅ Hyperspace testnet goes live** _Completed on January 16th 2023_ A new stable developer testnet called Hyperspace will be launched as the pre-production testnet. The community is invited to participate in heavy functional, technical, and security testing. Incentives and bounties will be available for developers and security researchers. **✅ FEVM goes live on mainnet** _Completed on March 14th 2023_ The Filecoin EVM runtime is deployed on Filecoin mainnet via the [Filecoin nv18 Hygge upgradearrow-up-right](https://github.com/filecoin-project/community/discussions/74?sort=new#discussioncomment-4313888) . ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-2.2) 🔄 Milestone 2.2 **🔄 Ability to deploy Wasm actors to mainnet** _To complete midway through 2023_ Developers will be able to deploy custom smart contracts written in Rust, AssemblyScript, or Go, and compiled to WASM bytecode. SDKs, tutorials, and other developer materials will be generally available. This milestone requires a network upgrade. ### [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-3) 🔮 Milestone 3+ **🔮 Further incremental protocol refactors to enhance programmability** _To complete in 2023_ A series of additional incremental protocol upgrades (besides nv17) to move system functionality from privileged space to user space. The result will be a lighter and less opinionated base Filecoin protocol, where storage markets, deal-making, incentives, etc. are extensible, modular, and highly customizable through user-deployed actors. Enhanced programming features such as user-provided cron, asynchronous call patterns, and more will start to be developed at this stage. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/roadmap) [PreviousERC-20 quickstartchevron-left](https://docs.filecoin.io/smart-contracts/fundamentals/erc-20-quickstart) [NextSupportchevron-right](https://docs.filecoin.io/smart-contracts/fundamentals/support) Last updated 1 year ago * [Goal](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#goal) * [Roadmap](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#roadmap) * [✅ Milestone 0](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-0) * [✅ Milestone 0.5](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-0.5) * [✅ Milestone 1](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-1) * [✅ Milestone 2.1](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-2.1) * [🔄 Milestone 2.2](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-2.2) * [🔮 Milestone 3+](https://docs.filecoin.io/smart-contracts/fundamentals/roadmap#milestone-3) sun-brightdesktopmoon sun-brightdesktopmoon --- # Network performance | Filecoin Docs The Filecoin Network is a decentralized storage market and network that provides data persistence via a decentralized protocol and publicly verifiable storage proofs on a blockchain. Current Filecoin network performance is primarily determined by security parameters and Filecoin’s [proof constructionsarrow-up-right](https://spec.filecoin.io/#algorithms__pos) . It is highly non-trivial to provide highly reliable benchmarks for Filecoin network performance. However, as you begin interacting with Filecoin, you can use these heuristics to understand general Filecoin network performance and how it fits your use case. [hashtag](https://docs.filecoin.io/networks/mainnet/network-performance#financial-transfers) Financial transfers --------------------------------------------------------------------------------------------------------------------- A message that requires [transferring FILarrow-up-right](https://lotus.filecoin.io/docs/set-up/manage-fil/) is often extremely fast, and will take on average ~1 blocktime (or around 30 seconds) to be reflected on-chain. We consider 120 blocks (1 hour) a conservative number of confirmations for high-value transfers. [hashtag](https://docs.filecoin.io/networks/mainnet/network-performance#data-storage) Data storage ------------------------------------------------------------------------------------------------------- In the Filecoin data storage protocol, the following occurs once a deal is proposed and accepted: 1. _Funding the storage market actor_: This process takes roughly 1-2 minutes and ensures that both the client and the storage provider have funds and collateral to pay for the deal. 2. _Data transfer_: This portion of the deal flow involves the client’s node sending the relevant data to the providing node. The data transfer rate varies widely, depending on the client and the storage provider’s network and disk bandwidths. Generally, the network speed between client and storage provider is the limiting factor in transfer rate. 3. _Deal shows up on-chain_: Once the data is received, the storage provider verifies that it matches the deal parameters. Then, the provider publishes the deal on the chain. 4. _Sector sealing_: Once the deal shows up on-chain, the storage provider must still generate Proof-of-Replication and seal the sector. This process is currently estimated to take roughly 1.5 hours for a 32 GB sector on a machine that meets the minimum hardware requirements for storage providers. For the majority of clients, the most important metric is the time from deal acceptance to deal appearance on-chain. This metric is the sum of the time required to complete steps (1) through (3), described above. Based on current high-level benchmarks, these steps are estimated to take roughly 5-10 minutes for a 1 MiB file. [hashtag](https://docs.filecoin.io/networks/mainnet/network-performance#data-retrieval) Data retrieval ----------------------------------------------------------------------------------------------------------- There are two methods by which one can directly retrieve data from the Filecoin network: * **Fast retrieval**: By default, some Filecoin clients, like lotus, enable storage providers to store an unsealed copy of the stored data in addition to a sealed copy. The sealed copy is necessary for the ongoing storage proofs that a storage provider must submit, while the unsealed copy can be used for quicker retrievals of the data from the storage provider. While this is a valuable feature, there is no guarantee that all storage providers are storing extra unsealed copies of the stored data, as this is not a verifiable part of the protocol. In lotus, this feature is called _fast-retrieval_. * **Retrieval after unsealing**: Because of the Filecoin protocol’s design, storage providers are essentially cryptographically guaranteed to store client data in its sealed format. Therefore, if the storage provider doesn’t have an unsealed copy of the data stored, they will have to unseal the sealed data first (i.e., decoding the encoded data) and then serve it back up to the requester (i.e., the retrieval client). In both methods, the data retrieval process after a retrieval deal is accepted includes: 1. **Funding the payment channel for retrieval**: Similar to the storage deal payment channel funding above, except for data retrieval. The timing estimates for payment channel creation and funding are roughly the same as noted above. 2. **Unsealing (if needed)**: The storage provider unseals (decodes) the data so that the requester can read it. Sealing and unsealing are symmetric processes, which means they take roughly the same amount of time in either direction. Thus, the unsealing step is estimated to take around as long as the sealing step listed above, or around ~3 hours for a 32 GiB sector on a machine running minimum hardware requirements. 3. **Data transfer**: The storage provider begins transferring the data back to the data requester. This is also transferred back at a rate similar to the original data transfer rate, which depends on several factors. Because of the various steps involved in the data retrieval process, Filecoin storage currently meets similar performance bars as traditional _warm_ or _cold_ storage. To get performance that is similar to other hot storage solutions, most users utilize Filecoin with a caching layer such as IPFS. These hybrid and multi-tiered storage solutions use IPFS for hot storage and Filecoin for affordable, frequent, and versioned backups. Some example hybrid storage products include [Lighthousearrow-up-right](https://www.lighthouse.storage/) and [web3.storagearrow-up-right](https://web3.storage/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/mainnet/network-performance) [PreviousRPCschevron-left](https://docs.filecoin.io/networks/mainnet/rpcs) [NextCalibrationchevron-right](https://docs.filecoin.io/networks/calibration) Last updated 1 year ago * [Financial transfers](https://docs.filecoin.io/networks/mainnet/network-performance#financial-transfers) * [Data storage](https://docs.filecoin.io/networks/mainnet/network-performance#data-storage) * [Data retrieval](https://docs.filecoin.io/networks/mainnet/network-performance#data-retrieval) sun-brightdesktopmoon sun-brightdesktopmoon --- # FAQs | Filecoin Docs Here’s a collection of general FAQs that the team has gathered. If you are looking for more technical FAQs, please head to [Filecoin Community Discussionarrow-up-right](https://github.com/filecoin-project/community/discussions/categories/q-a) . [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-fvm) **What is FVM** ------------------------------------------------------------------------------------------------------ The [FVMarrow-up-right](https://fvm.filecoin.io/) (Filecoin virtual machine) enables developers to write and deploy custom code to run on top of the Filecoin blockchain. This means developers can create apps, markets, and organizations built around data stored on Filecoin. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-broader-implications-does-fvm-have) **What broader implications does FVM have** -------------------------------------------------------------------------------------------------------------------------------------------------------------- FVM allows us to think about data stored on Filecoin differently. Apps can now build a new layer on the Filecoin network to enable trading, lending, data derivatives, and decentralized organizations built around datasets. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-problems-does-fvm-solve) **What problems does FVM solve** ---------------------------------------------------------------------------------------------------------------------------------------- FVM can create incentives to solve problems that Filecoin participants face today around data replication, data aggregation, and liquidity for miners. Beyond these, there is a long tail of data storage and retrieval problems that will also be resolved by user programmability on top of Filecoin. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-does-aptos-compare-to-fvm) **How does Aptos compare to FVM** ------------------------------------------------------------------------------------------------------------------------------------------ [Aptosarrow-up-right](https://aptoslabs.com/) is a Move-based L1 chain, whereas FVM is a WASM runtime on the Filecoin chain. The latter comes with an EVM right of the box; the former does not. The FVM also supports programmable storage with deals on Filecoin. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-does-the-fvm-directly-interact-with-data-on-filecoin) **How does the FVM directly interact with data on Filecoin** ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ The FVM operates on blockchain state data — it does _not_ operate on data stored in the Filecoin network. This is because access to that data depends on network requests, an unsealed copy’s availability, and the SPs’ availability to supply that data. Access and manipulation of data stored in the network will happen via L2 solutions, for example, retrieval networks or compute-over-data networks, e.g., Saturn or CoD. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-other-evms-compare-to-fevm) **How do other EVMs compare to FEVM** -------------------------------------------------------------------------------------------------------------------------------------------------- Unlike other EVM chains, FEVM specifically allows you to write contracts that orchestrate programmable storage. This means contracts that can coordinate storage providers, data health, perpetual storage mechanisms, and more. Other EVM chains do not have direct access to Filecoin blockchain state data. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-an-actor) **What is an actor** ---------------------------------------------------------------------------------------------------------------- An actor is code that the Filecoin virtual machine can run. Actors are also referred to as smart contracts. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-are-built-in-actors) **What are built-in actors** -------------------------------------------------------------------------------------------------------------------------------- [Built-in actorsarrow-up-right](https://github.com/filecoin-project/builtin-actors) are code that come precompiled into the Filecoin clients and can be run using the FVM. They are similar to [Ethereum precompilesarrow-up-right](https://www.evm.codes/precompiled?fork=merge) . [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#why-use-the-fevm-vs-any-other-evm-compatible-chain) **Why use the FEVM vs any other EVM compatible chain** ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Having storage contracts as a native primitive open to smart contract developers. Reduce costs of writing to storage from an EVM smart contract to a separate storage service. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#why-fevm-vs-native-fvm) **Why FEVM vs native FVM** ---------------------------------------------------------------------------------------------------------------------------- FEVM allows Solidity developers to easily write/port actors to the FVM using the tools that have already been introduced in the Ethereum ecosystem. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-applications-make-fvm-fevm-unique) **What applications make FVM/FEVM unique** ------------------------------------------------------------------------------------------------------------------------------------------------------------ Applications that natively make use of storage contracts. Perpetual storage contracts, Data DAOs, etc. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-perpetual-storage) **What is perpetual storage** ---------------------------------------------------------------------------------------------------------------------------------- Perpetual storage is a unique actor design paradigm only available on the FVM that allows users the ability to renew Filecoin storage deals and to keep them active indefinitely. This could be achieved by using a Decentralized Autonomous Organization (DAO) structure for example. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-are-data-daos) **What are Data DAOs** -------------------------------------------------------------------------------------------------------------------- Data DAOs are a unique design paradigm FVM developers could create which use Filecoin storage to store all their data instead of a service like AWS (which is currently used). [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#is-fvm-part-of-filecoin-clients-like-lotus) **Is FVM part of Filecoin clients like Lotus** -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Yes. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#do-i-have-to-install-lotus-to-work-with-fvm) **Do I have to install Lotus to work with FVM** ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Not necessarily. You can use any of the public RPC nodes on either [mainnet](https://docs.filecoin.io/networks/mainnet) or the \[Calibration testnet\](/networks/calibration/details/ * `api.hyperspace.node.glif.io/rpc/v1` * `api.zondax.ch/fil/node/hyperspace/rpc/v1` [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-the-difference-between-the-fvm-and-bacalhau) **What is the difference between the FVM and Bacalhau** -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- They are synergistic. Compute over data solutions such as [Bacalhauarrow-up-right](https://github.com/filecoin-project/bacalhau) can use the FVM. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#why-does-the-fvm-use-wasm) **Why does the FVM use WASM** ---------------------------------------------------------------------------------------------------------------------------------- Many [different languagesarrow-up-right](https://github.com/appcypher/awesome-wasm-langs) already compile to WASM so developers can pick their favorite. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#is-the-fevm-a-bridge-to-the-evm) **Is the FEVM a bridge to the EVM** ---------------------------------------------------------------------------------------------------------------------------------------------- No, the FEVM is its own instance of the EVM built on top of Filecoin. You will need to redeploy smart contracts that exist in the EVM to the FEVM. Bridges can be built to top of the FEVM which connect it to other blockchains however. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-is-the-filecoin-network-accessed-through-solidity) **How is the Filecoin network accessed through Solidity** ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ When an EVM is deployed to FEVM, it is compiled with WASM and an actor instance is created in FEVM that runs the EVM bytecode. The user-defined FEVM actor is then able to interact with the Filecoin network via built-in actors like the Market and Miner APIs. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#can-i-deploy-evm-bytecode-to-the-native-fvm) **Can I deploy EVM bytecode to the native FVM** ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- No, it must be deployed to the FEVM. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-frontend-framework-should-i-use) **What frontend framework should I use?** --------------------------------------------------------------------------------------------------------------------------------------------------------- React, Ethers.js, web.js, ReactJS work well. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-we-convert-from-msg.sender-in-a-fevm-contract-which-returns-an-evm-0x-address-to-the-underlyi) **How do we convert from msg.sender in a FEVM contract, which returns an EVM** `**0x**` **address, to the underlying Filecoin** `**f**` **address?** ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ You can use the npm [`@glif/filecoin-address`arrow-up-right](https://www.npmjs.com/package/@glif/filecoin-address) package or the [Zondax mock APIarrow-up-right](https://github.com/Zondax/fevm-solidity-mock-api) has the constructor that calls `mock_generate_deals();`. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-i-bound-the-replicator-factor-from-solidity-fevm) **How do I bound the replicator factor from solidity FEVM?** ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Store a number limit on running `DealClient` and `publish_deal` and have it authorized to replicate. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-can-i-use-fvm-to-store-data-to-filecoin) **How can I use FVM to store data to Filecoin** ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- The intent of FEVM/FVM is to compute over state data (the metadata of your stored data). Storage providers are the ones that are able to store your data and upload the deal to the Filecoin network. Data retrieval happens via Retrieval Providers, accepting the client’s ask to retrieve and working with storage providers to decrypt the data to deliver to the client. FEVM/FVM is able to build logic around these 2 processes and automate, add verification and proofs, time-lock retrievals etc. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-i-close-a-storage-deal-on-filecoin-and-stop-storage-providers-sp-from-storing-my-data-on-chai) **How do I close a storage deal on Filecoin and stop storage providers (SP) from storing my data on-chain** ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- It’s not impossible but storage providers are incentivized not to close the storage deal as they are slashed for not providing [Proof of Spacetime (PoSt)](https://docs.filecoin.io/reference/general/glossary#proof-of-spacetime-post) . Someone has to pay for the broken promise a miner makes to the chain and you need a custom market actor for it most likely to make the deal. You need to make deals for a certain amount of time - right now the boundaries are 6-18 months. You cannot ask a storage provider to take down your data without contacting them off-chain. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/faqs) [PreviousSupportchevron-left](https://docs.filecoin.io/smart-contracts/fundamentals/support) [NextFilecoin EVM-runtimechevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime) Last updated 5 months ago * [What is FVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-fvm) * [What broader implications does FVM have](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-broader-implications-does-fvm-have) * [What problems does FVM solve](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-problems-does-fvm-solve) * [How does Aptos compare to FVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-does-aptos-compare-to-fvm) * [How does the FVM directly interact with data on Filecoin](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-does-the-fvm-directly-interact-with-data-on-filecoin) * [How do other EVMs compare to FEVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-other-evms-compare-to-fevm) * [What is an actor](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-an-actor) * [What are built-in actors](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-are-built-in-actors) * [Why use the FEVM vs any other EVM compatible chain](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#why-use-the-fevm-vs-any-other-evm-compatible-chain) * [Why FEVM vs native FVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#why-fevm-vs-native-fvm) * [What applications make FVM/FEVM unique](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-applications-make-fvm-fevm-unique) * [What is perpetual storage](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-perpetual-storage) * [What are Data DAOs](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-are-data-daos) * [Is FVM part of Filecoin clients like Lotus](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#is-fvm-part-of-filecoin-clients-like-lotus) * [Do I have to install Lotus to work with FVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#do-i-have-to-install-lotus-to-work-with-fvm) * [What is the difference between the FVM and Bacalhau](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-is-the-difference-between-the-fvm-and-bacalhau) * [Why does the FVM use WASM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#why-does-the-fvm-use-wasm) * [Is the FEVM a bridge to the EVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#is-the-fevm-a-bridge-to-the-evm) * [How is the Filecoin network accessed through Solidity](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-is-the-filecoin-network-accessed-through-solidity) * [Can I deploy EVM bytecode to the native FVM](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#can-i-deploy-evm-bytecode-to-the-native-fvm) * [What frontend framework should I use?](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#what-frontend-framework-should-i-use) * [How do we convert from msg.sender in a FEVM contract, which returns an EVM 0x address, to the underlying Filecoin f address?](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-we-convert-from-msg.sender-in-a-fevm-contract-which-returns-an-evm-0x-address-to-the-underlyi) * [How do I bound the replicator factor from solidity FEVM?](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-i-bound-the-replicator-factor-from-solidity-fevm) * [How can I use FVM to store data to Filecoin](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-can-i-use-fvm-to-store-data-to-filecoin) * [How do I close a storage deal on Filecoin and stop storage providers (SP) from storing my data on-chain](https://docs.filecoin.io/smart-contracts/fundamentals/faqs#how-do-i-close-a-storage-deal-on-filecoin-and-stop-storage-providers-sp-from-storing-my-data-on-chai) sun-brightdesktopmoon sun-brightdesktopmoon --- # Aggregated deal-making | Filecoin Docs Filecoin is designed to store large data for extended periods. Small-scale data (<4 GiB) can be combined with other small deals into larger ones, either on-chain or off-chain. Smart contracts can handle programmatic data storing. This article explains the process, referring to small-scale data as _sub-piece data_. For context, a [_piece_arrow-up-right](https://spec.filecoin.io/systems/filecoin_files/piece/) of data in Filecoin refers to a unit of negotiation for data to be stored on Filecoin. A sub-piece refers to a sub-unit of that larger piece. These are typically small data like NFT images, short videos and more. Aggregation is the process of combining multiple packages of _sub-piece data_ into a single package. This large package is stored on the Filecoin network instead of multiple smaller packages. Aggregation can be done off-chain or on-chain. Copy @@ -14,61 +16,61 @@ Aggregation is the process of combining multiple packages of _sub-piece data_ in The base interface for aggregation requires the following components: 1. A client who has data to upload. 2. An aggregator platform that clients can interact with to request to make a storage deal and retrieve Proof of Deal Sub-piece Inclusion (PoDSI) from. 3. An aggregation node to aggregate the sub-piece data into a larger file and to provide PoDSI that can be called via an API endpoint. Aggregation of data always happens off-chain. This is typically hosted by the aggregator platform 4. An optional aggregation smart contract that clients can submit an on-chain request to, to request an off-chain aggregation node to make a storage deal ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Ffilecoin-project%2Ffilecoin-docs%2Fassets%2F113331491%2F29d6cc11-680e-4aa1-9c3c-422cb12795c7&width=768&dpr=3&quality=100&sign=f99495a6&sv=2) How aggregation happens ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making#proof-of-deal-sub-piece-inclusion-podsi) Proof of Deal Sub-piece Inclusion (PoDSI) Proof of Deal Sub-piece Inclusion (PoDSI) is motivated by a need for sub-piece data uploads to eventually issue verification and proof that the data was included in an associated deal on Filecoin. PoDSI is heavily used in the aggregated deal-making workflow. PoDSI is a proof construction and is generated for each sub-piece CID (within the large data segment) and stored in an off-chain database. The proof consists of two elements: 1. An inclusion proof of a sub-tree, which contains the size and position of the sub-piece data in the larger aggregated data piece, corresponding to the tree of the aggregator's committed larger aggregated data piece. 2. An inclusion proof of the double leaf data segment descriptor, which describes the sub-piece data within the larger data segment index, which is contained at the end of a deal, describing all the data segments contained within that deal. Lighthouse.storage is the first aggregator platform to enable PoDSI. You can view the tutorial in their docs [herearrow-up-right](https://docs.lighthouse.storage/) . Read more about the technical details of PoDSI [herearrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0058.md#proof-of-data-segment-inclusion) . #### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making#requesting-for-aggregation-off-chain) Requesting for aggregation off-chain To request for aggregation and PoDSI off-chain, developers interact with an aggregator platform: 1. The client submits sub-piece data to an aggregator platform. The aggregator prepares the data and generates the sub-piece CID, known as pCID, and URL to download the CAR file. 2. The aggregator hosts an off-chain aggregation node, which aggregates the sub-piece CAR files into a larger aggregated CAR file. 3. Simultaneously, the aggregator aggregates indexed data segments (based on specs [herearrow-up-right](https://github.com/filecoin-project/FIPs/discussions/512) ). It runs the proofing library and generates PoDSI proofs for each sub-piece pCID, storing them in an off-chain database. 4. The aggregator uses programmatic deal-making or [manual deal-makingarrow-up-right](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. 5. Storage Providers download the aggregated CAR file and publish storage deals. 6. Clients can query a proofing endpoint provided by the aggregator, which will look up the sub-piece CID (pCID) in the database and return the PoDSI proof, aggregated CID, and associated deal ID. 7. Clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. [Lighthouse.storagearrow-up-right](https://www.lighthouse.storage/) is the first aggregator platform available. You can find their docs on how to utilize their SDK for the above process [herearrow-up-right](https://docs.lighthouse.storage/) . ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Ffilecoin-project%2Ffilecoin-docs%2Fassets%2F113331491%2F47691259-5665-43c7-bea6-79ed2b453f86&width=768&dpr=3&quality=100&sign=85be4985&sv=2) Requesting for aggregation of data to store, via an off-chain platform #### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making#requesting-for-aggregation-on-chain) Requesting for aggregation on-chain On-chain aggregation and PoDSI requests go through aggregator oracle smart contracts: 1. The client [prepares the dataarrow-up-right](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals#data-preparation) and generates the sub-piece CID, known as pCID (CommPc). Here is an easy [data preparation toolarrow-up-right](https://data.lighthouse.storage/) by lighthouse.storage. 2. The client submits a sub-piece CID (CommPc) with metadata (e.g. URL to download the sub-piece CAR file) directly to the aggregation smart contract. 3. The aggregator watches the aggregation contract, and when the aggregator decides there are enough sub-pieces, it downloads all sub-piece data, to generate the aggregated piece from the CAR file URL. 4. The aggregator aggregates indexed data segments into a larger data file for deal-making (based on specs [herearrow-up-right](https://github.com/filecoin-project/FIPs/discussions/512) ). 5. The aggregator combines the sub-piece data into the aggregated CommP (CommPa) by computing within aggregator's off-chain node. 6. The aggregator uses programmatic deal-making or [manual deal-makingarrow-up-right](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. 7. Storage Providers download the aggregated CAR file and publish storage deals. Upon the client's request, they can find the data via sub-piece CID. 8. Clients can query the aggregation smart contract, which notifies the aggregator platform to look up the sub-piece CID (pCID) in its aggregation node's database and return the PoDSI proof, aggregated CID, and associated deal ID. 9. Simultaneously, clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Ffilecoin-project%2Ffilecoin-docs%2Fassets%2F113331491%2F3588073e-a98e-4245-8a85-a087f4e403d2&width=768&dpr=3&quality=100&sign=83be6d9d&sv=2) Requesting for aggregation of data to store, via an on-chain smart contract To build your own on-chain aggregator oracle smart contract, check out one of the implementations with [Filecoin Data Toolsarrow-up-right](https://github.com/application-research/fevm-data-segment) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making) [PreviousProgrammatic storagechevron-left](https://docs.filecoin.io/smart-contracts/programmatic-storage) [NextDirect deal-makingchevron-right](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making) Last updated 3 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Direct deal-making | Filecoin Docs There are services like deal aggregators that allow clients to create storage deals programmatically. However, aggregators are better suited to small-scale deals of under 4 GiB of total data. For those wishing to programmatically store larger blocks of data, _direct deal-making_ is a more suitable process. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#steps) Steps ------------------------------------------------------------------------------------------------------------ We're going to cover the basic steps of _direct deal-making_. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#package-the-data) Package the data The client packages the data they want to store into a CAR file. They then upload this to a hosting intermediary service and generate a CID. [Storage on-ramp services](https://docs.filecoin.io/basics/how-storage-works/storage-onramps) are available to act as this intermediary. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#on-chain-process) On-chain process Using the CID and URL provided by the hosting service, the client can deploy the client contract and propose a storage deal. Once the client contract is deployed, an event is emitted on-chain, and storage providers running [Boostarrow-up-right](https://boost.filecoin.io/experimental-features/fvm-contract-deals) will receive the deal proposal. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#storage-providers) Storage providers Each storage provider will decide whether to take the proposal and pick up the deal. There are a variety of factors influencing whether or not a storage provider will accept the deal, including if there is a pre-existing relationship between the client and the storage provider, whether the deal is financially attractive to the storage provider if they can accommodate the size of the data, or whether clients have datacap. If the storage provider accepts the deal through Boost, that provider will download the CAR file from the web server and publish the storage deal on-chain. A client can check that the deal was successfully published on the blockchain via [block explorers](https://docs.filecoin.io/networks/mainnet/explorers) . A storage deal published on-chain denotes the _intent_ for a storage provider to make a storage deal. But this _intent_ does not mean that the deal is _complete_. The deal is only complete once a storage provider has sealed the data into sectors and the deal ID is published on-chain. #### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#timelines) Timelines The timelines for the published storage deals and the deal ID confirmation are inherently undefined. Storage providers do not necessarily publish storage deals once they come in. Depending on the size of the data, the storage provider may wait until they have enough data from other deals to fill a sector. Deals made on the Calibration testnet will be picked-up within 24 hours. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#review) Review -------------------------------------------------------------------------------------------------------------- Here is a diagram showing each of these steps in turn: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-0b9891ddc2920447ed402675af7cf6333a421df8%252Fsmart-contracts-programmatic-storage-direct-deal-making-diagram.png%3Falt%3Dmedia%26token%3Deb27e751-6fc7-4b4f-8559-d805f5cec91c&width=768&dpr=3&quality=100&sign=72920141&sv=2) [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#next-steps) Next steps ---------------------------------------------------------------------------------------------------------------------- For a complete tutorial on how to use the client contract to initiate a deal from FVM, see our [client contract tutorial](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial) . A full explanation of the client contract in the context of a direct deal-making starter kit can be found [herearrow-up-right](https://github.com/filecoin-project/fvm-starter-kit-deal-making/tree/main) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making) [PreviousAggregated deal-makingchevron-left](https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making) [NextCross-Chain Data Bridge(CCDB)chevron-right](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb) Last updated 1 year ago * [Steps](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#steps) * [Package the data](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#package-the-data) * [On-chain process](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#on-chain-process) * [Storage providers](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#storage-providers) * [Review](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#review) * [Next steps](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making#next-steps) sun-brightdesktopmoon sun-brightdesktopmoon --- # Mainnet | Filecoin Docs circle-info Also see [Mainnet RPCs](https://docs.filecoin.io/networks/mainnet/rpcs) and [Mainnet Explorers](https://docs.filecoin.io/networks/mainnet/explorers) . **Maintainer**: [Protocol Labsarrow-up-right](https://protocol.ai/) [hashtag](https://docs.filecoin.io/networks/mainnet#genesis) Genesis ------------------------------------------------------------------------- * CAR File: `QmavMCf95w2UMYGD1J5GpHcWBWXR2jTFYmtAkgeroMmpk1` * Reset Timestamp: `2020-08-24T22:00:00Z` * Genesis Block CID: `bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2` * SHA-1 Digest: `4782cb42b4b01793b5cd9f593cc3dc87b6d3c7b4` [hashtag](https://docs.filecoin.io/networks/mainnet#network-parameters) Network parameters ----------------------------------------------------------------------------------------------- * Supported Sector Sizes: `32 GiB` and `64 GiB` * Consensus Miner Min Power: `10 TiB` * Epoch Duration Seconds: `30` * Expected Leaders per Epoch: `5` * WindowPoSt Proving Period: `2880` * WindowPoSt Challenge Window: `60` * WindowPoSt Period Deadlines: `48` * Pre-Commit Challenge Delay: `150` [hashtag](https://docs.filecoin.io/networks/mainnet#bootstrap-peers) Bootstrap peers ----------------------------------------------------------------------------------------- Bootstrap peers for mainnet can be found at: `https://github.com/filecoin-project/lotus/blob/release/`**\[latest release\]**`/build/bootstrap/mainnet.pi` The latest Lotus release can be found at https://github.com/filecoin-project/lotus/releases/latest/ [hashtag](https://docs.filecoin.io/networks/mainnet#resources) Resources ----------------------------------------------------------------------------- * [Latest lightweight snapshotarrow-up-right](https://forest-archive.chainsafe.dev/latest/mainnet/) generated with [Forestarrow-up-right](http://github.com/ChainSafe/forest) by [ChainSafearrow-up-right](https://chainsafe.io/) * [Complete Filecoin blockchain archival dataarrow-up-right](https://forest-archive.chainsafe.dev/list/) generated with [Forestarrow-up-right](http://github.com/ChainSafe/forest) by [ChainSafearrow-up-right](https://chainsafe.io/) * [Status page and incidentsarrow-up-right](https://filecoin.statuspage.io/) * [Slack Channel for Updates: #fil-network-announcementsarrow-up-right](https://filecoinproject.slack.com/archives/C01AC6999KQ) * [Slack Channel for Questions: #fil-helparrow-up-right](https://filecoinproject.slack.com/archives/CEGN061C5) * [Mainnet block explorer: FilFOXarrow-up-right](https://filfox.info/en) * [Mainnet Faucet - Forest Explorerarrow-up-right](https://forest-explorer.chainsafe.dev/faucet/mainnet) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/mainnet) [PreviousRelaychevron-left](https://docs.filecoin.io/smart-contracts/advanced/relay) [NextExplorerschevron-right](https://docs.filecoin.io/networks/mainnet/explorers) Last updated 1 year ago * [Genesis](https://docs.filecoin.io/networks/mainnet#genesis) * [Network parameters](https://docs.filecoin.io/networks/mainnet#network-parameters) * [Bootstrap peers](https://docs.filecoin.io/networks/mainnet#bootstrap-peers) * [Resources](https://docs.filecoin.io/networks/mainnet#resources) sun-brightdesktopmoon sun-brightdesktopmoon --- # Tools | Filecoin Docs ### [hashtag](https://docs.filecoin.io/reference/general/tools#infrastructure-libraries) Infrastructure libraries These infrastructure libraries and tools exist to speed up the development of software on top of the Filecoin network. #### [hashtag](https://docs.filecoin.io/reference/general/tools#filecoin-javascript-standard-library) Filecoin Javascript Standard Library > Connect apps to the Filecoin blockchain with iso-filecoin. **Features** * Lightweight, performant and type-safe * Support for RPC, Signature, Address, Token, Chain, Wallet and more. * React hooks and context to easily integrate Filecoin wallets * Wallet adapters for Ledger Filecoin App, MetaMask Filecoin Wallet, and more. **Packages** * [iso-filecoinarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin) - Core package * [iso-filecoin-reactarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin-react) - React hooks and context * [iso-filecoin-walletsarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin-wallets) - Wallet adapters **Resources** * [Documentationarrow-up-right](https://filecoin.hugomrdias.dev/) #### [hashtag](https://docs.filecoin.io/reference/general/tools#filsnap) ⨎ Filsnap > A MetaMask [Snaparrow-up-right](https://snaps.metamask.io/snap/npm/filsnap/) > to add Filecoin support to the MetaMask extension. **Features** * Enables dapps access to Filecoin accounts using Metamask. * Manage Filecoin accounts, check balance, address, export private key and more. * Send and receive FIL from native and FEVM addresses. * Sign Filecoin messages and arbitrary data. * Send Filecoin messages and estimate gas fees. * Filecoin insights for FEVM transaction/signature requests. **Resources** * [Companion Apparrow-up-right](https://filsnap.dev/) * [Documentationarrow-up-right](https://filecoin-project.github.io/filsnap/) **Packages** * [filsnaparrow-up-right](https://github.com/filecoin-project/filsnap/tree/master/packages/snap) - Filecoin snap for Metamask * [filsnap-adapterarrow-up-right](https://github.com/filecoin-project/filsnap/tree/master/packages/adapter) - Adapter to interact with Filsnap from a dapp * [filsnap-adapter-reactarrow-up-right](https://github.com/filecoin-project/filsnap/tree/master/packages/adapter-react) - React hooks to interact with Filsnap from a dapp #### [hashtag](https://docs.filecoin.io/reference/general/tools#filecoin-addresses) Filecoin addresses The _filecoin-address_ library is a JavaScript implementation of the Filecoin address type, and can create new address instances, encode addresses, and decode and validate checksums. For further information, including how to install and use, see the [GitHub repositoryarrow-up-right](https://github.com/glifio/modules/tree/primary/packages/filecoin-address) . ### [hashtag](https://docs.filecoin.io/reference/general/tools#built-in-native-actors) Built-in Native Actors These are some tools that developers will find useful when dealing with built-in actors. * [WASM Actors Repoarrow-up-right](https://github.com/filecoin-project/builtin-actors) * [FVM Example Actorsarrow-up-right](https://github.com/filecoin-project/fvm-example-actors) * [FVM AssemblyScript SDKarrow-up-right](https://github.com/Zondax/fvm-as-sdk) by Zondax * [FVM TinyGo SDKarrow-up-right](https://www.notion.so/Filecoin-Virtual-Machine-FVM-Developer-Resources-94cabfd650184f4b9664bd4974e4d329) by Venus (IPFSForce) * [FVM High-level Rust SDKarrow-up-right](https://github.com/polyphene/fvm-rs-sdk) by Polyphene * [Tooling by Glifarrow-up-right](https://glif.io/en) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/general/tools) [PreviousSpecificationschevron-left](https://docs.filecoin.io/reference/general/specifications) [NextExchangeschevron-right](https://docs.filecoin.io/reference/exchanges) Last updated 8 months ago * [Infrastructure libraries](https://docs.filecoin.io/reference/general/tools#infrastructure-libraries) * [Built-in Native Actors](https://docs.filecoin.io/reference/general/tools#built-in-native-actors) sun-brightdesktopmoon sun-brightdesktopmoon --- # RaaS interfaces | Filecoin Docs RaaS has a base and full interface to enable replication, renew and repair of storage deals. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#self-hosted-raas) Self-hosted RaaS ------------------------------------------------------------------------------------------------------------------------------- RaaS refers to replication, renewal and repair as a service, for data stored in storage deals on Filecoin. Developers can leverage the self-hosted RaaS to provide RaaS features, within their storage solution, using the RaaS Starter Kit. Self-hosted RaaS requires 4 components: * The Client who has data to upload * An Aggregator platform (a type of storage solution) that receives the Client’s data and makes a storage deal on Filecoin * The RaaS node, hosted by the developer, that checks if the storage deal requires replication, renewal and/or repair * The RaaS DealStatus smart contract that the RaaS node executes checks with ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#in-the-example-of-replication) In the example of replication: 1. The client generates a `CID` for the data and requests the RaaS node to store data. 2. The RaaS node takes the client’s data and makes the storage deal onto Filecoin. 3. The client registers a replication job to the RaaS node and defines the number of replicas of their data to store, by calling the `/register_jobs` API on the RaaS node (e.g. “This data needs to have a minimum of 10 copies on the network”). 4. The RaaS node periodically checks the client data’s `CID` for its deal status on Filecoin. * The RaaS node requests deal status with the DealStatus smart contract, via `getActiveDeals(CID)` and checks if the client’s data is stored with the accurate number of replicas. * The DealStatus smart contract returns the information of active deals to the RaaS node. 5. If the number of replicas does not match the client’s requirements, the RaaS node is notified. 6. The RaaS node fetches the data via its `CID` and resubmit a request to create new storage deals (repeat step 2). 7. When the client requests for retrieval of data, it queries the RaaS node, which will fetch the data from the storage provider on Filecoin or provide an IPFS pinned copy (depends on how RaaS node is setup to store the data). ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#in-the-example-of-renewal) In the example of renewal: 1. The client generates a `CID` for the data and requests the RaaS node to store data. 2. The RaaS node takes the client’s data and makes the storage deal onto Filecoin. 3. The client registers a renewal job to the RaaS node and defines the renewal threshold for the data’s storage deal, by calling the `/register_jobs` API on the RaaS node (e.g. renew storage deals that are 1 month away from expiry). 4. The RaaS node periodically checks the client data’s `CID` for its deal status on Filecoin. * The RaaS node requests deal status with the DealStatus smart contract, via `getExpiringDeals(CID)` and checks if any of its active deals is expiring. * The DealStatus smart contract returns the information of expiring deals to the RaaS node. 5. If deals with the client’s data are expiring, the RaaS node is notified. 6. The RaaS node fetches the data via its `CID` and resubmit a request to create new storage deals (repeat step 2). 7. When the client requests for retrieval of data, it queries the RaaS node, which will fetch the data from the storage provider on Filecoin or provide an IPFS pinned copy (depends on how RaaS node is setup to store the data). ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#in-the-example-of-repair) In the example of repair 1. The client generates a `CID` for the data and requests the RaaS node to store data. 2. The RaaS node takes the client’s data and makes the storage deal onto Filecoin. 3. The client registers a repair job to the RaaS node and defines the repair threshold for the data’s storage deal, by calling the `/register_jobs` API on the RaaS node (e.g. “this deal needs repairing if it is not proven active for X epochs”). 4. The RaaS node periodically checks with [Lotusarrow-up-right](https://lotus.filecoin.io/lotus/get-started/what-is-lotus/) , if the deal ID and corresponding miner, is actively being proven by the miner on Filecoin. The node calls `StateMarketStorageDeal`, with provided deal and miner IDs. 5. If the deal ID and corresponding deal sector are not being actively proven for X epochs, the deal will require repairing. 6. The RaaS node fetches the data via its `CID` and resubmit a request to create new storage deals (repeat step 2). Check out the [RaaS starter kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) to build your own RaaS interface. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#aggregator-hosted-raas) Aggregator-hosted RaaS ------------------------------------------------------------------------------------------------------------------------------------------- The aggregator-hosted RaaS refers to a solution that requires an aggregator to host all the components of RaaS and provides a seamless interface to the client. [Lighthouse.storagearrow-up-right](https://www.lighthouse.storage/) is the first FVM project to provide an aggregator-hosted RaaS, via its SDK. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces) [PreviousData replication, renewal and repair (RaaS)chevron-left](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas) [NextDeveloping contractschevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts) Last updated 1 year ago * [Self-hosted RaaS](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#self-hosted-raas) * [In the example of replication:](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#in-the-example-of-replication) * [In the example of renewal:](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#in-the-example-of-renewal) * [In the example of repair](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#in-the-example-of-repair) * [Aggregator-hosted RaaS](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces#aggregator-hosted-raas) sun-brightdesktopmoon sun-brightdesktopmoon --- # Programmatic storage | Filecoin Docs Programmatic storage is a concept where storage operations are controlled, automated, or orchestrated through code. Processes like reading, writing, and data management can all happen automatically and without human intervention. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage#manual-storage) Manual storage ----------------------------------------------------------------------------------------------------------- A client must go through several steps to manually store something with a storage provider on Filecoin without using the FVM. These steps involve interacting with the Filecoin network, negotiating a deal with a storage provider, and performing various other operations to ensure the data is stored correctly and securely. We discuss how storage works in the [Basics section](https://docs.filecoin.io/basics/how-storage-works) but let's quickly summarize the process here: 1. **Identify a storage provider (SP)**: Clients must identify storage providers who will store their data. Clients usually pick their storage providers based on geographic location and bandwidth limitations, although other factors may impact their decision. 2. **Negotiate a deal**: Clients negotiate deals with storage providers. These deals include terms like data size, price, deal duration, and collateral. The deal-making process happens off-chain, and once both parties agree to the terms of a deal, that deal is published on-chain for the rest of the network to see and validate. To successfully store data on Filecoin, clients need to have enough FIL to cover the deal's cost. 3. **Data preparation**: Before storing files on Filecoin, clients must import them into their local Filecoin node, which produces a data CID (Content Identifier) - an ID uniquely describing the content. Then, the data is transferred to the storage provider. 4. **Deal publication**: The deal is published on-chain, making the storage provider publicly accountable for the deal. 5. **Sealing and proving storage**: The storage provider stores the data in sectors. Sectors are the basic units of provable storage where storage providers store clients’ data and generate Proof-of-Spacetime (PoSt) on behalf of the Filecoin network. Sectors have standard sizes and a lifetime that storage providers can extend before reaching the end of the lifetime. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage#programmatic-storage) Programmatic storage ----------------------------------------------------------------------------------------------------------------------- The [Filecoin virtual machine (FVM)](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime) is not designed to directly interact with data on Filecoin. Instead, it operates on blockchain state data, which includes metadata about stored data. The FVM's role is to compute over this state data and create logic around the storage and retrieval process. Storage and retrieval providers on the Filecoin network handle the actual process of storing and retrieving data. Developers can use FVM actors (also called smart-contracts) to implement various use cases related to data storage and retrieval on the Filecoin network. For instance, they can automate the process of renewing and repairing storage deals, replicating data across multiple storage providers for redundancy, or implement access control for data. This process for programmatically storing data on Filecoin differs depending on how much data you need to store. Anything less than 4 GiB of data is considered _small_, while anything 4 GiB or above is considered _large_. Lets cover the process for both _small_ and _large_ storage deals: ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage#small-scale-storage) Small-scale storage Storage deals for less than 4 GiB of data are considered _small_ on the Filecoin network. This is because storage providers use sectors of either 32 GiB or 64 GiB. Because of these comparably large sector sizes, SPs are incentivized to accept storage deals closer to this cap size. An SP will receive more FIL rewards for storing a 31 GiB file rather than a 200 KiB file. Clients will have difficulty finding a storage provider to accept deals for small amounts of data. To get around this problem, these developers can _aggregate_ their data into bundles. The deal-aggregation process bundles a collection of small storage deals with many others to create one large deal. Checkout out [lighthouse.storagearrow-up-right](https://lighthouse.storage/documentation) for an example of a deal aggregator. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage#large-scale-storage) Large-scale storage Storage deals for more than 4 GiB don't suffer from the limitations of small-scale storage deals. Large-scale deals can be processed and sent to an SP directly without aggregating data. The client contract performs _direct_ deal making to automatically finds an SP to store your data. There are other considerations an SP must make when deciding to pick up your data deal proposals from the client contract. For example, some SPs may only deal with clients with whom they have an existing relationship with. For more information regarding client contracts and how they work, checkout the [client contract tutorial](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial) . 1. **Upload data to a data depot**: Data depots hold your data for the duration of this process so that you don't have to maintain your connection to the network. Once an SP verifiably holds your data, the data depot discards your data. After uploading your data to a depot, the depot will give you all the information you need to fill out the client contract. 2. **Deploy a client contract**: The deal client contract coordinates the handshaking required on FVM to load your data into the Filecoin network. 3. **Create a deal-proposal payload**: Once your data is ready in the data depot and your client contract has been deployed, you can create your deal-proposal payload. This payload contains everything a storage provider needs to download and store a copy of your data. 4. **Deal publication and activation**: An SP picks up your contract and downloads the data from the data depot. Check out the [Deal Making Starter Kitarrow-up-right](https://github.com/filecoin-project/fvm-starter-kit-deal-making) for additional information on how this process works. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage) [PreviousPrecompileschevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles) [NextAggregated deal-makingchevron-right](https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making) Last updated 1 year ago * [Manual storage](https://docs.filecoin.io/smart-contracts/programmatic-storage#manual-storage) * [Programmatic storage](https://docs.filecoin.io/smart-contracts/programmatic-storage#programmatic-storage) * [Small-scale storage](https://docs.filecoin.io/smart-contracts/programmatic-storage#small-scale-storage) * [Large-scale storage](https://docs.filecoin.io/smart-contracts/programmatic-storage#large-scale-storage) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin Pin Github Action | Filecoin Docs `filecoin-pin` can be used in CI pipelines like GitHub Actions to upload assets to the Filecoin decentralized storage network. Static website assets are particularly good candidates, given the existing tooling within the IPFS ecosystem for static website retrieval. The [Filecoin Pin repoarrow-up-right](https://github.com/filecoin-project/filecoin-pin) has an [example upload to Filecoin GitHub Actionarrow-up-right](https://github.com/filecoin-project/filecoin-pin/tree/master/upload-action) that can be used directly or as a starting point for your own CI pipeline. The example filecoin-pin upload action itself has a [usage examplearrow-up-right](https://github.com/filecoin-project/filecoin-pin/tree/master/upload-action/examples) , and you can even see it in production as part of [filecoin-pin-website's CI pipelinearrow-up-right](https://github.com/filecoin-project/filecoin-pin-website/tree/main/.github/workflows) ! Below is also a video walkthrough of the example GitHub Action in use! Note: there is more work coming soon to add "filecoin-pin functionality" directly to the robust [ipshipyard/ipfs-deploy-actionarrow-up-right](https://github.com/ipshipyard/ipfs-deploy-action) ([tracking issuearrow-up-right](https://github.com/ipshipyard/ipfs-deploy-action/issues/39) ). [PreviousFilecoin Pin CLIchevron-left](https://docs.filecoin.io/builder-cookbook/filecoin-pin/filecoin-pin-cli) [NextFilecoin Pin dApp Demochevron-right](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo) Last updated 3 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Table of Contents | Filecoin Docs #### [hashtag](https://docs.filecoin.io/builder-cookbook/table-of-contents#data-storage) Data Storage * **Store Data** * [Prepare data for Filecoin storage](https://docs.filecoin.io/builder-cookbook/data-storage/store-data#prepare-data-for-filecoin-storage) * [Store large data with smart contract](https://docs.filecoin.io/builder-cookbook/data-storage/store-data#store-large-data-with-the-smart-contract) * [Store small data with storage onramps](https://docs.filecoin.io/builder-cookbook/data-storage/store-data#store-small-data-with-storage-onramps) * [Manage storage deals with RaaS](https://docs.filecoin.io/builder-cookbook/data-storage/store-data#manage-storage-deals-with-raas) * [Monitor storage deal status from a smart contract](https://docs.filecoin.io/builder-cookbook/data-storage/store-data#monitor-storage-deal-status-from-a-smart-contract) * [Incentivized data storage](https://docs.filecoin.io/builder-cookbook/data-storage/store-data#incentivized-data-storage) * **Retrieve Data** * [Retrieve data using retrieval clients](https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data#retrieve-data-using-retrieval-clients) * **Ensure Data Privacy & Access Control** * [Encrypting data for storing on Filecoin](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control#encrypting-data-for-storing-on-filecoin-ipfs) * [Gated access to your dataset](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control#gated-access-to-your-dataset) #### [hashtag](https://docs.filecoin.io/builder-cookbook/table-of-contents#dapps-development) dApps Development * **Chain-Data Query** * [Connecting to Filecoin networks via public RPC nodes](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#connecting-to-filecoin-networks-via-public-rpc-nodes) * [Listen to smart contract events](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#listen-to-smart-contract-events) * [Filter smart contract events](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#filter-smart-contract-events) * **Oracle** * [Feed token prices to smart contract](https://docs.filecoin.io/builder-cookbook/dapps/oracles#feed-token-prices-to-smart-contract) * **Cross-Chain Bridge** * [Bridge wFIL with Axelar](https://docs.filecoin.io/builder-cookbook/dapps/cross-chain-bridges#bridge-wfil-with-axelar) * **Decentralized Database** * [Store data with Tableland](https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database#store-data-with-tableland) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/table-of-contents) [PreviousOverviewchevron-left](https://docs.filecoin.io/builder-cookbook/overview) [NextData Storagechevron-right](https://docs.filecoin.io/builder-cookbook/data-storage) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # How gas works | Filecoin Docs When executing a message that invokes an EVM contract, the Filecoin virtual machine charges for the message chain inclusion (when the message originates off-chain) and then invokes the actor that hosts the contract. The actor is an instance of the EVM actor, which uses the Filecoin EVM runtime interpreter to execute the contract. The FEVM interpreter must first load its state, including the contract state, which costs additional gas. The interpreter then begins the execution of the contract bytecode. Each opcode interpreted may perform computation, syscalls, state i/o, and send new messages, all of which are charged with FIL gas. Finally, if the contract state is modified, the interpreter must flush it to the blockstore, which costs additional gas. Generally, it is not possible to compute gas costs for a contract invocation without using gas estimation through speculative execution. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#calculation-example) Calculation example ----------------------------------------------------------------------------------------------------------------------------------- The total gas fee of a message is calculated as the following: Copy (Gas usage × Base fee) + (GasLimit × GasPremium) + (OverEstimationBurn × BaseFee) Take a look at the [Gas usage section of the How Filecoin works page](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works) for more information on the various gas-related parameters attached to each message. Let’s take a transaction as an example. Our gas parameters are: * `GasUsage` = `1000` attoFIL * `BaseFee` = `20` attoFIL * `Gas limit` = `2000` attoFIL * `Gas premium` = `5` attoFIL The total fee is `(GasUsage × BaseFee) + (Gaslimit x GasPremium)`: Copy 1000 x 20 = 20000 2000 x 5 = 10000 20000 + 10000 = 30000 attoFIL Additionally, the message sender can also set the `GasFeeCap` parameter they are willing to pay. If the sender sets the `GasLimit` too high, the network will compute the amount of gas to be refunded and the amount of gas to be burned as `OverEstimationBurn`. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#estimate-gas) Estimate gas --------------------------------------------------------------------------------------------------------------------- Filecoin nodes, such as Lotus, have several JSON-API API endpoints designed to help developers estimate gas usage. The available JSON-RPC APIs are: * `GasEstimateMessageGas`: estimate gas values for a message without any gas fields set, including GasLimit, GasPremium, and GasFeeCap. Returns a message object with those gas fields set. * `GasEstimateGasLimit` takes the input message and estimates the `GasLimit` based on the execution cost as well as a transaction multiplier. * `GasEstimateGasPremium`: estimates what `GasPremium` price you should set to ensure a message will be included in `N` epochs. The smaller `N` is the larger `GasPremium` is likely to be. * `GasEstimateFeeCap`: estimate the `GasFeeCap` according to `BaseFee` in the parent blocks. If you want to learn more about how to use those JSON-RPC APIs for the Filecoin gas model, please check the [JSON RPC API docs for Gas](https://docs.filecoin.io/reference/json-rpc) . Gas estimation varies from network to network. For example, the `BaseFee` on mainnet is different from the `BaseFee` on the Calibration testnet. If you’d rather not calculate and estimate gas for every message, you can just leave the optional fields unset. The gas fields will be estimated and set when the message is pushed to the mempool. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#ethereum-compatibility) Ethereum compatibility ----------------------------------------------------------------------------------------------------------------------------------------- Since Filecoin is fully EVM-compatible, Filecoin nodes also provide Ethereum-compatible APIs to support gas estimation: * [EthEstimateGas](https://docs.filecoin.io/reference/json-rpc/eth#ethestimategas) : generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [EthMaxPriorityFeePerGas](https://docs.filecoin.io/reference/json-rpc/eth#ethmaxpriorityfeepergas) : returns a fee per gas that is an estimate of how much you can pay as a priority fee, or “tip”, to get a transaction included in the current block. To request the current max priority fee in the network, you can send a request to a public Filecoin endpoint: This will output something like: You can convert the `result` field from hexadecimal to base 10 in your terminal. Take the `result` output and remove the `0x` from the start. Then use `echo` to output the conversion: [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#additional-resources) Additional Resources ------------------------------------------------------------------------------------------------------------------------------------- * Gas Filecoin improvement proposals (FIPs): * [FIP 0032arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0032.md) * [FIP 0037arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0037.md) * [FIP 0054arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0054.md) * [Primitive Gas Price listarrow-up-right](https://github.com/filecoin-project/ref-fvm/blob/master/fvm/src/gas/price_list.rs) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works) [PreviousDifference with Ethereumchevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum) [NextPrecompileschevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles) Last updated 5 months ago * [Calculation example](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#calculation-example) * [Estimate gas](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#estimate-gas) * [Ethereum compatibility](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#ethereum-compatibility) * [Additional Resources](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works#additional-resources) sun-brightdesktopmoon Copy curl --location --request POST 'https://api.calibration.node.glif.io/rpc/v1' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":"2.0", "method":"eth_maxPriorityFeePerGas", "params": null, "id":1 }' | jq Copy { "jsonrpc": "2.0", "result": "0x31157", "id": 1 } Copy echo $((16#31157)) # 201047 sun-brightdesktopmoon --- # Precompiles | Filecoin Docs The Filecoin virtual machine (FVM) has several pre-compiled contracts called precompiles. Each precompile address starts with `0xfe000...`. Specifically: * [Resolve address `0xfe00..01`](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#resolve-address) * [Lookup delegated address `0xfe00..02`](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#lookup-delegated-address) * [Call actor by address `0xfe00..03`](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#call-actor-by-address) * [Call actor by ID `0xfe00..05`](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#call-actor-by-id) [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#resolve-address) Resolve Address ------------------------------------------------------------------------------------------------------------------------- Address: `0xfe00000000000000000000000000000000000001` Resolves a Filecoin address (e.g., “f01”, “f2abcde”) into a Filecoin actor ID (`uint64`). Every actor in Filecoin has an actor ID. * Input: The Filecoin address in its _bytes_ representation. * Output: * If the target actor exists, succeed and return an ABI-encoded actor ID (u64). * If the target actor doesn’t exist, succeed with no return value. * If the supplied address is invalid (cannot be parsed as a Filecoin address), revert. Example: Copy (bool success, bytes memory actor_id_bytes) = address(0xfe00000000000000000000000000000000000001).staticcall(fil_address_bytes); require(success, "invalid address"); require(actor_id_bytes.length == 32, "actor not found"); uint64 actor_id = abi.decode(actor_id_bytes); [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#lookup-delegated-address) Lookup Delegated Address ------------------------------------------------------------------------------------------------------------------------------------------- Address: `0xfe00000000000000000000000000000000000002` Looks up the “delegated address” (f4 address) of an actor by ID. This precompile is _usually_ used to lookup the Ethereum-style address of an actor by: 1. Looking up the delegated address. 2. Checking that the delegated address is 22 bytes long and starts with `0x040a`. 3. Returning the last 20 bytes (which will be the Ethereum-style address of the target actor). * Input: An ABI-encoded actor ID (u64 encoded as a u256). * Output: * If the supplied actor ID is larger than max u64, revert. * If the target actor exists and has a delegated address, succeed and return the delegated address as raw bytes. * Otherwise, succeed with no return value. Example: [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#call-actor-by-address) Call Actor By Address ------------------------------------------------------------------------------------------------------------------------------------- Address: `0xfe00000000000000000000000000000000000003` Calls the specified actor using the native FVM calling convention by its _Filecoin_ address. This precompile must be called with `DELEGATECALL` as the precompile will call the target actor _on behalf of_ the currently executing contract. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#input-abi-encoded) Input: ABI Encoded * `method` is the Filecoin method number. The precompile will revert if the method number is not either 0 (bare value transfer) or at least 1024. Methods between 1 and 1023 inclusive are currently restricted (but may be allowed in the future). * `value` is the value to transfer in attoFIL. * `codec` is the IPLD codec of the parameters. This must either be 0x51 or 0x00 (for now) and will revert if passed an illegal codec: * If the parameters are non-empty, they must be CBOR, and the codec must be 0x51. * If the parameters are empty, the codec must be 0x00. * `params` are the CBOR-encoded message parameters, if any. * `filAddress` is the Filecoin address of the caller. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#output-abi-encoded) Output: ABI Encoded * `exit_code` is one of: * `= 0` to indicate the call exited successfully. * `> 0` to indicate that the target actor _reverted_ with the specified `exit_code`. * `< 0` to indicate the call itself failed with the [syscall-errorarrow-up-right](https://docs.rs/fvm_sdk/0.6.1/fvm_sdk/sys/enum.ErrorNumber.html) `-exit_code`. * `return_codec` codec of returned data. This will be one of (for now): * 0x51 or 0x71 - CBOR * 0x55 - raw (the target actor returned raw data) * 0x00 - nothing (the returned data will be empty as well). triangle-exclamation This precompile only reverts if an input is statically invalid. If the precompile fails to call the target actor for any other reason, it will return a non-zero `exit_code` but will not revert. Example: [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#call-actor-by-id) Call Actor By ID --------------------------------------------------------------------------------------------------------------------------- Address: `0xfe00000000000000000000000000000000000005` This precompile is identical to the “Call Actor By Address” (0xfe00..03) except that it accepts an actor ID (`uint64`) instead of an actor address as the last parameter. That is: Example: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles) [PreviousHow gas workschevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works) [NextProgrammatic storagechevron-right](https://docs.filecoin.io/smart-contracts/programmatic-storage) Last updated 1 year ago * [Resolve Address](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#resolve-address) * [Lookup Delegated Address](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#lookup-delegated-address) * [Call Actor By Address](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#call-actor-by-address) * [Input: ABI Encoded](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#input-abi-encoded) * [Output: ABI Encoded](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#output-abi-encoded) * [Call Actor By ID](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles#call-actor-by-id) sun-brightdesktopmoon Copy (bool success, bytes memory delegated_address_bytes) = address(0xfe00000000000000000000000000000000000002).staticcall(abi.encode(uint256(actor_id))); Copy (uint64 method, uint256 value, uint64 flags, uint64 codec, bytes params, bytes filAddress) Copy (int256 exit_code, uint64 return_codec, bytes return_value) Copy (bool success, bytes memory data) = address(0xfe00000000000000000000000000000000000003).delegatecall(abi.encode(method, value, flags, codec, params, filAddress)); (int256 exit, uint64 return_codec, bytes memory return_value) = abi.decode(data, (int256, uint64, bytes)); Copy (uint64 method, uint256 value, uint64 flags, uint64 codec, bytes params, uint64 actorId) Copy (bool success, bytes memory data) = address(0xfe00000000000000000000000000000000000005).delegatecall(abi.encode(method, value, flags, codec, params, id)); (int256 exit, uint64 return_codec, bytes memory return_value) = abi.deco sun-brightdesktopmoon --- # Retrieve Data | Filecoin Docs ### [hashtag](https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data#retrieve-data-using-retrieval-clients) Retrieve data using retrieval clients To retrieve data stored on the Filecoin network, the basic process involves making retrieval requests to Service Providers (SPs) who initially stored the data, using either the Content ID (CID) or the storage deal ID. A programmatic option is to utilize Filecoin retrieval clients, which handle the intricate retrieval process behind the scenes. By simply providing a Content ID (CID), retrieval clients can efficiently return your data either via the command-line interface (CLI) or through the programmable method. #### [hashtag](https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data#ingredients) **Ingredients** With a given CID, you can use any of the following retrieval clients to retrieve content. * [Lassiearrow-up-right](https://github.com/filecoin-project/lassie) : optimizes for most efficient available retrieval protocols. * [go-cararrow-up-right](https://github.com/ipld/go-car) : a content addressable archive utility. * [Saturnarrow-up-right](https://saturn.tech/) : a Web3 CDN in Filecoin’s retrieval market. #### [hashtag](https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data#instructions) **Instructions** 1. **retrieving content with Lassie** Lassie is designed to fetch content in the content-addressed archive (CAR) form. In most cases, you will require additional tooling, such as the go-car library, to work with CAR files effectively. The Lassie command line interface (CLI) provides the simplest method for retrieving content from the Filecoin/IPFS network. By using the `lassie fetch` command and passing the CID as an argument, you can easily retrieve the desired content. Copy lassie fetch -o - | car extract For example, Copy lassie fetch -p bafybeic56z3yccnla3cutmvqsn5zy3g24muupcsjtoyp3pu5pm5amurjx4 | car extract Lassie can also serve as a go library within your Golang application when programmatically retrieving content from the network. To utilize Lassie in your code, you need to install the dependency and import it into your program following the instructions [herearrow-up-right](https://github.com/filecoin-project/lassie?tab=readme-ov-file#golang-library) . The following example demonstrates how to use the Lassie library to fetch a CID. 1. **retrieving content with Saturn** circle-info [Saturn Javascript Clientarrow-up-right](https://github.com/filecoin-saturn/js-client) is still a work in progress and not recommended for use in production yet. The following code example demonstrates how to use the Saturn in the Javascript program to fetch a CID. * * * For quick retrieval of existing datasets with the methods above, check out the [Filecoin Dataset Explorerarrow-up-right](https://datasets.filecoin.io/) . * * * [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data) [PreviousStore Datachevron-left](https://docs.filecoin.io/builder-cookbook/data-storage/store-data) [NextPrivacy & Access Controlchevron-right](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control) Last updated 1 year ago sun-brightdesktopmoon Copy package main import ( "context" "fmt" "os" "github.com/filecoin-project/lassie/pkg/lassie" "github.com/filecoin-project/lassie/pkg/storage" "github.com/filecoin-project/lassie/pkg/types" "github.com/ipfs/go-cid" trustlessutils "github.com/ipld/go-trustless-utils" ) // main creates a default lassie instance and fetches a CID func main() { ctx := context.Background() // Create a default lassie instance lassie, err := lassie.NewLassie(ctx) if err != nil { panic(err) } // Prepare the fetch rootCid := cid.MustParse("bafybeic56z3yccnla3cutmvqsn5zy3g24muupcsjtoyp3pu5pm5amurjx4") // The CID to fetch store := storage.NewDeferredStorageCar(os.TempDir(), rootCid) // The place to put the CAR file request, err := types.NewRequestForPath(store, rootCid, "", trustlessutils.DagScopeAll, nil) // The fetch request if err != nil { panic(err) } // Fetch the CID stats, err := lassie.Fetch(ctx, request) if err != nil { panic(err) } // Print the stats fmt.Printf("Fetched %d blocks in %d bytes\n", stats.Blocks, stats.Size) } Copy import { Saturn } from '@filecoin-saturn/js-client'; // initialize a Saturn instance const saturn = new Saturn({ clientKey: "...", // Key used for verification // ... other options }); // fetch content using the client with given CID const cidPath = 'https://samplepath/ipfs/{cid}'; const options = { fallbackLimit: 5, raceNodes: true, }; (async () => { try { for await (const chunk of saturn.fetchContentWithFallback(cidPath, options)) { // Process each chunk of data console.log(chunk); } } catch (error) { console.error('Error fetching content:', error); } })(); sun-brightdesktopmoon --- # Data Storage | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage) [PreviousTable of Contentschevron-left](https://docs.filecoin.io/builder-cookbook/table-of-contents) [NextStore Datachevron-right](https://docs.filecoin.io/builder-cookbook/data-storage/store-data) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Advanced | Filecoin Docs [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/advanced) [PreviousBest practiceschevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/best-practices) [NextWrapped FILchevron-right](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Actor types | Filecoin Docs The Filecoin EVM runtime introduces three new actor types: 1. [Placeholder actors](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#placeholder) . 2. [Ethereum-style accounts](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#ethereum-style-account) , also called `EthAccount`. 3. [EVM smart contracts](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#evm-smart-contract) . [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#placeholder) Placeholder ----------------------------------------------------------------------------------------------------------------- A _placeholder_ is a particular type of pseudo-actor that holds funds until an actual actor is deployed at a specific address. When funds are sent to an address starting with `f410f` that doesn’t belong to any existing actor, a _placeholder_ is created to hold the said funds until either an account or smart contract is deployed to that address. A placeholder can become a _real_ actor in one of two ways: 1. A message is sent from the account that would exist at that placeholder’s address. If this happens, the placeholder is automatically upgraded into an account. 2. An EVM smart contract is deployed to the address. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#ethereum-style-account) Ethereum-style account --------------------------------------------------------------------------------------------------------------------------------------- An Ethereum-style account is the Filecoin EVM runtime equivalent of an account with an `f1` or `f3` address, also known as native accounts. However, there are a few key differences: 1. These accounts have `0x`\-style addresses and an equivalent `f`\-style address starting with `f410f`. 2. Messages from these accounts can be sent with Ethereum wallets like MetaMask by connecting the wallet to a Filecoin client. 3. These accounts can be used to transfer funds to native or Ethereum-style. 4. They can be used to call EVM smart contracts and can be used to deploy EVM smart contracts. However, they cannot be used to call native actors such as multisig or miner actors. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#evm-smart-contract) EVM smart contract ------------------------------------------------------------------------------------------------------------------------------- An EVM smart contract actor hosts a single EVM smart contract. Every EVM smart contract will have a `0x`\-style address. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#deploying) Deploying An EVM smart contract can be deployed in one of three ways: 1. An existing EVM smart contract can use the EVM’s `CREATE`/`CREATE2` opcode. 2. Ethereum-native tooling can be used in conjunction with an Ethereum-style account such as [Remix](https://docs.filecoin.io/smart-contracts/developing-contracts/remix) or [Hardhat](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat) . 3. A native account can call method `4` on the Ethereum account manager `f010`, passing the EVM init code as a CBOR-encoded byte-string (major type 2) in the message parameters. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#calling) Calling An EVM smart contract may be called in one of three ways: 1. An EVM smart contract can use the EVM’s `CALL` opcode. 2. Ethereum-native tooling, like [MetaMask](https://docs.filecoin.io/basics/assets/metamask-setup) , can be used in conjunction with an Ethereum-style account. 3. Finally, a native account can call method `3844450837` (`FRC42(InvokeEVM)`): 1. The input data should either be empty or encoded as a CBOR byte string. 2. The return data will either be empty or encoded as a CBOR byte string. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types) [PreviousFilecoin EVM-runtimechevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime) [NextAddress typeschevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types) Last updated 1 year ago * [Placeholder](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#placeholder) * [Ethereum-style account](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#ethereum-style-account) * [EVM smart contract](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#evm-smart-contract) * [Deploying](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#deploying) * [Calling](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types#calling) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin Pin | Filecoin Docs [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin#status) 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.cloudarrow-up-right](https://filecoin.cloud/) . [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin#what-is-filecoin-pin) 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 Mainnetarrow-up-right](https://docs.ipfs.tech/concepts/glossary/#mainnet) tooling like Kubo, Helia, and IPFS HTTP Gateways while gaining Filecoin's persistence guarantees [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin#who-is-filecoin-pin-for) 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. [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin#how-to-get-started) How to Get Started ------------------------------------------------------------------------------------------------------------ Get started using Filecoin Pin today with: 1. [Filecoin Pin CLI](https://docs.filecoin.io/builder-cookbook/filecoin-pin/filecoin-pin-cli) - 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](https://docs.filecoin.io/builder-cookbook/filecoin-pin/github-action) - 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](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo) - 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](https://docs.filecoin.io/builder-cookbook/filecoin-pin/erc-8004-agent-registration) - Learn how to register a trustless autonomous agent on the ERC-8004 Identity Registry with verifiable persistent storage for agent metadata using Filecoin Pin. [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin#learn-more) Learn More -------------------------------------------------------------------------------------------- * [**FAQ**](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq) - Common questions about Filecoin Pin * [**Filecoin Pin GitHub Repository**arrow-up-right](https://github.com/filecoin-project/filecoin-pin) - Source code and technical documentation * [**Community and Support**arrow-up-right](https://github.com/filecoin-project/filecoin-pin?tab=readme-ov-file#community-and-support) - Join the community for real-time developer support and updates. [PreviousDecentralized Databasechevron-left](https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database) [NextFilecoin Pin CLIchevron-right](https://docs.filecoin.io/builder-cookbook/filecoin-pin/filecoin-pin-cli) Last updated 5 months ago * [Status](https://docs.filecoin.io/builder-cookbook/filecoin-pin#status) * [What is Filecoin Pin?](https://docs.filecoin.io/builder-cookbook/filecoin-pin#what-is-filecoin-pin) * [Who is Filecoin Pin for?](https://docs.filecoin.io/builder-cookbook/filecoin-pin#who-is-filecoin-pin-for) * [How to Get Started](https://docs.filecoin.io/builder-cookbook/filecoin-pin#how-to-get-started) * [Learn More](https://docs.filecoin.io/builder-cookbook/filecoin-pin#learn-more) sun-brightdesktopmoon sun-brightdesktopmoon --- # Address types | Filecoin Docs Filecoin has five address classes, and actors tend to have _multiple_ addresses. Furthermore, each address class has its own rules for converting between binary and text. The goal of using different types of addresses is to provide a robust address format that is scalable, easy to use, and reliable. These addresses encode information including: * Network prefix: indicates the network the actor belongs to. * Protocol indicator: identify the type and version of this address. * Payload: identify the actor according to the protocol. * Checksum: validate the address. Filecoin addresses can be represented either as raw bytes or a string. Raw bytes format will always be used on-chain. An address can also be encoded to a string, including a checksum and network prefix. The string format will never appear on-chain and is only for human-readable purposes. Filecoin address can be broken down like this: Network prefix Protocol indicator Payload Checksum `f` / `t` 1 byte: `0` / `1` / `2` / `3` / `4` _n_ bytes 4 bytes The network prefix is prepended to an address when encoding to a string. The network prefix indicates which network an address belongs to. Network prefixes never appear on-chain and are only used when encoding an address to a human-readable format. * `f` - addresses on the Filecoin mainnet. * `t` - addresses used on any Filecoin testnet. The protocol indicator identifies the address type, which describes how a method should interpret the information in the `payload` field of an address. * `0`: An ID address. * `1`: A wallet address generated from a secp256k public key. * `2`: An actor address. * `3`: A wallet address generated from BLS public key. * `4`: A delegated address for user-defined foreign actors: * `410`: Ethereum-compatible address space managed by the Ethereum address manager (EAM). Each 410 address is equivalent to an 0x address. Each address type is described below. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#id-addresses) ID addresses --------------------------------------------------------------------------------------------------------------------- All addresses have a short integer assigned to them by `InitActor` sequentially, a unique actor that can create _new_ actors. The integer that gets assigned is the ID of that actor. An _ID address_ is an actor’s ID prefixed with the network identifier and the protocol indicator. Therefore, any address in the Filecoin network has a unique ID address assigned to it. The mainnet burn account ID address is `f099` and is structured as follows: [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#actor-addresses) Actor addresses --------------------------------------------------------------------------------------------------------------------------- Addressed representing an actor deployed through the init actor in the Filecoin network. It provides a way to create robust addresses for actors not associated with a public key. They are generated by taking a `sha256` hash of the output of the account creation. Actor addresses are often referred to by their shorthand, `2`. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#wallet-addresses) Wallet addresses ----------------------------------------------------------------------------------------------------------------------------- Addresses managed directly by users, like accounts, are derived from a public-private key pair. If you have access to a private key, you can sign messages sent from that wallet address. The public key is used to derive an address for the actor. Public key addresses are referred to as _robust addresses_ as they do not depend on the Filecoin chain state. Public key addresses allow devices, like hardware wallets, to derive a valid Filecoin address for your account using just the public key. The device doesn’t need to ask a remote node what your ID address is. Public key addresses provide a concise, safe, human-readable way to reference actors before the chain state is final. ID addresses are a space-efficient way to identify actors in the Filecoin chain state, where every byte matters. Filecoin supports two types of public key addresses: * [secp256k1 addressesarrow-up-right](https://en.bitcoin.it/wiki/Secp256k1) that begin with the protocol indicator as `1`. * [BLS addressesarrow-up-right](https://en.wikipedia.org/wiki/BLS_digital_signature) that begin with the protocol indicator as `3`. `t1iandfn6d...ddboqxbhoeva` - a testnet wallet address generated using secp256k1. `t3vxj34sbdr3...road7cbygq` - a testnet wallet address generated using BLS. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#delegated-addresses) Delegated addresses ----------------------------------------------------------------------------------------------------------------------------------- Filecoin supports extensible, user-defined actor addresses through the `4` address class, introduced in [Filecoin Improvement Proposal (FIP) 0048arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md) . The `4` address class provides the following benefits to the network: * Implement foreign addressing systems in Filecoin. * A predictable addressing scheme to support interactions with addresses that do not yet exist on-chain. * User-defined, programmable addressing systems without extensive changes and network upgrades. For example, a testnet delegated address using the Ethereum Addressing System is structured as follows: The _address manager actor ID_ is the actor ID of the address manager actor, which creates new actors and assigns a `4` address to the new actor. This leverages the extensible feature of the `f4` address class. The _new actor ID_ is the arbitrary actor ID chosen by that actor. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#restrictions) Restrictions Currently, per [FIP 0048arrow-up-right](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md) , `f4` addresses may only be assigned by and in association with specific, built-in actors called _address managers_. This restriction will likely be relaxed once users are able to deploy custom WebAssembly actors. This address type plays an essential role in supporting the FEVM. It allows the Filecoin network to be able to recognize the foreign address and validate and execute the transactions sent and signed by the supported foreign addresses. The supported foreign addresses can be cast as `f4/t4` addresses, and vice-versa. But not with `f1/t1` or `f3/t3` addresses. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#ethereum-address-manager) Ethereum Address Manager Ethereum Address Manager (EAM) is a built-in actor that manages the Ethereum address space, anchored at the `410` address namespace. It acts like an EVM smart contract factory, offering methods to create and assign the `f410/t410` Filecoin address to Ethereum address. The subaddress of an `f410/t410` address is the original Ethereum address. Ethereum addresses can be cast as `f410` addresses, and vice-versa. The `f410/t410` address will be used for the Ethereum-compatible FVM (FEVM) development tools and applications built on FEVM. **Example** If you have an Ethereum wallet address starting with `0x`, then the Ethereum Address Manager (EAM) will assign a corresponding `t410` Filecoin address to it. If you send 10 TFIL to `0xd388ab098ed3e84c0d808776440b48f685198498` using a wallet like MetaMask, you will receive 10 TFIL to your `t410f2oekwcmo2pueydmaq53eic2i62crtbeyuzx2gmy` address on Filecoin Calibration testnet. Again, assume you have deployed a solidity smart contract on Filecoin Calibration. Then you will receive a smart contract address starting with `t410`. EAM will also assign a corresponding `0x` Ethereum address to it. When you try to invoke this smart contract on Filecoin using Ethereum tooling, you need to use your `0x5f6044198a16279f87d2839c998893858bbf8d9c` smart contract address. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#converting-to-a-0x-style-address) Converting to a 0x-style Address The Filecoin EVM runtime introduces support for `0x` Ethereum-style addresses. Filecoin addresses starting with either `f0` or `f410f` can be converted to the `0x` format as follows: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-9e2c7ba214b5dd660be4a623d7d1e9f3809efe9a%252Fethereum-address-conversion.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ae14c1a9&sv=2) Filecoin to Ethereum Address Conversion Addresses starting with `f0` can be converted to the `0x` format by: * Extracting the `actor_id` (e.g., the `1234` in `f01234`). * Hex encode with a `0xff` prefix: `sprintf("0xff0000000000000000000000%016x", actor_id)`. Addresses starting with `f410f` address can be converted to the `0x` format by: * Removing the `f410f` prefix. * Decoding the remainder as base 32 (RFC 4648 without padding). * Trim off the last 4 bytes. This is a _checksum_ that can optionally be verified, but that’s beyond the scope of this documentation. * Assert that the remaining address is 20 bytes long. * Hex-encode: `sprintf(0x%040x", actor_id)`. triangle-exclamation `f0` addresses are **not** re-org stable and should not be used until the chain has settled. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#converting-to-a-filecoin-address) Converting to a Filecoin Address On the flip side, Ethereum-style addresses can be converted to a Filecoin address as follows: Addresses starting with `0xff0000000000000000000000` can be converted to a Filecoin address by: * Decoding the last 16 hex digits into a uint64 * Format the address as `f0${decimal(id)}` where decimal(id) is the decimal representation of the decoded actor ID. Otherwise, it maps to f410f… [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types) [PreviousActor typeschevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types) [NextFILForwarderchevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder) Last updated 1 year ago * [ID addresses](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#id-addresses) * [Actor addresses](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#actor-addresses) * [Wallet addresses](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#wallet-addresses) * [Delegated addresses](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#delegated-addresses) * [Restrictions](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#restrictions) * [Ethereum Address Manager](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#ethereum-address-manager) * [Converting to a 0x-style Address](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#converting-to-a-0x-style-address) * [Converting to a Filecoin Address](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#converting-to-a-filecoin-address) sun-brightdesktopmoon Copy Protocol Indicator | f 0 9 9 | | | Actor ID | Network identifier Copy Address manager actor ID | t 410 iandfn6d... | | | New actor ID | Network identifier Copy # An Ethereum wallet address. 0xd388ab098ed3e84c0d808776440b48f685198498 # The corresponding Filecoin address on Calibration. t410f2oekwcmo2pueydmaq53eic2i62crtbeyuzx2gmy Copy # A Filecoin smart contract address. t410fl5qeigmkcytz7b6sqoojtcetqwf37dm4zv4aijq # The corresponding Ethereum smart contract address. 0x5f6044198a16279f87d2839c998893858bbf8d9c sun-brightdesktopmoon --- # Fundamentals | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals#develop-on-filecoin) Develop on Filecoin ------------------------------------------------------------------------------------------------------------- Filecoin combines the benefits of content-addressed data leveraged by IPFS with blockchain-powered storage guarantees. The network offers robust and resilient distributed storage at massively lower cost compared to current centralized alternatives. Developers choose Filecoin because it: * is the world’s largest distributed storage network, without centralized servers or authority * offers on-chain proofs to verify and authenticate data * is highly compatible with [IPFSarrow-up-right](https://ipfs.tech/) and content addressing * is the only decentralized storage network with petabyte-scale capacity * stores data at extremely low cost (and keeps it that way for the long term) [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals#filecoin-and-ipfs) Filecoin and IPFS --------------------------------------------------------------------------------------------------------- How do Filecoin and IPFS work together? They are complementary protocols for storing and sharing data in the distributed web. Both systems are open-source and share many building blocks, including content addressing (CIDs) and network protocols (libp2p). IPFS does not include built-in mechanisms to incentivize the storage of data for other people. To persist IPFS data, you must either run your own IPFS node or pay a provider. This is where Filecoin comes in. Filecoin adds an incentive layer to content-addressed data. Storage deals are recorded on-chain, and providers must submit proofs of storage to the network over time. Payments, penalties, and block rewards are all enforced by the decentralized protocol. Filecoin and IPFS are designed as separate layers to give developers more choice and modularity, but many tools are available for combining their benefits. This diagram illustrates how these tools (often called storage helpers) provide developer-friendly APIs for storing on IPFS, Filecoin, or both. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-1fcc69f71ac4840f9586a78b74f279875444bbfb%252Fsmart-contracts-fundamentals-overview-web3-architecture.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=48690944&sv=2) Web3-Enabled Architecture by Filecoin [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals#filecoin-and-smart-contracts) Filecoin and smart contracts ------------------------------------------------------------------------------------------------------------------------------- You can improve speed and reduce gas fees by storing smart contract data on Filecoin. With Filecoin, the data itself is stored off-chain, but is used to generate verifiable CIDs and storage proofs that are recorded on the Filecoin chain and can be included in your smart contracts. This design pairs well with multiple smart contract networks such as Ethereum, Polygon, Avalanche, Solana, and more. Your smart contract only needs to include the compact content ids. [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals#get-started) Get started --------------------------------------------------------------------------------------------- Let’s get building. Choose one of the following APIs. These are all storage helpers, or tools and services that abstract Filecoin’s robust deal making processes into simple, streamlined API calls. * [Akave Storage APIarrow-up-right](https://docs.akave.xyz/) - for projects needing S3 compatibility * [NFT.storagearrow-up-right](https://nft.storage/) - for NFT data * [Web3.storagearrow-up-right](https://web3.storage/) - for general application data Examples: * [Polygon tutorialarrow-up-right](https://github.com/protocol/nft-website/blob/main/docs/tutorial/mint-nftstorage-polygon.md) * [Flow tutorialarrow-up-right](https://github.com/protocol/nft-website/blob/main/docs/tutorial/flow-nft-marketplace.md) * [Avalanche tutorialarrow-up-right](https://github.com/protocol/nft-website/blob/main/docs/tutorial/avax-nft.md) * [Using IPFS & Filecoin on Harmonyarrow-up-right](https://docs.harmony.one/home/developers/tutorials/ipfs-filecoin) [hashtag](https://docs.filecoin.io/smart-contracts/fundamentals#additional-resources) Additional resources --------------------------------------------------------------------------------------------------------------- * [Filecoin integrations for Web3 infrastructurearrow-up-right](https://www.youtube.com/watch?v=Q0oe6i7d1u4) (video) * [What is an IPFS Pinning Service?arrow-up-right](https://medium.com/pinata/what-is-an-ipfs-pinning-service-f6ed4cd7e475) (Pinata explainer) * [IPFS documentation: Persistence, permanence and pinningarrow-up-right](https://docs.ipfs.tech/concepts/persistence/) * [Developing on Filecoinarrow-up-right](https://www.youtube.com/watch?v=aGCpq0Xf-w8) (video) * Textile tools: [videoarrow-up-right](https://www.youtube.com/watch?v=IZ8M9m9_uJY) and [documentationarrow-up-right](https://docs.textile.io/) * [Building decentralized apps using Fleek’s Space daemonarrow-up-right](https://www.youtube.com/watch?v=pWJ5fty-7mA) (video) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals) [PreviousSpin up a lite-nodechevron-left](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) [NextThe Filecoin Virtual Machinechevron-right](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) Last updated 3 months ago * [Develop on Filecoin](https://docs.filecoin.io/smart-contracts/fundamentals#develop-on-filecoin) * [Filecoin and IPFS](https://docs.filecoin.io/smart-contracts/fundamentals#filecoin-and-ipfs) * [Filecoin and smart contracts](https://docs.filecoin.io/smart-contracts/fundamentals#filecoin-and-smart-contracts) * [Get started](https://docs.filecoin.io/smart-contracts/fundamentals#get-started) * [Additional resources](https://docs.filecoin.io/smart-contracts/fundamentals#additional-resources) sun-brightdesktopmoon sun-brightdesktopmoon --- # Calibration | Filecoin Docs circle-info Also see [Calibration RPCs](https://docs.filecoin.io/networks/calibration/rpcs) and [Calibration Explorers](https://docs.filecoin.io/networks/calibration/explorers) . The calibration network is the most realistic testnet simulation of the Filecoin mainnet. [hashtag](https://docs.filecoin.io/networks/calibration#quick-start-commands) Quick Start Commands ------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/networks/calibration#download-latest-snapshot) Download Latest Snapshot Copy # Fast download with aria2c (recommended) aria2c -x5 https://forest-archive.chainsafe.dev/latest/calibnet/ # Alternative: wget method wget https://forest-archive.chainsafe.dev/latest/calibnet/ ### [hashtag](https://docs.filecoin.io/networks/calibration#connect-to-calibration-network) Connect to Calibration Network Copy # Lite node (fastest startup) FULLNODE_API_INFO=wss://wss.calibration.node.glif.io/apigw/lotus lotus daemon --lite # Full node with snapshot import lotus daemon --import-snapshot # Connect to RPC endpoint curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Filecoin.ChainHead","params":[],"id":1}' https://api.calibration.node.glif.io/rpc/v1 ### [hashtag](https://docs.filecoin.io/networks/calibration#get-test-fil) Get Test FIL Quick access to faucets: * **Chainsafe**: https://faucet.calibnet.chainsafe-fil.io * **Zondax**: https://beryx.zondax.ch/faucet/ * **Forest**: https://forest-explorer.chainsafe.dev/faucet/calibnet ### [hashtag](https://docs.filecoin.io/networks/calibration#essential-network-info) Essential Network Info * **Chain ID**: `314159` (for MetaMask/wallets) * **RPC**: `https://api.calibration.node.glif.io/rpc/v1` * **WebSocket**: `wss://wss.calibration.node.glif.io/apigw/lotus/rpc/v1` * **Minimum Power**: `32 GiB` [hashtag](https://docs.filecoin.io/networks/calibration#about-calibration) About Calibration ------------------------------------------------------------------------------------------------- Prospective storage providers can experience more realistic sealing performance and hardware requirements using final proofs constructions and parameters. Storage clients can store and retrieve _real data_ on the network. Clients can also participate in deal-making workflows and storage and retrieval functionality. The sector size on the Calibration testnet is the same as on the Filecoin mainnet; 32 GiB and 64 GiB sectors are supported. This testnet also includes the Filecoin EVM-runtime features found on the Filecoin mainnet. Developers can reference pre-existing deals that are already available on the network. See the [`#fil-net-calibration-discuss` channel in the Filecoin Slackarrow-up-right](https://filecoinproject.slack.com/archives/C01D42NNLMS) for support. **Maintainer**: [Protocol Labsarrow-up-right](https://protocol.ai/) [hashtag](https://docs.filecoin.io/networks/calibration#genesis) Genesis ----------------------------------------------------------------------------- * CAR File: `QmbHZuVjgtxvgtcE5H3FpE1ywEyawYmZcbx4Eh47WZ7YF8` * Reset Timestamp: `1667326380` (`2022-11-01T18:13:00Z`) * Genesis Block CID: `bafy2bzacecyaggy24wol5ruvs6qm73gjibs2l2iyhcqmvi7r7a4ph7zx3yqd4` * SHA-1 Digest: `f9004d1266e0b023a018eb2fe6bb403cb8204df4` [hashtag](https://docs.filecoin.io/networks/calibration#network-parameters) Network parameters --------------------------------------------------------------------------------------------------- * Supported Sector Sizes: `32 GiB` and `64 GiB` * Consensus Miner Min Power: `32 GiB` * Epoch Duration Seconds: `30` * Expected Leaders per Epoch: `5` * WindowPoSt Proving Period: `2880` * WindowPoSt Challenge Window: `60` * WindowPoSt Period Deadlines: `48` * Pre-Commit Challenge Delay: `150` [hashtag](https://docs.filecoin.io/networks/calibration#bootstrap-peers) Bootstrap peers --------------------------------------------------------------------------------------------- Bootstrap peers for Calibration testnet can be found at: `https://github.com/filecoin-project/lotus/blob/release/`**\[latest release\]**`/build/bootstrap/calibnet.pi` The latest Lotus release can be found at https://github.com/filecoin-project/lotus/releases/latest/ [hashtag](https://docs.filecoin.io/networks/calibration#snapshots) Snapshots --------------------------------------------------------------------------------- * [Latest minimal snapshotarrow-up-right](https://forest-archive.chainsafe.dev/latest/calibnet) (note, as of March 2024, this is a 3.5GB download) [hashtag](https://docs.filecoin.io/networks/calibration#active-storage-providers) Active storage providers --------------------------------------------------------------------------------------------------------------- The following storage providers are running on the Calibration testnet. ### [hashtag](https://docs.filecoin.io/networks/calibration#piknikhttpsgithubcombenjaminh83fvm-calib-deal-miners) [PiKNiKarrow-up-right](https://github.com/benjaminh83/fvm-calib-deal-miners) * **t017840**: Every deal accepted by this SP will be aggregated into 32 GiB sectors, which is the minimum size for calibration network. This miner has a preset sealing capacity of 2x 32 GiB sectors per day, defined as sectors in waitdeals will be flushed every 12 hours. [More informationarrow-up-right](https://github.com/benjaminh83/fvm-calib-deal-miners) [hashtag](https://docs.filecoin.io/networks/calibration#resources) Resources --------------------------------------------------------------------------------- * [Calibration Faucet - Chainsafearrow-up-right](https://faucet.calibnet.chainsafe-fil.io/) * [Calibration Faucet - Zondaxarrow-up-right](https://beryx.zondax.ch/faucet/) * [Calibration Faucet - Forest Explorerarrow-up-right](https://forest-explorer.chainsafe.dev/faucet/calibnet) * [Calibration USDFC Faucet - Chainsafearrow-up-right](https://forest-explorer.chainsafe.dev/faucet/calibnet_usdfc) * [DataCap allocationarrow-up-right](https://faucet.calibnet.chainsafe-fil.io/) * [Slack Channel for Updates: #fil-network-announcementsarrow-up-right](https://filecoinproject.slack.com/archives/C01AC6999KQ) * [Slack Channel for Questions: #fil-helparrow-up-right](https://filecoinproject.slack.com/archives/CEGN061C5) * [Latest lightweight snapshotarrow-up-right](https://forest-archive.chainsafe.dev/latest/calibnet/) generated with [Forestarrow-up-right](http://github.com/ChainSafe/forest) by [ChainSafearrow-up-right](https://chainsafe.io/) * [Complete calibration net archival dataarrow-up-right](https://forest-archive.chainsafe.dev/list/) generated with [Forestarrow-up-right](http://github.com/ChainSafe/forest) by [ChainSafearrow-up-right](https://chainsafe.io/) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks/calibration) [PreviousNetwork performancechevron-left](https://docs.filecoin.io/networks/mainnet/network-performance) [NextExplorerschevron-right](https://docs.filecoin.io/networks/calibration/explorers) Last updated 5 months ago * [Quick Start Commands](https://docs.filecoin.io/networks/calibration#quick-start-commands) * [Download Latest Snapshot](https://docs.filecoin.io/networks/calibration#download-latest-snapshot) * [Connect to Calibration Network](https://docs.filecoin.io/networks/calibration#connect-to-calibration-network) * [Get Test FIL](https://docs.filecoin.io/networks/calibration#get-test-fil) * [Essential Network Info](https://docs.filecoin.io/networks/calibration#essential-network-info) * [About Calibration](https://docs.filecoin.io/networks/calibration#about-calibration) * [Genesis](https://docs.filecoin.io/networks/calibration#genesis) * [Network parameters](https://docs.filecoin.io/networks/calibration#network-parameters) * [Bootstrap peers](https://docs.filecoin.io/networks/calibration#bootstrap-peers) * [Snapshots](https://docs.filecoin.io/networks/calibration#snapshots) * [Active storage providers](https://docs.filecoin.io/networks/calibration#active-storage-providers) * [PiKNiK](https://docs.filecoin.io/networks/calibration#piknikhttpsgithubcombenjaminh83fvm-calib-deal-miners) * [Resources](https://docs.filecoin.io/networks/calibration#resources) sun-brightdesktopmoon sun-brightdesktopmoon --- # Difference with Ethereum | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#gas-costs) Gas costs -------------------------------------------------------------------------------------------------------------------------- Filecoin charges Filecoin gas only. This includes the Filecoin EVM runtime. Instead of the Filecoin EVM runtime charging gas according to the EVM spec for each EVM opcode executed, the Filecoin virtual machine (FVM) charges Filecoin gas for executing the EVM interpreter itself. The [How gas works](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works) page goes into this in more detail. Importantly, this means that Filecoin EVM runtime gas costs and EVM gas costs will be very different: 1. EVM and Filecoin gas are different units of measurement and are not 1:1. Purely based on chain throughput (gas/second), the ratio of Ethereum gas to Filecoin gas is about 1:444. Expect Filecoin gas numbers to look _much_ larger than those in Ethereum. 2. Because Filecoin charges Filecoin gas for executing the Filecoin EVM runtime interpreter: 1. Some instructions may be more expensive and/or cheaper in Filecoin EVM runtime than they are in the EVM. 2. EVM instruction costs can depend on the exact Filecoin EVM runtime code-paths taken, and caching. triangle-exclamation Filecoin gas costs are not set in stone and should never be hard-coded. Future network upgrades will break any smart contracts that depend on gas costs not changing. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#gas-stipend) Gas stipend ------------------------------------------------------------------------------------------------------------------------------ Solidity calls `address.transfer` and `address.send` to grant a fixed gas stipend of 2300 Ethereum gas to the called contract. The Filecoin EVM runtime automatically detects such calls, and sets the gas limit to 10 million Filecoin gas. This is a relatively more generous limit than Ethereum’s, but it’s future-proof. You should expect the address called to be able to carry out more work than in Ethereum. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#self-destruct) Self destruct ---------------------------------------------------------------------------------------------------------------------------------- Filecoin EVM runtime emulates EVM self-destruct behavior but isn’t able to entirely duplicate it: 1. There is no gas refund for self-destruct. 2. On self-destruct, the contract is marked as self-destructed, but is not actually deleted from the Filecoin state-tree. Instead, it simply behaves as if it does not exist. It acts like an empty contract. 3. Unlike in the EVM, in Filecoin EVM runtime, self-destruct can _fail_ causing the executing contract to revert. Specifically, this can happen if the specified beneficiary address is an embedded [ID address](https://docs.filecoin.io/basics/the-blockchain/addresses) and no actor exists with the specified ID. 4. If funds are sent to a self-destructed contract after it self-destructs but before the end of the transaction, those funds remain with the self-destructed contract. In Ethereum, these funds would vanish after the transaction finishes executing. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#callcode) CALLCODE ------------------------------------------------------------------------------------------------------------------------ The `CALLCODE` opcode has not been implemented. Use the newer `DELEGATECALL` opcode. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#blockhash) BLOCKHASH -------------------------------------------------------------------------------------------------------------------------- Ethereum has one block at every height while Filecoin can have none, one, or many (usually around 4-5). This means that the `BLOCKHASH` instruction behaves a bit differently in the Filecoin EVM: * Because there can be multiple blocks at any given height, `BLOCKHASH` returns the hash of all the concatenation of the CIDs of all the blocks at the requested height. * Because there can be no blocks at any given height, if `BLOCKHASH` is called on a height with _no blocks_, it returns the `BLOCKHASH` of the first preceding height with blocks. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#bare-value-sends) Bare-value sends ---------------------------------------------------------------------------------------------------------------------------------------- In Ethereum, `SELFDESTRUCT` is the only way to send funds to a smart contract without giving the target smart contract a chance to execute code. In Filecoin, any actor can use `method 0`, also called a bare-value send, to transfer funds to any other actor without invoking the target actor’s code. You can think of this behavior as having the suggested [`PAY` opcodearrow-up-right](https://eips.ethereum.org/EIPS/eip-5920) already implemented in Filecoin. However by default, Solidity smart contracts do not accept bare value transfers, unless the author implements the [receive() or fallback() functionarrow-up-right](https://docs.soliditylang.org/en/v0.8.17/contracts.html#receive-ether-function) . For more information see [FIP Discussion #592arrow-up-right](https://github.com/filecoin-project/FIPs/discussions/592#discussioncomment-4819619) . Therefore in case the recipient is a smart contract, **it is recommended to always use the** `**InvokeEVM**` `**method 3844450837**` **for sends to prevent loss of funds** when sending to an `f410f`/`0x` address recipient. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#precompiles) Precompiles ------------------------------------------------------------------------------------------------------------------------------ The Filecoin EVM runtime, unlike Ethereum, does not usually enforce gas limits when calling precompiles. This means that it isn’t possible to prevent a precompile from consuming all remaining gas. The `call actor` and `call actor id` precompiles are the exception. However, they apply the passed gas limit to the actor call, not the entire precompile operation (i.e., the full precompile execution end-to-end can use more gas than specified, it’s only the final `send` to the target actor that will be limited). [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#multiple-addresses) Multiple Addresses -------------------------------------------------------------------------------------------------------------------------------------------- In Filecoin, contracts generally have multiple addresses. Two of these address types, `f0` and `f410f`, can be converted to 0x-style (Ethereum) addresses which can be used in the `CALL` opcode. See [Converting to a 0x-style address](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types#converting-to-a-0x-style-address) for details on how these addresses are derived. Importantly, this means that any contract can be called by either its “normal” EVM address (corresponding to the contract’s `f410f` address) or its “masked ID address” (corresponding from the contract’s `f0` address). However, the addresses returned by the CALLER, ORIGIN, and ADDRESS instructions will always be the same for the same contract. * The ADDRESS will always be derived from the executing contract’s `f410f` address, even if the contract was called via a masked ID address. * The CALLER/ORIGIN will be derived from the caller/origin’s `f410f` address, if the caller/origin is an Ethereum-style account or an EVM smart contract. Otherwise, the caller/origin’s “masked ID address” (derived from their `f0` address) will be used. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#deferred-execution-model) Deferred execution model -------------------------------------------------------------------------------------------------------------------------------------------------------- When calling an Ethereum method that allows the user to ask for the `latest` block, Filecoin will return the `chain head` - `1` block. This behavior was implemented for compatibility with the deferred execution mode that Filecoin uses. In this mode, messages submitted at a given `height` are only processed at `height` + `1`. This means that receipts for a block produced at `height` are only available at `height` + `1`. [Was this page helpful?arrow-up-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum) [PreviousFILForwarderchevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder) [NextHow gas workschevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works) Last updated 1 year ago * [Gas costs](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#gas-costs) * [Gas stipend](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#gas-stipend) * [Self destruct](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#self-destruct) * [CALLCODE](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#callcode) * [BLOCKHASH](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#blockhash) * [Bare-value sends](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#bare-value-sends) * [Precompiles](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#precompiles) * [Multiple Addresses](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#multiple-addresses) * [Deferred execution model](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum#deferred-execution-model) sun-brightdesktopmoon sun-brightdesktopmoon --- # Developing contracts | Filecoin Docs This section covers how to build dApps by writing smart contracts in the Filecoin Virtual Machine. The docs in this section explain: * How to [get test tokensarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/get-test-tokens) , called tFIL, from a faucet. * How to set up [Remixarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/remix) , to make use of Ethereum tooling while building Filecoin dApps. * How to set up [Hardhatarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat) , to build FVM dApps in an environment familiar to Ethereum developers. * How to make use of [Foundryarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry) , expanding the utilities available for interacting with FVM contracts. * Where to [find contract templatesarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries) from a range of third party Solidity libraries. * How to [Call built-in actorsarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/call-built-in-actors) using the Protocol API or the Solidity Library. * How to make use of the Filecoin [Solidity Librariesarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/filecoin.sol) to build FVM dApps using a language familiar to Ethereum developers. * How to perform a storage deal using the [direct dealmaking client contractarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial) . * How to [replicate, renew, or repair (RaaS)arrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas) storage deals on Filecoin. * How to [verify a contractarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract) using one of Filecoin's many block explorers. * The [best practicesarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/best-practices) for building FVM dApps. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts) [PreviousRaaS interfaceschevron-left](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces) [NextGet test tokenschevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/get-test-tokens) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Built-in actors | Filecoin Docs Built-in actors are how the Filecoin network manages and updates _global state_. The _global state_ of the network at a given epoch can be thought of as the set of blocks agreed upon via network consensus in that epoch. This global state is represented as a _state tree_, which maps an actor to an _actor state_. An _actor state_ describes the current conditions for an individual actor, such as its FIL balance and its nonce. In Filecoin, actors trigger a _state transition_ by sending a _message_. Each block in the chain can be thought of as a **proposed** global state, where the block selected by network consensus sets the **new** global state. Each block contains a series of messages, and a checkpoint of the current global state after the application of those messages. The Filecoin Virtual Machine (FVM) is the Filecoin network component that is in charge of execution of all actor code. A basic example of how built-in actors are used in Filecoin is the process by which storage providers prove storage and are subsequently rewarded. The process is as follows: 1. The [`StorageMinerActor`arrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#storagemineractor) processes proof of storage from a storage provider. 2. The storage provider is awarded storage power based on whether the proof is valid or not. 3. The [`StoragePowerActor`arrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#storagepoweractor) accounts for the storage power. 4. During block validation, the `StoragePowerActor`’s state, which includes information on storage power allocated to each storage provider, is read. 5. Using the state information, the consensus mechanism randomly awards blocks to the storage providers with the most power, and the [`RewardActor`arrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#rewardactor) sends FIL to storage providers. [hashtag](https://docs.filecoin.io/reference/built-in-actors#blocks) Blocks -------------------------------------------------------------------------------- Each block in the Filecoin chain contains: * Inline data such as current block height. * A pointer (CID) to the current state tree. * A pointer (CID) to the set of messages that, when applied to the network, generated the current state tree. [hashtag](https://docs.filecoin.io/reference/built-in-actors#state-tree) State tree ---------------------------------------------------------------------------------------- A Merkle Directed Acyclic Graph (Merkle DAG) is used to map the state tree. and the set of messages. Nodes in the state tree contain information on: * Actors, like FIL balance, nonce and a pointer (CID) to actor state data. * Messages in the current block [hashtag](https://docs.filecoin.io/reference/built-in-actors#messages) Messages ------------------------------------------------------------------------------------ Like the state tree, a Merkle Directed Acyclic Graph (Merkle DAG) is used to map the set of messages for a given block. Nodes in the messages map contain information on: * The actor the message was sent to * The actor that sent the message * Target method to call on actor being sent the message * A cryptographic signature for verification * The amount of FIL transferred between actors [hashtag](https://docs.filecoin.io/reference/built-in-actors#actor-code) Actor code ---------------------------------------------------------------------------------------- The code that defines an actor in the Filecoin network is separated into different methods. Messages sent to an actor contain information on which method(s) to call, and the input parameters for those methods. Additionally, actor code interacts with a _runtime_ object, which contains information on the general state of network, such as the current epoch, and cryptographic signatures and proof validations. Like smart contracts in other blockchains, actors must pay a _gas fee_, which is some predetermined amount of FIL to offset the cost (network resources used, etc.) of a transaction. Every actor has a Filecoin balance attributed to it, a state pointer, a code which tells the system what type of actor it is, and a nonce, which tracks the number of messages sent by this actor [hashtag](https://docs.filecoin.io/reference/built-in-actors#types-of-built-in-actors) Types of built-in actors -------------------------------------------------------------------------------------------------------------------- The 11 different types of built-in actors are as follows: * [CronActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#cronactor) * [InitActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#initactor) * [AccountActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#accountactor) * [RewardActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#rewardactor) * [StorageMarketActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#storagemarketactor) * [StorageMinerActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#storagemineractor) * [MultisigActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#multisigactor) * [PaymentChannelActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#paymentchannelactor) * [StoragePowerActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#storagepoweractor) * [VerifiedRegistryActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#verifiedregistryactor) * [SystemActorarrow-up-right](https://docs.filecoin.io/reference/built-in-actors/overview/#systemactor) ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#cronactor) CronActor The `CronActor` sends messages to the `StoragePowerActor` and `StorageMarketActor` at the end of each epoch. The messages sent by `CronActor` indicate to StoragePowerActor and StorageMarketActor how they should maintain internal state and process deferred events. This system actor is instantiated in the genesis block, and interacts directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#initactor) InitActor The `InitActor` can initialize new actors on the Filecoin network. This system actor is instantiated in the genesis block, and maintains a table resolving a public key and temporary actor addresses to their canonical ID addresses. The `InitActor` interacts directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#accountactor) AccountActor The `AccountActor` is responsible for user accounts. Account actors are not created by the `InitActor`, but by sending a message to a public-key style address. The account actor updates the state tree with new actor address, and interacts directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#rewardactor) RewardActor The `RewardActor` manages unminted Filecoin tokens, and distributes rewards directly to miner actors, where they are locked for vesting. The reward value used for the current epoch is updated at the end of an epoch. The `RewardActor` interacts directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#storagemarketactor) StorageMarketActor The `StorageMarketActor` is responsible for processing and managing on-chain deals. This is also the entry point of all storage deals and data into the system. This actor keeps track of storage deals, and the of locked balances of both the client storing data and the storage provider. When a deal is posted on chain through the `StorageMarketActor`, the actor will first check if both transacting parties have sufficient balances locked up and include the deal on chain. Additionally, the `StorageMarketActor` holds _Storage Deal Collateral_ provided by the storage provider to collateralize deals. This collateral is returned to the storage provider when all deals in the sector successfully conclude. This actor does not interact directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#storagemineractor) StorageMinerActor The `StorageMinerActor` is created by the `StoragePowerActor`, and is responsible for storage mining operations and the collection of mining proofs. This actor is a key part of the Filecoin storage mining subsystem, which ensures a storage miner can effectively commit storage to the Filecoin, handles the following: * Committing new storage * Continuously proving storage * Declaring storage faults * Recovering from storage faults This actor does not interact directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#multisigactor) MultisigActor The `MultisigActor` is responsible for dealing with operations involving the Filecoin wallet, and represents a group of transaction signers, with a maximum of 256. Signers may be external users or the `MultisigActor` itself. This actor does not interact directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#paymentchannelactor) PaymentChannelActor The `PaymentChannelActor` creates and manages _payment channels_, a mechanism for off-chain microtransactions for Filecoin dApps to be reconciled on-chain at a later time with less overhead than a standard on-chain transaction, and no gas costs. Payment channels are uni-directional and can be funded by adding to their balance. To create a payment channel and deposit fund, a user calls the `PaymentChannelActor`. This actor does not interact directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#storagepoweractor) StoragePowerActor The `StoragePowerActor` is responsible for keeping track of the storage power allocated to each storage miner, and has the ability to create a `StorageMinerActor`. This actor does not interact directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#verifiedregistryactor) VerifiedRegistryActor The `VerifiedRegistryActor` is responsible for managing Filecoin Plus clients. This actor can add a verified client to the Fil+ program, remove and reclaim expired DataCap allocations and manage claims. This actor does not interact directly with the FVM. ### [hashtag](https://docs.filecoin.io/reference/built-in-actors#systemactor) SystemActor For more information on `SystemActor`, see the [source codearrow-up-right](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/system/system_actor.go) . [hashtag](https://docs.filecoin.io/reference/built-in-actors#access-and-invoke-built-in-actors) Access and invoke built-in actors -------------------------------------------------------------------------------------------------------------------------------------- * _Protocol API_, maintained by [Protocol Labsarrow-up-right](https://protocol.ai/) , … * _Filecoin.solidity_, maintained by [Protocol Labsarrow-up-right](https://protocol.ai/) , is a set of libraries that allows Solidity smart contracts to seamlessly call built-in actors methods. **Not all built-in actors and methods are supported** - for a complete list, see the [actors and methods supported](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol) . For information on how invoke and access built-in actors in your smart contracts, see the [developers guidearrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/call-built-in-actors/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/built-in-actors) [PreviousExchange integrationchevron-left](https://docs.filecoin.io/reference/exchanges/exchange-integration) [NextProtocol APIchevron-right](https://docs.filecoin.io/reference/built-in-actors/protocol-api) Last updated 1 year ago * [Blocks](https://docs.filecoin.io/reference/built-in-actors#blocks) * [State tree](https://docs.filecoin.io/reference/built-in-actors#state-tree) * [Messages](https://docs.filecoin.io/reference/built-in-actors#messages) * [Actor code](https://docs.filecoin.io/reference/built-in-actors#actor-code) * [Types of built-in actors](https://docs.filecoin.io/reference/built-in-actors#types-of-built-in-actors) * [CronActor](https://docs.filecoin.io/reference/built-in-actors#cronactor) * [InitActor](https://docs.filecoin.io/reference/built-in-actors#initactor) * [AccountActor](https://docs.filecoin.io/reference/built-in-actors#accountactor) * [RewardActor](https://docs.filecoin.io/reference/built-in-actors#rewardactor) * [StorageMarketActor](https://docs.filecoin.io/reference/built-in-actors#storagemarketactor) * [StorageMinerActor](https://docs.filecoin.io/reference/built-in-actors#storagemineractor) * [MultisigActor](https://docs.filecoin.io/reference/built-in-actors#multisigactor) * [PaymentChannelActor](https://docs.filecoin.io/reference/built-in-actors#paymentchannelactor) * [StoragePowerActor](https://docs.filecoin.io/reference/built-in-actors#storagepoweractor) * [VerifiedRegistryActor](https://docs.filecoin.io/reference/built-in-actors#verifiedregistryactor) * [SystemActor](https://docs.filecoin.io/reference/built-in-actors#systemactor) * [Access and invoke built-in actors](https://docs.filecoin.io/reference/built-in-actors#access-and-invoke-built-in-actors) sun-brightdesktopmoon sun-brightdesktopmoon --- # Wrapped FIL | Filecoin Docs Wrapped FIL (wFIL) is a wrapper token based on the ERC-20 token standard for the native Filecoin token (FIL). It allows FIL to be bridged and used in Ethereum-compatible decentralized applications (dapps) hosted on other blockchains, such as decentralized exchanges (DEXs), lending platforms, and other places where FIL is not natively supported. Wrapped FIL operates like any other ERC20-wrapped native blockchain token: a user deposits FIL into the wFIL contract and gets back an equal number of wFIL tokens. When users want to convert their wFIL back to FIL, they can burn the wFIL and unlock the same amount of FIL that was initially locked in the wFIL contract. Overall, wFIL provides additional liquidity and interoperability for FIL tokens, making the Filecoin network more accessible for a broader range of decentralized finance (defi) use cases across multiple blockchains. triangle-exclamation When wrapping and unwrapping FIL ensure you are using the correct wFIL contract address on Filecoin. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#wrapped-fil-contract-addresses) Wrapped FIL contract addresses Only use the following addresses when wrapping and unwrapping FIL: * Mainnet: `0x60E1773636CF5E4A227d9AC24F20fEca034ee25A` * Calibration testnet: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4` ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#wrapping-and-unwrapping-process) Wrapping and unwrapping process There are a couple of options for users to wrap and unwrap FIL using a web browser: * [Glifarrow-up-right](https://www.glif.io/en) * [Squidarrow-up-right](https://app.squidrouter.com/?chains=314%2C314&tokens=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee%2C0x60e1773636cf5e4a227d9ac24f20feca034ee25a) To wrap FIL into wFIL, follow these steps: 1. **Obtain FIL**: Ensure you have FIL in your MetaMask wallet before wrapping it. 2. **Connect your wallet**: You will need to connect your wallet to a platform that supports wFIL wrapping, such as [Glifarrow-up-right](https://www.glif.io/en) or [Squidarrow-up-right](https://app.squidrouter.com/?chains=314%2C314&tokens=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee%2C0x60e1773636cf5e4a227d9ac24f20feca034ee25a) . 3. **Wrap your FIL**: After you’ve connected your wallet, you can wrap your FIL by following the platform’s instructions. Generally, you’ll need to select the amount of FIL you want to wrap and confirm the transaction on MetaMask. The platform will then mint an equivalent amount of wFIL and deposit it into your wallet. 4. **Use wFIL**: Once you have wFIL in your wallet, you can use it on various Defi products that support token swapping or bridging wFIL to other blockchains. To unwrap FIL and receive FIL back to your wallet, users can directly go to supported platforms such as [Glifarrow-up-right](https://www.glif.io/en) or [Squidarrow-up-right](https://app.squidrouter.com/?chains=314%2C314&tokens=0x60e1773636cf5e4a227d9ac24f20feca034ee25a%2C0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee) to unwrap FIL following the platform’s instructions. Once the network confirms the unwrap transaction, FIL tokens are transferred back to your wallet address. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#programmatic-interaction) Programmatic interaction Developers integrating wFIL into applications or protocols can wrap and unwrap FIL programmatically. The wFIL smart contract is deployed on the Filecoin Mainnet and Calibration testnet. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#wrap-fil) Wrap FIL To add wrapping features to a project, developers must interact with the wFIL smart contract that manages the wFIL minting and burning process. The source code of the wFIL smart contract is in the [wFIL GitHub repoarrow-up-right](https://github.com/glifio/wfil) . Do not directly send FIL to the wFIL contract address. Also, ensure you do not send FIL using the `METHOD_SEND` method. Always use the `InvokeEVM` method. There are two options to wrap FIL: 1. Call the `deposit()` method in the wFIL contract and attach the amount of FIL tokens users want to wrap. This process will mint wFIL 1:1 and transfer to the `msg.sender` address. 1. Since the wFIL implements the receive function, you can send FIL to the wFIL contract using the `InvokeEVM` method to wrap FIL. This method will trigger the `deposit` function, minting the caller with wFIL 1:1. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#unwrap-fil) Unwrap FIL To unwrap wFIL into FIL, developers need to call the `withdraw` method in the wFIL contract and specify how many wFIL you would like to unwrap. The `withdraw` method looks like this: This process will burn the amount of wFIL from the caller’s balance and transfer the unwrapped FIL 1:1 back to the caller’s address. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil) [PreviousAdvancedchevron-left](https://docs.filecoin.io/smart-contracts/advanced) [NextOracleschevron-right](https://docs.filecoin.io/smart-contracts/advanced/oracles) Last updated 3 months ago * [Wrapped FIL contract addresses](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#wrapped-fil-contract-addresses) * [Wrapping and unwrapping process](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#wrapping-and-unwrapping-process) * [Programmatic interaction](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil#programmatic-interaction) sun-brightdesktopmoon Copy function deposit() public payable virtual { _mint(msg.sender, msg.value); emit Deposit(msg.sender, msg.value); } Copy receive() external payable virtual { deposit(); } Copy function withdraw(uint _amount) public virtual { _burn(msg.sender, _amount); emit Withdrawal(msg.sender, _amount); payable(msg.sender).sendValue(_amount); } sun-brightdesktopmoon --- # RPCs | Filecoin Docs [Chainlistarrow-up-right](https://chainlist.org/?search=filecoin&testnets=true) provides a dynamically updated list of [available Filecoin - Mainnet RPCsarrow-up-right](https://chainlist.org/?search=filecoin&testnets=false) . These endpoints are limited to the read-only [Filecoin JSON RPC API](https://docs.filecoin.io/reference/json-rpc) including read-only [Filecoin Eth RPC](https://docs.filecoin.io/reference/json-rpc/eth) methods, except for the write operations [`MPoolPush`](https://docs.filecoin.io/reference/json-rpc/mpool#mpoolpush) and [`EthSendRawTransaction`](https://docs.filecoin.io/reference/json-rpc/eth#ethsendrawtransaction) for sending already signed messages. circle-info Please note that most publicly hosted endpoints **only guarantee recent state, i.e. 2000 of the latest blocks (last 16.67 hours).** To request an archival node you can contact a provider below. In order to check the current benchmarked performance of each of the below endpoints, please see the [Filecoin ETH RPC Benchmark apparrow-up-right](https://benchmark-rpc.vercel.app/) . Provider HTTPS endpoint WSS endpoint Docs API Support [Glif Nodesarrow-up-right](https://api.node.glif.io/) `https://api.node.glif.io/rpc/v1` `wss://wss.node.glif.io/apigw/lotus/rpc/v1` [Glif Nodes - Docsarrow-up-right](https://api.node.glif.io/) All Filecoin and Eth JSON RPC methods including MPoolPush [Ankrarrow-up-right](https://ankr.com/) `https://rpc.ankr.com/filecoin` By request at: https://www.ankr.com/rpc/filecoin [Ankr Docs - Filecoinarrow-up-right](https://www.ankr.com/docs/rpc-service/chains/chains-list/#filecoin) All Filecoin and Eth JSON RPC methods including MPoolPush [Chainup Cloudarrow-up-right](https://cloud.chainup.com/) `https://filecoin.chainup.net/rpc/v1` `wss://filecoin.chainup.net/rpc/v1` [Chainup Cloud Docs - Filecoinarrow-up-right](https://docs.chainupcloud.com/blockchain-api/filecoin/public-apis) [NOWNodesarrow-up-right](https://nownodes.io/) `https://fil.nownodes.io` (Free for 1 month with signup) [NOWNodes - Docsarrow-up-right](https://nownodes.gitbook.io/documentation) [Lavaarrow-up-right](https://www.lavanet.xyz/) `https://filecoin.lava.build` [Lava - Docsarrow-up-right](https://docs.lavanet.xyz/iprpc#filecoin) All Filecoin and Eth JSON RPC methods including MPoolPush [hashtag](https://docs.filecoin.io/networks/mainnet/rpcs#additional-notes) Additional Notes: ------------------------------------------------------------------------------------------------- * Glif Nodes offers a [Lotus Lite nodearrow-up-right](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) endpoint with the following command: Copy FULLNODE_API_INFO=wss://wss.node.glif.io/apigw/lotus lotus daemon --lite When using a Lotus Lite node, omit `/rpc/v1` from Glif’s WebSocket address. A Lotus Lite node is a stripped down version of a Lotus full-node capable of running on lower-end hardware. It also allows for local signing for storage deals without a full Lotus node. [Was this page helpful?arrow-up-right](https://docs.filecoin.io/networks/mainnet/rpcs) [PreviousExplorerschevron-left](https://docs.filecoin.io/networks/mainnet/explorers) [NextNetwork performancechevron-right](https://docs.filecoin.io/networks/mainnet/network-performance) Last updated 5 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Decentralized Database | Filecoin Docs ### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database#store-data-with-tableland) Store data with Tableland Tableland is a **decentralized database** built on the SQLite engine, which offers developers a web3-native, relational database that seamlessly integrates into their EVM-compatible stacks. Under the hood, Tableland records database tables as ERC721 tokens on-chain and enables the execution of SQL statements in a completely decentralized manner through on-chain smart contracts. To learn more about what is tableland and how to use it, you can visit [https://tableland.xyz/arrow-up-right](https://tableland.xyz/) . #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database#ingredients) **Ingredients** Ensure that you install and import the necessary dependencies in your projects. * [Tablelandarrow-up-right](https://tableland.xyz/) * [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) * [Openzeppelinarrow-up-right](https://docs.openzeppelin.com/contracts/5.x/) #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database#instructions) **Instructions** Let's take storage deal aggregator/RaaS as an example to demonstrate how to integrate it with Tableland. When uploading data via aggregator/RaaS providers to the Filecoin network, you can choose to store its metadata in Tableland tables instead of storing it in the chain state. This metadata can then be easily accessed from the Tableland database and utilized directly within your application. If you require sample datasets to use, you can use the [Filecoin Dataset Explorerarrow-up-right](https://datasets.filecoin.io/) . As an example, let's design the deal aggregator table as follows. However, you can certainly add more columns to this table to include additional information, such as RaaS registration. column data Type ID int CID bytes/string deal\_ID int miner\_ID int status string 1. **Create aggregator table** To track all the deal aggregation/RaaS requests submitted to the smart contract, we need to create a database table. You can add the following code to create an aggregator table within the `constructor()` function of the aggregator contract. This way, when the aggregator/RaaS contract is deployed, an aggregator table will be created to store the metadata of the aggregation requests. 1. We will create an `insert` function within the smart contract to add a record whenever an aggregation request is made. Whenever the `submit` or `submitRaaS` function is called, a record will be inserted into the aggregator table instead of being stored in the blockchain's state. 1. we create an `updateRecord` function to modify an aggregator record once the `complete` function is called after the storage deal has been made on the Filecoin network. After SP finishes publishing the storage deal on-chain to include an aggregation request, a callback function `complete` will be called to notify the contract that a CID is packed into a storage deal. Then we can call `updateRecord` to update the details for this CID record in the Tableland database. 1. **Query aggregation records** By using the Tableland SDK, you can easily query the aggregation or RaaS status of all the data stored with the aggregator using SQL statements. For instance, you can retrieve all records associated with a specific CID by executing a SELECT statement. To learn how to write different select statements using Tableland SDK, you can refer to [herearrow-up-right](https://docs.tableland.xyz/sdk/database/prepared-statements) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database) [PreviousCross-Chain Bridgeschevron-left](https://docs.filecoin.io/builder-cookbook/dapps/cross-chain-bridges) [NextFilecoin Pinchevron-right](https://docs.filecoin.io/builder-cookbook/filecoin-pin) Last updated 1 year ago sun-brightdesktopmoon Copy uint256 private tableId; string private constant _TABLE_PREFIX = "aggregator_table"; // Custom table prefix // Constructor that creates a table, sets the controller, and inserts data constructor() { // Create a table tableId = TablelandDeployments.get().create( address(this), SQLHelpers.toCreateFromSchema( "id int, cid string, deal_id string, miner_id string, status string", _TABLE_PREFIX ) ); }C Copy function insertRecord(uint256 id, string memory val, string memory status) external { TablelandDeployments.get().mutate( address(this), // Table owner, i.e., this contract _tableId, SQLHelpers.toInsert( _TABLE_PREFIX, _tableId, "id,cid,status", string.concat( Strings.toString(id), // Convert to a string ",", SQLHelpers.quote(val) // Wrap strings in single quotes with the `quote` method ) ));} Copy function submit(bytes memory _cid) external returns (uint256) { // Increment the transaction ID transactionId++; // Save _cid record to aggregator_table insertRecord(transactionId, _cid, "PROPOSED"); // Emit the event emit SubmitAggregatorRequest(transactionId, _cid); return transactionId; } Copy // Update aggregation record in the table function updateRecord(uint256 id, uint256 memory dealId, uint256 memory minerId, string memory status) external { // Set the values to update string memory setters = string.concat("deal_id=", Strings.toString(dealId), "miner_id=", Strings.toString(minerId), "status=", SQLHelpers.quote(status)); // Specify filters for which row to update string memory filters = string.concat("id=",Strings.toString(id)); // Mutate a row at `id` with deal_id, miner_id, status TablelandDeployments.get().mutate( address(this), _tableId, SQLHelpers.toUpdate(_TABLE_PREFIX, _tableId, setters, filters) ); } Copy function complete( uint256 _id, uint64 _dealId, uint64 _minerId, InclusionProof memory _proof, InclusionVerifierData memory _verifierData ) external returns (InclusionAuxData memory) { // other code updateTable(_id, _dealId, _minerId, "FINISHED"); } Copy const db = new Database(); const { results } = await db.prepare(`SELECT * FROM ${tableName} WHERE cid = ?`) .bind(cid); console.log(results); sun-brightdesktopmoon --- # Oracles | Filecoin Docs ### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/oracles#obtain-price-feeds-with-the-tellor-oracle) Obtain Price Feeds with the Tellor Oracle Tellor is an Oracle solution that enables price and Filecoin network data feeds for FVM dApps. To see important disclaimers about the use of Tellor, please review the [Tellor Documentationarrow-up-right](https://docs.tellor.io/) and [this tutorialarrow-up-right](https://youtu.be/AQIDqTLguyI?si=CuSY3uArgKJNVcYL) . **Ingredients** * [Solidityarrow-up-right](https://docs.soliditylang.org/en/v0.8.23/) * [UsingTellorarrow-up-right](https://github.com/tellor-io/sampleUsingTellor?tab=readme-ov-file#2-how-to-use) package **Instructions** 1. Inherit the UsingTellor contract in your code. An example, pulled from the [sample project for UsingTellorarrow-up-right](https://github.com/tellor-io/sampleUsingTellor?tab=readme-ov-file#2-how-to-use) , is shown just below. Copy contract PriceContract is UsingTellor { uint256 public btcPrice; //This Contract now has access to all functions in UsingTellor constructor(address payable _tellorAddress) UsingTellor(_tellorAddress) {} function setBtcPrice() public { bytes memory _b = abi.encode("SpotPrice",abi.encode("btc","usd")); bytes32 _queryId = keccak256(_b); uint256 _timestamp; bytes memory _value; (_value, _timestamp) = getDataBefore(_queryId, block.timestamp - 15 minutes); require(_timestamp > 0, "No data exists"); require(block.timestamp - _timestamp < 24 hours, "Data is too old"); btcPrice = abi.decode(_value,(uint256)); } } 1. Pass the Tellor address as a constructor argument. Oracle contract address (on both Calibration Testnet and Mainnet): `0xb2CB696fE5244fB9004877e58dcB680cB86Ba444` To see additional addresses for Tellor Oracles, please see [this docarrow-up-right](https://docs.filecoin.io/smart-contracts/advanced/oracles) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps/oracles) [PreviousChain-Data Querychevron-left](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query) [NextCross-Chain Bridgeschevron-right](https://docs.filecoin.io/builder-cookbook/dapps/cross-chain-bridges) Last updated 6 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # FAQ | Filecoin Docs ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-is-filecoin-pin) What is Filecoin Pin? Filecoin Pin stores IPFS content on the Filecoin Network of decentralized Storage Providers. It enables developers to programmatically pay for storage and retrieval with Filecoin Pay. When SPs prove storage, they are paid from the developers' Filecoin Pay Account. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-can-i-use-filecoin-pin-today) How can I use Filecoin Pin today? Two paths are available: * **Website:** Upload files in your browser. Uses a pre-funded test wallet. * **CLI:** Upload files from your terminal. Fund storage from your own wallet. circle-info Both run on Calibration testnet. They use tFIL and USDFC. Data has no persistence guarantees while on Calibnet. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-do-i-need-to-get-started) What do I need to get started? * You can find different links related to Filecoin Pin here: [https://docs.filecoin.io/builder-cookbook/filecoin-pinarrow-up-right](https://docs.filecoin.io/builder-cookbook/filecoin-pin) * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-payments-and-approvals-work) How do payments and approvals work? * **Website:** The demo wallet handles payments. It has been prefunded with testnet USDFC and FIL. Users don't need to connect their own wallet. * **CLI:** Your test wallet handles payments. You approve and deposit funds through Filecoin Pay. circle-info Storage providers receive payment after cryptographically proving data possession. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-does-auto-funding-work) How does auto-funding work? Use `--auto-fund` when uploading. The CLI calculates storage costs automatically. It deposits the right amount of USDFC to your payment rail. circle-info No manual deposit calculations needed. The system handles it. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-long-is-my-data-stored) How long is my data stored? This runs on Calibration testnet only. Treat it as a demo. No duration guarantees exist for Website or CLI. Mainnet will offer persistence guarantees. Data persists while you maintain deposits. The CLI supports auto-funding for storage. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-is-a-data-set) What is a Data Set? A Data Set groups your uploads together. Each upload becomes a "piece" within the Data Set. Multiple files you upload share the same payment rail. Check your Data Set with `filecoin-pin data-set `. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-i-retrieve-my-data) How do I retrieve my data? Three methods: 1. **IPFS Gateways:** Use public gateways with your root CID: `https://gateway.example.com/ipfs/` 2. **Direct from Storage Provider:** Get the direct download URL from `filecoin-pin data-set ` 3. **IPFS Tools:** Use Kubo, Helia, IPFS Desktop with your root CID. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-is-a-piece-cid-vs-root-cid) What is a piece CID vs root CID? **Root CID** (bafybei...) is your IPFS content identifier. Use this to retrieve your data. **Piece CID** (bafkzci...) is the Filecoin commitment. Storage Providers prove they store this piece. circle-info Both are linked cryptographically on-chain. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-i-verify-my-data-is-actually-stored) How do I verify my data is actually stored? Two ways to verify: 1. **CLI:** Run `filecoin-pin data-set ` to see on-chain verification. Check proof status and piece details. 2. **PDP Explorer:** Visit `https://pdp.vxb.ai/calibration/dataset/{datasetID}` to view proofs in your browser. circle-info Both methods show CommP and proof state directly from blockchain state. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-i-access-the-code-for-the-dapp-and-cli) How do I access the code for the dApp and CLI? See the repos as reference implementations and to fork for my own project? * **Website**: [https://github.com/filecoin-project/filecoin-pin-websitearrow-up-right](https://github.com/filecoin-project/filecoin-pin-website) * **CLI:** [https://github.com/filecoin-project/filecoin-pinarrow-up-right](https://github.com/filecoin-project/filecoin-pin) * * * [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#references) References ------------------------------------------------------------------------------------------------ * Filecoin Pin CLI Docs: [https://docs.filecoin.io/builder-cookbook/filecoin-pinarrow-up-right](https://docs.filecoin.io/builder-cookbook/filecoin-pin) * Filecoin Pin dApp Repo: [https://github.com/filecoin-project/filecoin-pin-websitearrow-up-right](https://github.com/filecoin-project/filecoin-pin-website) * Synapse SDK: [https://github.com/FilOzone/synapse-sdkarrow-up-right](https://github.com/FilOzone/synapse-sdk) * USDFC documentation: [https://docs.secured.finance/usdfc-stablecoin/getting-startedarrow-up-right](https://docs.secured.finance/usdfc-stablecoin/getting-started) [PreviousFilecoin Pin for ERC-8004 Agentschevron-left](https://docs.filecoin.io/builder-cookbook/filecoin-pin/erc-8004-agent-registration) Last updated 6 months ago * [What is Filecoin Pin?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-is-filecoin-pin) * [How can I use Filecoin Pin today?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-can-i-use-filecoin-pin-today) * [What do I need to get started?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-do-i-need-to-get-started) * [How do payments and approvals work?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-payments-and-approvals-work) * [How does auto-funding work?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-does-auto-funding-work) * [How long is my data stored?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-long-is-my-data-stored) * [What is a Data Set?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-is-a-data-set) * [How do I retrieve my data?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-i-retrieve-my-data) * [What is a piece CID vs root CID?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#what-is-a-piece-cid-vs-root-cid) * [How do I verify my data is actually stored?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-i-verify-my-data-is-actually-stored) * [How do I access the code for the dApp and CLI?](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#how-do-i-access-the-code-for-the-dapp-and-cli) * [References](https://docs.filecoin.io/builder-cookbook/filecoin-pin/faq#references) sun-brightdesktopmoon sun-brightdesktopmoon --- # Foundry | Filecoin Docs The template repository contains submodules and remappings for ds-test assertions for testing, solmate building blocks for contracts, and forge-std to layer on top of EVM cheat codes to improve UX. [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry#prerequisites) Prerequisites ----------------------------------------------------------------------------------------------------------------- You must have the following installed: * [Gitarrow-up-right](https://git-scm.com/) * [Yarnarrow-up-right](https://yarnpkg.com/) You should also have an address on the Filecoin Calibration testnet. See the [MetaMask setup page](https://docs.filecoin.io/basics/assets/metamask-setup) for information on how to get an address. You also need test `tFIL` in your wallet. [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry#steps) Steps ------------------------------------------------------------------------------------------------- 1. Clone the `filecoin-project/fevm-foundry-kit` repository and move into the `fevm-foundry-kit` directory: Copy git clone https://github.com/filecoin-project/fevm-foundry-kit/tree/main.git cd fevm-foundry-kit 1. Install the project dependencies with Yarn: Copy yarn install 1. Export your private key from MetaMask. See the [MetaMask documentationarrow-up-right](https://support.metamask.io/configure/accounts/how-to-export-an-accounts-private-key/) to find out how to export your private key. 2. Create your env file by running Copy cp .env.example .env 1. In your newly created`.env` replace `PRIVATE_KEY` with the one gathered from MetaMask. Also, do the same for the `CALIBRATIONNET_RPC_URL`.: 1. Inside the `src` folder in a contract called `SimpleCoin.sol`. Deploy this contract using Foundry: 1. You can now interact with your contract using the contract address given by Foundry. Done! For more information, see the [Foundry bookarrow-up-right](https://book.getfoundry.sh/) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/foundry) [PreviousHardhatchevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat) [NextSolidity librarieschevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries) Last updated 5 months ago * [Prerequisites](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry#prerequisites) * [Steps](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry#steps) sun-brightdesktopmoon Copy PRIVATE_KEY=eed8e9d727a647f7302bab440d405ea87d36726e7d9f233ab3ff88036cfbce9c CALIBRATIONNET_RPC_URL=https://api.calibration.node.glif.io/rpc/v1 Copy forge build forge create --rpc-url https://api.calibration.node.glif.io/rpc/v1 --private-key $PRIVATE_KEY src/SimpleCoin.sol:SimpleCoin --broadcast sun-brightdesktopmoon --- # Contract automation | Filecoin Docs In the Filecoin network, smart contracts benefit from a secure, deterministic environment. While this ensures reliability, it also limits direct access to external data sources. However, developers can leverage automation services to seamlessly connect off-chain data with on-chain smart contracts. This unlocks advanced capabilities such as price feeds, data verification, and much more, empowering Filecoin dapps with dynamic, real-world functionality by integrating external data into on-chain logic. [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#available-automation-services) Available automation services ------------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#gelato) [Gelatoarrow-up-right](https://gelato.network/) Gelato's Web3 Functions is a powerful automation system designed to streamline and enhance Web3 operations. Web3 Functions serve as a comprehensive tool, enabling developers to effortlessly set up, manage, and automate their smart contract tasks. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#how-gelato-web3-functions-work) **How Gelato Web3 functions work?** Web3 Functions can be triggered by various events and allow developers to write both off-chain logic (TypeScript) and on-chain logic (Solidity). Once deployed, they handle automated smart contract interactions, providing real-time monitoring and flexibility. **Off-chain Data or Computation?** Sometimes, automation tasks require data that isn't readily available on the blockchain, or they might need computations that are better performed off-chain. In such cases, Typescript Functions should be the choice. **All Checks On-chain?** If all the conditions necessary for your automation task can be directly verified on the blockchain, you have the option to select between Typescript Functions, Solidity Functions & Automated Transactions [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#triggers) Triggers ------------------------------------------------------------------------------------------------------- 1. Time Interval Use this trigger to execute tasks at regular intervals, e.g., every 10 minutes or once every 24 hours. It's like setting a straightforward, recurring alarm. 2. Cron Expressions This offers a more refined control compared to the Time Interval. With cron expressions, you can set tasks to run at specific moments, such as "every Tuesday at 3 PM" or "on the 1st of every month". It gives you precision in task scheduling. 3. On-Chain Event Ideal for those wanting their tasks to respond dynamically to blockchain activities. Whenever a specified event occurs on the blockchain, this trigger springs your task into action. It's like a vigilant watcher, always ready to act. 4. Every Block This function operates with the rhythm of the blockchain itself, executing your chosen function each time a new block is created. [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#what-to-execute) What to Execute? ---------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#typescript-functions) Typescript Functions Typescript Functions are decentralized cloud functions that work similarly to AWS Lambda or Google Cloud, just for web3. They enable developers to execute on-chain transactions based on arbitrary off-chain data (APIs / subgraphs, etc) & computation. These functions are written in Typescript, stored on IPFS and run by Gelato. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#solidity-functions) Solidity Functions Solidity Functions are crucial for making on-chain tasks automatic and more efficient. They connect set conditions with specific actions in a smart contract, providing a straightforward method to turn user needs into automated processes. Consider them as a set of "if-then" rules: If certain conditions are met on the blockchain, then a specific function gets executed. This level of automation ensures that the decentralized application can operate with minimal manual intervention, providing a seamless user experience. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#automated-transaction) Automated Transaction Automated Transaction ensures that a specific function on the target smart contract gets reliably triggered. When you pre-define the inputs, it means that every time Gelato initiates the function call, it uses consistent, predetermined arguments. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#what-is-dedicatedmsgsender) **What is dedicatedMsgSender?** For security reasons, during task creation, you will see an address that acts as the msg.sender for your task executions. This address is a proxy contract deployed by Gelato. It ensures that every task execution on behalf of your contract uses this dedicated msg.sender address, which is essential for validating the origin of the task. [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#quick-start) Quick Start ------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#writing-and-deploying-typescript-functions) Writing & Deploying Typescript Functions 1. Clone the hardhat-template repo 1. CD into the folder and install 1. Update the `index.ts` in one of the examples 1. Deploy the Web3 Function to IPFS and create the Task Result: Finally, go to the [Gelato Apparrow-up-right](https://app.gelato.network/) , create a new task, decide on the trigger, and input the CID. For a detailed guide on creating and deploying Web3 Functions, including setting up your development environment, triggers, and security configurations, refer to the full developer guide [herearrow-up-right](https://docs.gelato.network/web3-services/web3-functions/quick-start/writing-typescript-functions) . #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#further-resources) **Further Resources** * [Gelato Web3 Functions Docsarrow-up-right](https://docs.gelato.network/web3-services/web3-functions) * [What is 1Balance?arrow-up-right](https://docs.gelato.network/web3-services/1balance) * [Github Repositoryarrow-up-right](https://github.com/gelatodigital/how-tos-3-w3f-triggers) * [YouTube - How to write Event driven Web3 Functionsarrow-up-right](https://www.youtube.com/watch?v=7UpqGsANsBQ&ab_channel=JavierDonoso) [PreviousAggregated deal-makingchevron-left](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making) [NextRelaychevron-right](https://docs.filecoin.io/smart-contracts/advanced/relay) Last updated 1 year ago * [Available automation services](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#available-automation-services) * [Gelato](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#gelato) * [Triggers](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#triggers) * [What to Execute?](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#what-to-execute) * [Typescript Functions](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#typescript-functions) * [Solidity Functions](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#solidity-functions) * [Automated Transaction](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#automated-transaction) * [Quick Start](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#quick-start) * [Writing & Deploying Typescript Functions](https://docs.filecoin.io/smart-contracts/advanced/contract-automation#writing-and-deploying-typescript-functions) sun-brightdesktopmoon Copy git clone web3-functions-hardhat-template Copy cd web3-functions-hardhat-template && yarn install Copy Web3Function.onRun(async (context: Web3FunctionContext) => { const { userArgs, multiChainProvider } = context; const provider = multiChainProvider.default(); // Retrieve Last oracle update time const oracleAddress = (userArgs.oracle as string) ?? "0x71B9B0F6C999CBbB0FeF9c92B80D54e4973214da"; // YOUR CUSTOM LOGIC ..... // Return if nothing has to be pushed on-chain return { canExec: false, message: `Coingecko call failed` }; // Return if tx has to be pushed on-chain return { canExec: true, callData: [\ {\ to: oracleAddress,\ data: oracle.interface.encodeFunctionData("updatePrice", [price]),\ },\ ], }; }); Copy npx w3f deploy web3-functions/YOUR-FUNCTION/index.ts Copy $ npx w3f deploy web3-functions/YOUR-FUNCTION/index.ts ✓ Web3Function deployed to ipfs. ✓ CID: QmYMysfAhYYYrdhVytSTiE9phuoT49kMByktXSbVp1aRPx To create a task that runs your Web3 Function every minute, visit: > https://beta.app.gelato.network/new-task?cid=QmYMysfAhYYYrdhVytSTiE9phuoT49kMByktXSbVp1aRPx ✨ Done in 3.56s. sun-brightdesktopmoon --- # FILForwarder | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#the-problem) The problem ------------------------------------------------------------------------------------------------------------------ Filecoin has multiple [address spaces](https://docs.filecoin.io/basics/the-blockchain/addresses) : `f0`, `f1`, `f2`, `f3`, and `f4`. Each address space fits a particular need for the Filecoin network. The `f410` address spaces allow Ethereum addresses to be integrated into the Filecoin network. Users interacting with the Filecoin EVM runtime need to use `f4` addresses, masked to the Ethereum-style `0x` address. These addresses can be created from wallets like MetaMask, Coinbase wallet, or any other EVM-based wallet that allows for custom networks. There are use cases where a user with FIL in an `0x`\-style address would want to send FIL to an `f1`, `f2`, or `f3` address. For example, taking FIL out of a smart contract and sending it to a multi-sig account or an exchange. This is where the problem lies. Ethereum-based wallets do not recognize the `f1`, `f2`, or `f3` address formats, making it impossible to send FIL from an Ethereum-style address. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#the-solution) The solution -------------------------------------------------------------------------------------------------------------------- The FilForwarder exposes a smart contract method called `forward` that takes a byte-level definition of a protocol address in an _f-style_ and a message value. It then uses the internal Filecoin APIs exposed using the Filecoin EVM runtime to properly send FIL funds reliably and as cheaply as possible. This also has the side effect of creating the actor ID should the address receiving address be considered new. In this way, using FilForwarder from an Ethereum wallet to any other Filecoin address space is safe and reliable. [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#use-filforwarder) Use FILForwarder ---------------------------------------------------------------------------------------------------------------------------- You can use the FilForwarder contract in two ways: * Using the Glif.io browser wallet * Manually invoking the contract ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#glif.io) Glif.io Before we start, make sure you know the address you’d like to forward your FIL to. You’ll need to ensure that the `f410` Ethereum-style address has enough FIL to cover the transaction costs. 1. Go to [Glif.ioarrow-up-right](https://glif.io/en) . 2. Select the network you want to use from the dropdown and click **Connect Wallet**. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a9d3c14fc3b1c1666e4aad977de34ca282e8411f%252Fsmart-contracts-filecoin-evm-runtime-filforwader-select-network.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=63d21a1f&sv=2) Select the network you want to use. In this example, we’re using the (now deprecated) Hyperspace testnet. 3. Confirm that you want to connect your wallet to Glif.io. You will only be prompted to do this once. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-1a7b739dd69bf6d758be0d4b3810a57b94dd8f29%252Fsmart-contracts-filecoin-evm-runtime-filforwader-choose-wallet.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=51bb86f1&sv=2) Choose a wallet provider. 4. Click **Close** on the connection confirmation screen. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-6b57639604fd876ae154da1004ddad4c7d4cb20d%252Fsmart-contracts-filecoin-evm-runtime-filforwader-wallet-connected.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e30a8e35&sv=2) Wallet successfully connected to Glif 5. Select your wallet address from the dropdown and click **Forward FIL**. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-88720db4a9b42a8eb590444863317b82db1c6280%252Fsmart-contracts-filecoin-evm-runtime-filforwader-select-forward.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=845c16ae&sv=2) Select FIL Forward 6. Enter the destination address for your FIL, along with the amount of FIL you want to send: ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-cb7f2ca16688a83b0e825bc3c84b66f0e01c2eec%252Fsmart-contracts-filecoin-evm-runtime-filforwader-address-account.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=26be080b&sv=2) Enter a destination address and an amount. 7. Double-check that your destination address is correct and click **Send**. 8. You can check the transaction by clicking the transaction ID. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-0e57306ece80fc55a15bdb218c99d28e503a763a%252Fsmart-contracts-filecoin-evm-runtime-filforwader-transaction-id.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=93c48a11&sv=2) Check your transaction by clicking the ID. 9. Your funds should be available at the destination after around two minutes. You can check that your funds have arrived by searching for the destination address in a block explorer. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-e3362e5e88f8c1193d43b0547616d0450784b23a%252Fsmart-contracts-filecoin-evm-runtime-filforwader-block-explorer.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=d4a3f99f&sv=2) Funds in a block explorer. 10. If you can’t see your funds, make sure you’re viewing the correct network. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-67ce53b3b640327860c3a4c239f8cecac016c3b7%252Fsmart-contracts-filecoin-evm-runtime-filforwader-explorer-network.webp%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ab0686c4&sv=2) Change network within a block explorer. It generally takes around two minutes for a transaction to complete and for the funds to be available at the destination. ### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#manually) Manually The FilForwarder contract can be interacted with using standard Ethereum tooling like Hardhat or Remix. In this guide, we’re going to use Hardhat, but these steps can be easily replicated using the [web-based IDE Remix](https://docs.filecoin.io/smart-contracts/developing-contracts/remix) . #### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#prerequisites) **Prerequisites** This guide assumes you have the following installed: * [Yarnarrow-up-right](https://yarnpkg.com/) * A Filecoin address stored in [MetaMask](https://docs.filecoin.io/basics/assets/metamask-setup) #### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#environment-setup) **Environment setup** First, we need to grab the FilForwarder kit and install the dependencies: 1. Clone the FilForwarder repository and install the dependencies: 1. Use Yarn to install the project's dependencies: 1. Create an environment variable for your private key. Always be careful when dealing with your private key. Double-check that you’re not hardcoding it anywhere or committing it to source control like GitHub. Anyone with access to your private key has complete control over your funds. #### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#invoke-the-contract) **Invoke the contract** The contract is deterministically deployed on all Filecoin networks at `0x2b3ef6906429b580b7b2080de5ca893bc282c225`. Any contract claiming to be a FilForwarder that does not reside at this address should not be trusted. Any dApp can connect to the wallet and use the ABI in this repository to call this method using any frontend. See the [Glif section](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder) above for steps on using a GUI. Inside this repository is a Hardhat task called `forward`. This task will use the private key to send funds using the contract. This task uses the `fil-forwarder-{CHAIN_ID}.json` file to determine the deployed contract address for a given network. These addresses should always be the same, but these files prevent you from having to specify it each time. The `forward` command uses the following syntax: * `NETWORK`: The network you want to use. The options are `mainnet` and `calibration`. * `DESTINATION_ADDRESS`: The address you want to send FIL to. This is a string, like `t01024` or `t3tejq3lb3szsq7spvttqohsfpsju2jof2dbive2qujgz2idqaj2etuolzgbmro3owsmpuebmoghwxgt6ricvq`. * `AMOUNT`: The amount of FIL you want to send. The value `3.141` would be 3.141 FIL. #### [hashtag](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#examples) **Examples** 1. To send 9 FIL to a `t3` address on the Calibration testnet, run: 1. To send 42.5 FIL to a `t1` address on the Calibration testnet, run: [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder) [PreviousAddress typeschevron-left](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types) [NextDifference with Ethereumchevron-right](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum) Last updated 1 year ago * [The problem](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#the-problem) * [The solution](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#the-solution) * [Use FILForwarder](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#use-filforwarder) * [Glif.io](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#glif.io) * [Manually](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder#manually) sun-brightdesktopmoon Copy git clone [https://github.com/FilOzone/FilForwarder](https://github.com/FilOzone/FilForwarder) cd FilForwarder Copy yarn install [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... ... ✨ Done in 16.34s. Copy export PRIVATE_KEY='' # For example # export PRIVATE_KEY='d52cd65a5746ae71cf3d07a8cf392ca29d7acb96deba7d94b19a9cf3c9f63022'l Copy yarn hardhat forward \ --network \ --destination \ --amount Copy yarn hardhat forward \ --network calibration \ --destination t3tejq3lb3szsq7spvttqohsfpsju2jof2dbive2qujgz2idqaj2etuolzgbmro3owsmpuebmoghwxgt6ricvq \ --amount 9.0 Copy yarn hardhat forward \ --network calibration \ --destination t010135 \ --amount 42.5 sun-brightdesktopmoon --- # Multicall | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/advanced/multicall#multicall3) Multicall3 ------------------------------------------------------------------------------------------------- [Multicall3arrow-up-right](https://www.multicall3.com/) is a powerful tool that offers batch contract calls to smart contracts on the Filecoin Virtual Machine (FVM). Multicall3 is deployed on over 100 chains at `0xcA11bde05977b3631167028862bE2a173976CA11`. A sortable, searchable list of all chains it's deployed on can be found [herearrow-up-right](https://multicall3.com/deployments) . The [multicall3 ABIarrow-up-right](https://multicall3.com/abi) can be downloaded or copied to the clipboard in various formats, including: * Solidity interface. * JSON ABI, prettified. * JSON ABI, minified. * [ethers.jsarrow-up-right](https://docs.ethers.org/v5/) human readable ABI. * [viemarrow-up-right](https://viem.sh/) human readable ABI. Alternatively, you can: * Download the ABI from the [releasesarrow-up-right](https://github.com/mds1/multicall/releases) page. * Copy the ABI from [Etherscanarrow-up-right](https://etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code) . * Install [Foundryarrow-up-right](https://github.com/gakonst/foundry/) and run `cast interface 0xcA11bde05977b3631167028862bE2a173976CA11`. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/multicall#contract-address) Contract address Multicall has the same, precomputed address for all of the networks it is deployed on. Name Address Mainnet Calibration [Multicall - Mainnetarrow-up-right](https://filfox.info/en/address/0xcA11bde05977b3631167028862bE2a173976CA11?t=3) `0xcA11bde05977b3631167028862bE2a173976CA11` ✔️ ❌ [Multicall - Calibrationarrow-up-right](https://calibration.filscan.io/en/address/0xcA11bde05977b3631167028862bE2a173976CA11/) `0xcA11bde05977b3631167028862bE2a173976CA11` ❌ ✔️ ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/multicall#usage) Usage To use Multicall3 to send batch contract read/write to your smart contract, you will need to: 1. Obtain the Multicall3 contract address for the network you're using (Filecoin mainnet or Calibration testnet). 2. Get the Multicall3 ABI, which can be downloaded or copied from various sources mentioned above. 3. Create an instance of the Multicall3 contract using a web3 library like ethers.js or viem. 4. Prepare your batch calls, including the target contract addresses, function selectors, and input data. 5. Use the appropriate Multicall3 method (e.g., `aggregate3` for multiple calls) to execute your batch operations. 6. Process the returned data from the Multicall3 contract. The steps above differ slightly for integrations using smart contracts, where steps 2 and 3 are replaced with: 1. Import the Multicall3 interface in your smart contract. 2. Create a function that interacts with the Multicall3 contract using the imported interface. Many libraries and tools such as [ethers-rsarrow-up-right](https://docs.rs/ethers/latest/ethers/) , [viemarrow-up-right](https://viem.sh/) , and [apearrow-up-right](https://apeworx.io/) have native Multicall3 integration which can be used in your projects directly. To learn how to use Multicall3 with these tools, check out [Multicall3 examples folderarrow-up-right](https://github.com/mds1/multicall/blob/main/examples) #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/multicall#batching-contract-reads) Batching Contract Reads Batching contract reads, one of the most common use cases, allows a single `eth_call` JSON RPC request to return the results of multiple contract function calls. It has many benefits: 1. **Reduced JSON RPC Requests**: Multicall reduces the number of separate JSON RPC requests that need to be sent. This is particularly useful when using remote nodes, such as GLIF. By aggregating multiple contract reads into a single JSON-RPC request, Multicall (1) reduces RPC usage and therefore costs, and (2) reduces the number of round trips between the client and the node, which can significantly improve performance 2. **Consistent Data from the Same Block**: Multicall guarantees that all values returned are from the same block. This ensures data consistency and reliability, as all the read operations are performed on the same state of the blockchain. 3. **Detection of Stale Data**: Multicall enables the block number or timestamp to be returned with the read data. This feature helps in detecting stale data, as developers can compare the block number or timestamp with the current state of the blockchain to ensure the data is up-to-date. When directly interacting with the Multicall3 contract to batch calls, you'll typically use the `aggregate3` method. This method allows you to execute multiple contract calls in a single transaction. Here's an explanation of how it works, along with examples: 1. Solidity Implementation: The `aggregate3` method is implemented in the Multicall3 contract like this: 2. Example of sending multicalls to this smart contract: Here's an example using ethers.js to interact with the Multicall3 contract: This example demonstrates how to use Multicall3 to batch multiple `balanceOf` calls for an ERC20 token in a single transaction, significantly reducing the number of separate RPC calls needed. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/multicall#batch-contract-writes) Batch Contract Writes > ⚠️ Multicall3, while unaudited, can be safely used for batching on-chain writes when used correctly. As a stateless contract, it should never hold funds after a transaction ends, and users should never approve it to spend tokens. When using Multicall3, it's crucial to understand two key aspects: the behavior of `msg.sender` in calls versus delegatecalls, and the risks associated with `msg.value` in multicalls. In FVM, there are two types of accounts: Externally Owned Accounts (EOAs) controlled by private keys, and Contract Accounts controlled by code. The `msg.sender` value during contract execution depends on whether a CALL or DELEGATECALL opcode is used. CALL changes the execution context, while DELEGATECALL preserves it. For EOAs, which can only use CALL, Multicall3's address becomes the `msg.sender` for subsequent calls. This limits its usefulness from EOAs to scenarios where `**msg.sender**` **is irrelevant**. However, contract wallets or other contracts can use either CALL or DELEGATECALL, with the latter preserving the original `msg.sender`. The handling of `msg.value` in multicalls requires caution. Since `msg.value` doesn't change with delegatecalls, relying on it within a multicall can lead to security vulnerabilities. To learn more about this, see [herearrow-up-right](https://github.com/runtimeverification/verified-smart-contracts/wiki/List-of-Security-Vulnerabilities#payable-multicall) and [herearrow-up-right](https://samczsun.com/two-rights-might-make-a-wrong/) . [hashtag](https://docs.filecoin.io/smart-contracts/advanced/multicall#hints) Hints --------------------------------------------------------------------------------------- Lotus FEVM RPC supports Ethereum batch transactions. The key difference between `multicall` and batch transactions is that `multicall` aggregates multiple RPC requests into a single call, while batch transactions are simply an array of transactions executed sequentially but sent in one request. For more details, please refer to the [Ethereum documentationarrow-up-right](https://geth.ethereum.org/docs/interacting-with-geth/rpc/batch) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/multicall) [PreviousOracleschevron-left](https://docs.filecoin.io/smart-contracts/advanced/oracles) [NextMultisigchevron-right](https://docs.filecoin.io/smart-contracts/advanced/multisig) Last updated 5 months ago * [Multicall3](https://docs.filecoin.io/smart-contracts/advanced/multicall#multicall3) * [Contract address](https://docs.filecoin.io/smart-contracts/advanced/multicall#contract-address) * [Usage](https://docs.filecoin.io/smart-contracts/advanced/multicall#usage) * [Hints](https://docs.filecoin.io/smart-contracts/advanced/multicall#hints) sun-brightdesktopmoon Copy function aggregate3(Call3[] calldata calls) public payable returns (Result[] memory returnData) { uint256 length = calls.length; returnData = new Result[](length); for (uint256 i = 0; i < length;) { (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData); if (calls[i].allowFailure) { returnData[i] = Result(success, ret); } else { require(success, "Multicall3: call failed"); returnData[i] = Result(true, ret); } unchecked { ++i; } } } Copy const { ethers } = require("ethers"); const provider = new ethers.providers.JsonRpcProvider("https://api.node.glif.io/rpc/v1"); const multicallAddress = "0xcA11bde05977b3631167028862bE2a173976CA11"; const multicallAbi = [/* Multicall3 ABI */]; const multicall = new ethers.Contract(multicallAddress, multicallAbi, provider); // Example: Batch balance checks for multiple addresses async function batchBalanceChecks(addresses) { const calls = addresses.map(address => ({ target: "0x...", // ERC20 token address allowFailure: false, callData: ethers.utils.id("balanceOf(address)").slice(0, 10) + ethers.utils.defaultAbiCoder.encode(["address"], [address]).slice(2) })); const results = await multicall.aggregate3(calls); return results.map(result => ethers.utils.defaultAbiCoder.decode(["uint256"], result.returnData)[0]); } batchBalanceChecks(["0x123...", "0x456...", "0x789..."]).then(console.log); sun-brightdesktopmoon --- # Install & Run PDP | Filecoin Docs triangle-exclamation **ALPHA FEATURE - UNDER DEVELOPMENT** This documentation covers the PDP (Proof of Data Possession) feature, which is currently in alpha and under active development. This tool is intended for testing and experimental use only. For production use and submitting real deals with live PDP Storage Providers, please use the [Synapse SDKarrow-up-right](https://github.com/FilOzone/synapse-sdk) . [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#prerequisites) 🚀 Prerequisites ----------------------------------------------------------------------------------------------------------------- circle-exclamation **Note:** This guide is written specifically for **Ubuntu 22.04**. If you are using a different Linux distribution, refer to the relevant documentation for package installation and compatibility. Before starting, make sure you have a user with **sudo privileges**. This section prepares your system for the PDP stack. * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#hardware-requirements) ⚙️ Hardware requirements * **RAM**: 32 GiB+ * **CPU**: 8 Core+ * **Storage**: * 1 TiB Fast storage (NVMe/SSD) * 10 TiB Long-term storage (HDD) * **GPU**: Not required * **Connectivity**: Public HTTPS endpoint (domain) * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#system-package-installation) 🧰 System Package Installation * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-go-v1.24.0) 🔨 Install Go (v1.24.0) circle-check You should see something like: `go version go1.23.7 linux/amd64` * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-rust) 🔧 Install Rust circle-info When prompted, choose the option 1) Proceed with standard installation (default — just press Enter). circle-check You should see something like: `rustc 1.86.0 (05f9846f8 2025-03-31)` * * * [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#installing-and-running-lotus) ⛓️ Installing and Running Lotus ----------------------------------------------------------------------------------------------------------------------------------------------- 🧠 Lotus is your gateway to the Filecoin network. It syncs the chain, manages wallets, and is required for Curio to interact with your node. [](https://lotus.filecoin.io/lotus/get-started/what-is-lotus/) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a8c4dc51d546115a1f413e4b02906077736bb57e%252Flotus-logo-big.png%3Falt%3Dmedia&width=490&dpr=3&quality=100&sign=3373dce8&sv=2) Lotus Documentation [](https://filecoinproject.slack.com/archives/CPFTWMY7N) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-556b1da4242b6018067b30ecb463cc7166a08180%252FFilecoin.svg.png%3Falt%3Dmedia&width=490&dpr=3&quality=100&sign=86c6a159&sv=2) Lotus Support Channels ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#build-lotus-daemon) 🔧 Build Lotus Daemon Clone and check out Lotus: **Build and Install for Mainnet** **Build and Install for Calibration** circle-check You should see something like: `lotus version 1.32.2+calibnet+git.ff88d8269` * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#import-a-snapshot-and-start-the-daemon) 📦 Import a Snapshot and Start the Daemon Download the Snapshot **Mainnet:** **Calibration:** **Import and Start the Daemon** circle-info If you encounter errors related to `EnableEthRPC` or `EnableIndexer`, run the following command and restart Lotus **Monitor Sync Progress** To monitor continuously: **Monitor Logs** * * * [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#running-yugabytedb) 🐘 Running YugabyteDB --------------------------------------------------------------------------------------------------------------------------- 🧠 Curio uses YugabyteDB to store metadata about deals, sealing operations, and PDP submissions. [](https://docs.yugabyte.com/preview/tutorials/quick-start/linux/) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-954f89d8ae650f7ce94a8d50902570a1131acf50%252Fyugabyte.svg%3Falt%3Dmedia%26token%3D5db82be5-0cc2-4423-b94a-50851196212b&width=490&dpr=3&quality=100&sign=c6a0f46c&sv=2) Yugabyte Documentation [](https://filecoinproject.slack.com/archives/C06LF5YP8S3) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a0cd37b6fded633ebec09c478d5e2b4360cbd0ff%252FCurio_placeholder.webp%3Falt%3Dmedia&width=490&dpr=3&quality=100&sign=248bbf70&sv=2) Yugabyte Support Channels ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#set-ulimit-configuration) 🛠 Set ulimit configuration circle-exclamation Before starting Yugabyte, you must increase the default `ulimit` values to ensure system limits do not interfere with the database. To do this: #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#persist-new-limits-across-reboots) 🔁 **Persist new limits across reboots** Add these lines to `/etc/security/limits.conf`: This ensures the increased limits are automatically applied to future sessions. #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#apply-limit-immediately-for-current-shell-only) ⚡ **Apply limit immediately (for current shell only)** Verify: circle-check This should output `1048576`. ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-yugabyte) ⚙️ Install Yugabyte ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#start-the-db) 🚀 Start the DB circle-exclamation If you encounter locale-related errors when starting Yugabyte for the first time, run: circle-check Visit `http://127.0.0.1:15433` to confirm successful installation. This is the YugabyteDB web UI — it should display the dashboard if the service is running correctly and all nodes are healthy. circle-info You can also check your Yugabyte cluster details directly in the CLI with: * * * [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#installing-and-configuring-curio) 🧱 Installing and Configuring Curio ------------------------------------------------------------------------------------------------------------------------------------------------------- 🧠 Curio is the core PDP client that coordinates sealing, interacts with Lotus and submits PDP proofs. [](https://docs.curiostorage.org/) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a0cd37b6fded633ebec09c478d5e2b4360cbd0ff%252FCurio_placeholder.webp%3Falt%3Dmedia&width=490&dpr=3&quality=100&sign=248bbf70&sv=2) Curio Documentation [](https://filecoinproject.slack.com/archives/C06LF5YP8S3) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-556b1da4242b6018067b30ecb463cc7166a08180%252FFilecoin.svg.png%3Falt%3Dmedia&width=490&dpr=3&quality=100&sign=86c6a159&sv=2) Curio Support Channels ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#system-configuration) ⚙️ System Configuration Before you proceed with the installation, you should increase the UDP buffer size: To make this change persistent across reboots: ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#build-curio) 🔬 Build Curio Clone the repository and switch to the PDP branch: circle-info Curio is compiled for a specific Filecoin network at build time. Choose the appropriate build command below. Mainnet Calibration circle-info This step will take a few minutes to complete. ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-and-verify-curio) ✅ Install and Verify Curio Run the following to install the compiled binary: This will place curio in `/usr/local/bin` Verify the installation: Expected example output: * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#guided-setup) 🔧 Guided Setup Curio provides a utility to help you set up a new miner interactively. Run the following command: #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#id-1-select-curio-installation-type) 1️⃣ Select Curio Installation Type Use the arrow keys to navigate the guided setup menu and select "**Setup non-Storage Provider cluster**". #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#id-2-enter-your-yugabytedb-connection-details) 2️⃣ Enter Your YugabyteDB Connection Details If you used the default installation steps from this guide, the following values should work: * Host: `127.0.0.1` * Port: `5433` * Username: `yugabyte` * Password: `yugabyte` * Database: `yugabyte` You can verify these settings by running the following command from the Yugabyte directory: After selecting "**Continue to connect and update schema**", Curio will automatically create the required tables and schema in the database. #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#id-3-telemetry-optional) 3️⃣ Telemetry (Optional) You'll be asked whether to share anonymised or signed telemetry with the Curio team to help improve the software. Select your preference and continue. #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#id-4-save-database-configuration) 4️⃣ Save Database Configuration At the final step of the guided setup, you'll be prompted to choose where to save your database configuration file. Use the arrow keys to select a location. A common default is: Once selected, setup will complete, and the miner configuration will be stored. #### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#id-5-launch-the-curio-web-gui) 5️⃣ Launch the Curio Web GUI To explore the Curio interface visually, start the GUI layer: Then, open your browser and go to: This will launch the Curio web GUI locally. * * * [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#enabling-fwss-pdp) 🧪 Enabling FWSS PDP ------------------------------------------------------------------------------------------------------------------------- 🧠 This section enables **FWSS Proof of Data Possession (PDP)** on your SP node using Curio. These steps guide you through running a standalone PDP service using Curio and pdptool. [](https://filecoinproject.slack.com/archives/C0717TGU7V2) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-556b1da4242b6018067b30ecb463cc7166a08180%252FFilecoin.svg.png%3Falt%3Dmedia&width=490&dpr=3&quality=100&sign=86c6a159&sv=2) PDP Support Channels ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#attach-storage-locations) 📦 Attach Storage Locations With Curio running with the GUI layer: Run the following commands in your Curio CLI to attach storage paths: circle-info Your fast-storage path should point to high-performance storage media such as NVMe or SSD * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#add-a-pdp-configuration-layer) 🔧 Add a PDP Configuration Layer Browse to the **Configurations** page of the Curio GUI. Create a new layer named **pdp** and enable the following under Subsystems: circle-info You may find it helpful to search for the setting names in your browser. * ✅ `EnableParkPiece` * ✅ `EnablePDP` * ✅ `EnableCommP` * ✅ `EnableMoveStorage` In the **HTTP** section: * ✅ Enable: `true` * 🌐 DomainName: `your domain (e.g., pdp.mydomain.com)` * 📡 ListenAddress: `0.0.0.0:443` circle-info **Tip:** You must point your domain's A record to your server's public IP address for Let's Encrypt to issue a certificate. * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#import-your-filecoin-wallet-private-key) 💰 Import your Filecoin Wallet Private Key: circle-exclamation There are several ways to obtain private keys for Ethereum addresses. In this guide, we will use a new delegated FIL wallet address. Create a new delegated wallet: circle-info You can display your Lotus wallets at any time by running: Export & convert your new delegated wallet address private key: Browse to the **PDP** page of the Curio GUI and in the **Owner Address** section: * Select **Import Key** * Copy the previously generated private wallet key into the **Private Key (Hex)** field. * Select **Import Key** circle-check Your 0x wallet address - the delegated Ethereum address derived from your Filecoin delegated wallet private key - will be added to the **Owner Address** section of the Curio PDP page. Make sure to send a small amount of FIL or tFIL (testnet FIL) to your 0x wallet - we recommend 8 FIL for Mainnet & 5 tFIL for Calibration to ensure uninterrupted PDP operation during initial setup and testing. [Calibration test FIL faucet informationarrow-up-right](https://docs.filecoin.io/smart-contracts/developing-contracts/get-test-tokens) . circle-exclamation **Important:** Secure your private key material. Don't expose or store it in plain text without protection. * * * ### [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#restart-and-verify) 🚀 Restart and Verify Restart Curio with both layers: circle-info If you encounter errors related to `EnableEthRPC` or `EnableIndexer`, run the following command and restart Lotus circle-info If you encounter errors binding to port 443 when starting Curio with the pdp configuration layer, run: Test the PDP service: circle-info If `pdptool` is not installed, clone and build Curio: Generate a service secret: circle-info Always use `public` for the `--service-name` flag circle-check Expected output: * * * [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#youre-done) 🎉 You're Done! ------------------------------------------------------------------------------------------------------------- You've successfully launched a **PDP-enabled Filecoin Storage Provider** stack. Your system is now: * ✅ Syncing with the Filecoin network via Lotus * ✅ Recording deal and sector metadata in YugabyteDB * ✅ Operating Curio to manage sealing and coordination * ✅ Enabled Proof of Data Possession (PDP) * ✅ Connected to your PDP-enabled storage provider * * * [hashtag](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#next-steps) 🔜 Next Steps ----------------------------------------------------------------------------------------------------------- * ✔️ Register your FWSS node * 🔗 Explore FWSS & PDP tools & resources at [https://www.filecoin.servicesarrow-up-right](https://www.filecoin.services/) * 💬 Join the community - Filecoin Slack - [#fil-pdparrow-up-right](https://filecoinproject.slack.com/archives/C0717TGU7V2) [PreviousPDPchevron-left](https://docs.filecoin.io/storage-providers/pdp) [NextImplementationschevron-right](https://docs.filecoin.io/nodes/implementations) Last updated 1 month ago * [🚀 Prerequisites](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#prerequisites) * [⚙️ Hardware requirements](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#hardware-requirements) * [🧰 System Package Installation](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#system-package-installation) * [🔨 Install Go (v1.24.0)](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-go-v1.24.0) * [🔧 Install Rust](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-rust) * [⛓️ Installing and Running Lotus](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#installing-and-running-lotus) * [🔧 Build Lotus Daemon](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#build-lotus-daemon) * [📦 Import a Snapshot and Start the Daemon](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#import-a-snapshot-and-start-the-daemon) * [🐘 Running YugabyteDB](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#running-yugabytedb) * [🛠 Set ulimit configuration](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#set-ulimit-configuration) * [⚙️ Install Yugabyte](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-yugabyte) * [🚀 Start the DB](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#start-the-db) * [🧱 Installing and Configuring Curio](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#installing-and-configuring-curio) * [⚙️ System Configuration](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#system-configuration) * [🔬 Build Curio](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#build-curio) * [✅ Install and Verify Curio](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#install-and-verify-curio) * [🔧 Guided Setup](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#guided-setup) * [🧪 Enabling FWSS PDP](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#enabling-fwss-pdp) * [📦 Attach Storage Locations](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#attach-storage-locations) * [🔧 Add a PDP Configuration Layer](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#add-a-pdp-configuration-layer) * [💰 Import your Filecoin Wallet Private Key:](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#import-your-filecoin-wallet-private-key) * [🚀 Restart and Verify](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#restart-and-verify) * [🎉 You're Done!](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#youre-done) * [🔜 Next Steps](https://docs.filecoin.io/storage-providers/pdp/install-and-run-pdp#next-steps) sun-brightdesktopmoon Copy sudo apt update && sudo apt upgrade -y && sudo apt install -y \ mesa-opencl-icd ocl-icd-opencl-dev gcc git jq pkg-config curl clang \ build-essential hwloc libhwloc-dev libarchive-dev wget ntp python-is-python3 aria2 Copy sudo rm -rf /usr/local/go wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc source ~/.bashrc go version Copy curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh Copy source $HOME/.cargo/env rustc --version Copy git clone https://github.com/filecoin-project/lotus.git cd lotus git checkout $(curl -s https://api.github.com/repos/filecoin-project/lotus/releases/latest | jq -r .tag_name) Copy make clean && make lotus sudo make install-daemon lotus --version Copy make clean && make GOFLAGS="-tags=calibnet" lotus sudo make install-daemon lotus --version Copy aria2c -x5 -o snapshot.car.zst https://forest-archive.chainsafe.dev/latest/mainnet/ Copy aria2c -x5 -o snapshot.car.zst https://forest-archive.chainsafe.dev/latest/calibnet/ Copy lotus daemon --import-snapshot snapshot.car.zst --remove-existing-chain --halt-after-import nohup lotus daemon > ~/lotus.log 2>&1 & Copy sed -i 's/^\( *\)#*EnableEthRPC = .*/\1EnableEthRPC = true/; s/^\( *\)#*EnableIndexer = .*/\1EnableIndexer = true/' ~/.lotus/config.toml Copy lotus sync wait Copy lotus sync wait --watch Copy tail -f ~/lotus.log Copy echo "$(whoami) soft nofile 1048576" | sudo tee -a /etc/security/limits.conf echo "$(whoami) hard nofile 1048576" | sudo tee -a /etc/security/limits.conf Copy ulimit -n 1048576 Copy ulimit -n Copy wget https://software.yugabyte.com/releases/2.25.1.0/yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz tar xvfz yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz cd yugabyte-2.25.1.0 ./bin/post_install.sh Copy ./bin/yugabyted start \ --advertise_address 127.0.0.1 \ --master_flags rpc_bind_addresses=127.0.0.1 \ --tserver_flags rpc_bind_addresses=127.0.0.1 Copy sudo locale-gen en_US.UTF-8 Copy ./bin/yugabyted status Copy sudo sysctl -w net.core.rmem_max=2097152 sudo sysctl -w net.core.rmem_default=2097152 Copy echo 'net.core.rmem_max=2097152' | sudo tee -a /etc/sysctl.conf echo 'net.core.rmem_default=2097152' | sudo tee -a /etc/sysctl.conf Copy git clone https://github.com/filecoin-project/curio.git cd curio git checkout pdpM3d Copy make clean build Copy make clean calibnet Copy sudo make install Copy curio --version Copy curio version 1.24.4+calibnet+git_f954c0a_2025-04-06T15:46:32-04:00 Copy curio guided-setup Copy ./bin/yugabyted status Copy /home/your-username/curio.env Copy curio run --layers=gui Copy http://127.0.0.1:4701 Copy curio run --layers=gui Copy curio cli storage attach --init --seal /fast-storage/path curio cli storage attach --init --store /long-term-storage/path Copy lotus wallet new delegated Copy # Example output: t410fuo4dghaeiqzokiqnxruzdr6e3cjktnxprrc56bi Copy lotus wallet list Copy lotus wallet export | xxd -r -p | jq -r '.PrivateKey' | base64 -d | xxd -p -c 32 Copy # Example output: d4c2e3f9a716bb0e47fa91b2cf4a29870be3c5982fd6eafed71e8ac3f9c0b127 Copy curio run --layers=gui,pdp Copy sed -i 's/^\( *\)#*EnableEthRPC = .*/\1EnableEthRPC = true/; s/^\( *\)#*EnableIndexer = .*/\1Enabl Copy sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/curio Copy git clone https://github.com/filecoin-project/curio.git cd curio/cmd/pdptool go build . Copy ./pdptool create-service-secret Copy ./pdptool ping --service-url https://your-domain.com --service-name public Copy Ping successful: Service is reachable and JWT token is valid. sun-brightdesktopmoon --- # Chain-Data Query | Filecoin Docs ### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#connecting-to-filecoin-networks-via-public-rpc-nodes) Connecting to Filecoin networks via public RPC nodes To query chain state and data on any Filecoin network, it is necessary to connect to public node providers. However, it's important to note that most public node providers offer limited access, typically allowing read-only JSON RPC calls and `MPoolPush` to send signed messages to the Filecoin networks. To explore further details about the available public RPC providers supporting Filecoin mainnet and Calibration testnet, you can refer to the following page. * [Filecoin mainnet RPCsarrow-up-right](https://docs.filecoin.io/networks/mainnet/rpcs) * [Filecoin Calibration testnet RPCsarrow-up-right](https://docs.filecoin.io/networks/calibration/rpcs) #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#ingredients) **Ingredients** Let's use Glif nodes as an example to demonstrate how to connect to a public Filecoin RPC node provider. Additionally, we will utilize `ethers.js` to establish the connection with the RPC nodes. * [Glif nodesarrow-up-right](https://hosting.glif.io/) * [ethers.jsarrow-up-right](https://docs.ethers.org/v5/) #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#instructions) **Instructions** We will use `ethers.js` to establish a connection with the public Filecoin node provided by Glif. The following code demonstrates connecting to the Filecoin Calibration testnet as an example. Copy import { ethers } from "ethers" //The public Filecoin calibration URL const filecoin_url = 'https://api.calibration.node.glif.io/rpc/v1' const provider = new ethers.JsonRpcProvider(filecoin_url) const blockNumber = await provider.getBlockNumber() console.log("Block height: ", blockNumber) The expected output: * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#listen-to-smart-contract-events) Listen to smart contract events Since the Filecoin Virtual Machine (FVM) is EVM-compatible, we can use `ethers.js` to listen to smart contract events for specific contract actions on the Filecoin network. For instance, we can monitor ERC20 token `transfer` events or client contract `DealProposalCreate` events. #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#ingredients-1) **Ingredients** We will also use `ethers.js` to connect to the public Glif node to listen to the smart contract events. * [Glif Nodesarrow-up-right](https://hosting.glif.io/) * [ethers.jsarrow-up-right](https://docs.ethers.org/v5/) #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#instructions-1) **Instructions** Let's consider the [wFIL contractarrow-up-right](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil) , an ERC-20 token on Filecoin, as an example for listening to its transfer event. To demonstrate how to listen to smart contract events using ethers, we will use the deployed wFIL token address on the Filecoin calibration network and a simplified ABI object for the transfer event. Typically, you would have the wFIL smart contract's Application Binary Interface (ABI) defined in an `abi.json` file. The code to listen to `transfer` events for the wFIL token. Once a wFIL token transfer is executed on the blockchain, the following code snippet will capture the corresponding events and print out the event details. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#filter-smart-contract-events) Filter smart contract events We can also use filters to retrieve specific smart contract transactions from the Filecoin network. Filters enable us to define criteria or conditions to search for event logs that match specific requirements. By setting up a filter, we can monitor and retrieve event logs related to our interests or specific smart contracts. #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#ingredients-2) **Ingredients** We will also use `ethers.js` to connect to the public Glif node to filter the smart contract events by providing conditions. * [Glif nodesarrow-up-right](https://hosting.glif.io/) * [ethers.jsarrow-up-right](https://docs.ethers.org/v5/) #### [hashtag](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#instructions-2) **Instructions** Here's an example of how you can connect to a Glif node on the calibration network, create a filter to list all wFIL token transfers from your address, and execute the filter to look back 2000 blocks to find the matched transaction list: The expected transaction will be similar as follows. With this information, you can develop custom logic to efficiently track and process specific events or blocks on your FEVM smart contracts. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query) [PreviousdAppschevron-left](https://docs.filecoin.io/builder-cookbook/dapps) [NextOracleschevron-right](https://docs.filecoin.io/builder-cookbook/dapps/oracles) Last updated 5 months ago * [Connecting to Filecoin networks via public RPC nodes](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#connecting-to-filecoin-networks-via-public-rpc-nodes) * [Listen to smart contract events](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#listen-to-smart-contract-events) * [Filter smart contract events](https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query#filter-smart-contract-events) sun-brightdesktopmoon Copy Block height: 1268350 Copy import { ethers } from "ethers" const wFILAddress = "0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4" // wFIL Contract var abi = ["event Transfer(address indexed from, address indexed to, uint amount)"] const filecoin_url = 'https://api.calibration.node.glif.io/rpc/v1' const provider = new ethers.providers.JsonRpcProvider(filecoin_url) //listen to the Transfer events in the Token contract const wFIL = new ethers.Contract(wFILAddress, abi, provider) wFIL.on("Transfer", (from, to, value, event)=>{ let transferEvent ={ from: from, to: to, value: value, eventData: event, } console.log(JSON.stringify(transferEvent, null, 4)) }) Copy import { ethers } from "ethers" const wFILAddress = "0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4" // wFIL Contract var abi = ["event Transfer(address indexed from, address indexed to, uint amount)"] const filecoin_url = 'https://api.calibration.node.glif.io/rpc/v1' const provider = new ethers.providers.JsonRpcProvider(filecoin_url) // Create a filter to list all token transfers from myAddress const filter = contract.filters.Transfer("0xd388aB098ed3E84c0D808776440B48F685198498"); //Filter on the events back to 2000 blocks. const currentBlockHight = await provider.getBlockNumber(); const result = await contract.queryFilter(filter,currentBlockHight-2000, currentBlockHight ); console.log(result); Copy { blockNumber: 1268728, blockHash: '0x7b4f34d3f7ef791da7f9ab1c342cf147eedf7ec4f99fe92b94a9372927779961', transactionIndex: 0, removed: false, address: '0xb44cc5FB8CfEdE63ce1758CE0CDe0958A7702a16', data: '0x0000000000000000000000000000000000000000000000001bc16d674ec80000', topics: [\ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',\ '0x000000000000000000000000d388ab098ed3e84c0d808776440b48f685198498',\ '0x00000000000000000000000044061aa8df5b33a997ce97d80c700d0c655dc3f2'\ ], transactionHash: '0x7adb72ac19bf6baa5176f5da799128140ea3a9a9306bf6b1ff52edc58c621c4b', logIndex: 0, removeListener: [Function (anonymous)], getBlock: [Function (anonymous)], getTransaction: [Function (anonymous)], getTransactionReceipt: [Function (anonymous)], event: 'Transfer', eventSignature: 'Transfer(address,address,uint256)', decode: [Function (anonymous)], args: [\ '0xd388aB098ed3E84c0D808776440B48F685198498',\ '0x44061AA8Df5b33a997CE97d80c700d0C655Dc3f2',\ [BigNumber],\ from: '0xd388aB098ed3E84c0D808776440B48F685198498',\ to: '0x44061AA8Df5b33a997CE97d80c700d0C655Dc3f2',\ amount: [BigNumber]\ ] }, sun-brightdesktopmoon --- # Overview | Filecoin Docs The Builder Cookbook is designed to help builders quickly discover and learn the specific features required to develop robust solutions on Filecoin. This comprehensive collection of straightforward recipes serves as a practical guide, showcasing the usage and best practices of core features on Filecoin, enabled by the [Filecoin Virtual Machine(FVM)](https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) . ### [hashtag](https://docs.filecoin.io/builder-cookbook/overview#how-to-use-this-cookbook) **How to use this cookbook?** These cookbook recipes are solution-focused (e.g. "How can I do..."), as opposed to tutorials for standalone features (e.g. "How can I use..."). They serve as a valuable feature database for builders, enabling them to select and develop various dApps. Each recipe contains: * **Introduction** A clear and brief overview or context of this recipe that focuses on explaining a specific, small feature. * **Ingredients** a set of the necessary tools, libraries, or dependencies required for this recipe might need to be installed in advance. * **Instructions** step-by-step instructions for implementing the recipe with code examples, and expected output if there is one. The code snippet in the example can be slightly modified and copied into your projects for experimentation. ### [hashtag](https://docs.filecoin.io/builder-cookbook/overview#quick-start) **Quick Start** [](https://docs.filecoin.io/builder-cookbook/data-storage) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-e2de4c8150a5f6d104ec1f22223b2e390d4cf38c%252Ffvm-1.png%3Falt%3Dmedia&width=752&dpr=3&quality=100&sign=544ac0a3&sv=2) _**Data Storage**_ Recipes for programmable storage and retrieval of your public or private data on Filecoin. [](https://docs.filecoin.io/builder-cookbook/dapps) ![Cover](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-1db47c1d27fa1bd9cda810ac368943bf9020d731%252Ffvm-2.png%3Falt%3Dmedia&width=752&dpr=3&quality=100&sign=ca0d95e0&sv=2) _**dApps Development**_ Recipes of various features to build cross-networks dApps like DeFi, DeSci, NFT, and more. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/overview) [PreviousWeb3chevron-left](https://docs.filecoin.io/reference/json-rpc/web3) [NextTable of Contentschevron-right](https://docs.filecoin.io/builder-cookbook/table-of-contents) Last updated 1 year ago * [How to use this cookbook?](https://docs.filecoin.io/builder-cookbook/overview#how-to-use-this-cookbook) * [Quick Start](https://docs.filecoin.io/builder-cookbook/overview#quick-start) sun-brightdesktopmoon sun-brightdesktopmoon --- # Using RaaS | Filecoin Docs RaaS refers to replication, renewal and repair as a service, for data stored in storage deals on Filecoin. You can read more [here](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces) . In this article, we will cover how to create storage deals, with replication, renew and repair requirements, via a smart contract. This utilizes the [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) . ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas#interacting-with-the-smart-contract) Interacting with the Smart Contract First, you need to: * EITHER start an instance of the BaseInterface by deploying a contract that inherits from `IAggregatorOracle` (you can do so via. `yarn deploy` in the [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) ) * OR use an existing instance of the FullInterface located at * Calibration Testnet: `0x6ec8722e6543fB5976a547434c8644b51e24785b` Interact with the smart contract by submitting a CID of your choice to the `submit` function. This will create a new deal request that will be picked up by the RaaS services. Copy // contractInstance is the address of the contract you deployed or the FullInterface address above. const dealStatus = await ethers.getContractAt("DealStatus", contractInstance); // Submit the CID of the file you want to upload to the Filecoin network in the following way. await dealStatus.submit(ethers.utils.toUtf8Bytes(newJob.cid)); The [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) provides you with a frontend that allows you to upload your file to Lighthouse, get a CID for the uploaded file, then seamlessly submit the CID to the smart contract (accessible via `yarn start`). Before that, you need to know how to register the various RaaS workers. Note that RaaS functionality will NOT function automatically if deals are only created using submit function. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas#add-replication-renewal-repair-workers) Add Replication, Renewal, Repair Workers You can add workers to perform replication, renewal, and repair jobs by having them listen to the `SubmitAggregatorRequest`. The methods for doing so differ between the Base and Full interfaces. If you are running a base interface (specifically, the one in the [RaaS Starter Kitarrow-up-right](https://github.com/filecoin-project/raas-starter-kit) ), there's an event listener inside the RaaS service node that you can use to listen for new deal requests. This event listener performs processing for each job submitted to the contract to add RaaS service workers and eventually to call `complete` on the contract. To use this, call `yarn service` in the terminal and proceed through the frontend, as you normally would when uploading a file. Register the workers using the autocompleted CID that appears in the box. If you want to register the workers manually for a job that you didn't upload, paste in the known CID of your file into the box and register the jobs. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas) [PreviousDirect deal-making with Client contractchevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial) [NextVerify a contractchevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract) Last updated 1 year ago * [Interacting with the Smart Contract](https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas#interacting-with-the-smart-contract) * [Add Replication, Renewal, Repair Workers](https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas#add-replication-renewal-repair-workers) sun-brightdesktopmoon Copy // Initialize the listener for the Deal Creation event async function initializeDealCreationListener() { const dealStatus = await ethers.getContractAt(contractName, contractInstance); /// Logic for handling SubmitAggregatorRequest events function handleEvent(transactionId, cid) { console.log(`Received SubmitAggregatorRequest event: (Transaction ID: ${transactionId}, CID: ${cid})`); // ... other code to handle the event emission (async () => { // ... other code // After processing this event, reattach the event listener if (dealStatus.listenerCount("SubmitAggregatorRequest") === 0) { dealStatus.once("SubmitAggregatorRequest", handleEvent); } })(); } // Start listening to the first event and recursively handle the next events if (dealStatus.listenerCount("SubmitAggregatorRequest") === 0) { dealStatus.once("SubmitAggregatorRequest", handleEvent); } } sun-brightdesktopmoon --- # Filecoin.sol | Filecoin Docs For conceptual information on built-in actors, including their purposes, how they work and more, see the [conceptual guide](https://docs.filecoin.io/reference/built-in-actors) . [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#prerequisites) Prerequisites ----------------------------------------------------------------------------------------------------------- Before you can call a built-in actor using the API, you must [import filecoin.solidity using one of the available methods](https://docs.filecoin.io/smart-contracts/developing-contracts#call-built-in-actors/#using-filecoinsolidity) . [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-a-built-in-actor) Call a built-in actor --------------------------------------------------------------------------------------------------------------------------- For available actors and methods see [Available actors and methods](https://docs.filecoin.io/smart-contracts/developing-contracts#call-built-in-actors/#available-actors-and-methods) . Once you’ve either imported particular contracts manually or simply installed `filecoin-solidity` using `npm`, create a callable method to access the built-in actor methods the way you normally would in a Solidity smart contract. Working examples of smart contracts that call built-in actor methods are available below. * [Account](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-account-actor) * [DataCap](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-datacap-actor) * [Miner](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-miner-actor) * [Storage market](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-market-actor) * [Storage power](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-power-actor) * [Verified registry](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-verified-registry-actor) For conceptual information on built-in actors, including their purposes, how they work and available types, see the [conceptual guide](https://docs.filecoin.io/reference/built-in-actors) . ### [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-account-actor) Call the account actor The following example imports the Account actor library and creates a callable method for each of the [available actor methods](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-account-actor) . For the full code, see [the GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/account.test.sol) . ### [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-datacap-actor) Call the DataCap actor The following example imports the DataCap actor library and creates a callable method for each of the [available actor methods](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-datacap-actor) . For the full code, see [the GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/datacap.test.sol) . ### [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-market-actor) Call the storage market actor The following example imports the Storage market actor library and creates a callable method for each of the [available actor methods](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-market-actor) . For the full code, see [the GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/miner.test.sol) . ### [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-miner-actor) Call the miner actor The following example imports the Account actor library and creates a callable method for each of the [available actor methods](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-miner-actor) . For the full code, see [the GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/miner.test.sol) . ### [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-power-actor) Call the storage power actor The following example imports the Storage power actor library and creates a callable method for each of the [available actor methods](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-power-actor) . For the full code, see [the GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/power.test.sol) . ### [hashtag](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-verified-registry-actor) Call the verified registry actor The following example imports the verified registry actor library and creates a callable method for each of the [available actor methods](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-verified-registry-actor) . For the full code, see [the GitHub repositoryarrow-up-right](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/verifreg.test.sol) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/built-in-actors/filecoin.sol) [PreviousProtocol APIchevron-left](https://docs.filecoin.io/reference/built-in-actors/protocol-api) [NextJSON-RPCchevron-right](https://docs.filecoin.io/reference/json-rpc) Last updated 1 year ago * [Prerequisites](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#prerequisites) * [Call a built-in actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-a-built-in-actor) * [Call the account actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-account-actor) * [Call the DataCap actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-datacap-actor) * [Call the storage market actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-market-actor) * [Call the miner actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-miner-actor) * [Call the storage power actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-storage-power-actor) * [Call the verified registry actor](https://docs.filecoin.io/reference/built-in-actors/filecoin.sol#call-the-verified-registry-actor) sun-brightdesktopmoon Copy pragma solidity ^0.8.17; import "../types/AccountTypes.sol"; import "../types/CommonTypes.sol"; import "../AccountAPI.sol"; import "../Utils.sol"; contract AccountApiTest { function authenticate_message(CommonTypes.FilActorId target, AccountTypes.AuthenticateMessageParams memory params) public { AccountAPI.authenticateMessage(target, params); } function universal_receiver_hook(CommonTypes.FilActorId target, CommonTypes.UniversalReceiverParams memory params) public { Utils.universalReceiverHook(target, params); } } Copy pragma solidity ^0.8.17; import "../types/DataCapTypes.sol"; import "../types/CommonTypes.sol"; import "../cbor/BigIntCbor.sol"; import "../DataCapAPI.sol"; import "../Utils.sol"; contract DataCapApiTest { function name() public returns (string memory) { return DataCapAPI.name(); } function symbol() public returns (string memory) { return DataCapAPI.symbol(); } function total_supply() public returns (CommonTypes.BigInt memory) { return DataCapAPI.totalSupply(); } function balance(CommonTypes.FilAddress memory addr) public returns (CommonTypes.BigInt memory) { return DataCapAPI.balance(addr); } function allowance(DataCapTypes.GetAllowanceParams memory params) public returns (CommonTypes.BigInt memory) { return DataCapAPI.allowance(params); } function transfer(DataCapTypes.TransferParams memory params) public returns (DataCapTypes.TransferReturn memory) { return DataCapAPI.transfer(params); } function transfer_from(DataCapTypes.TransferFromParams memory params) public returns (DataCapTypes.TransferFromReturn memory) { return DataCapAPI.transferFrom(params); } function increase_allowance(DataCapTypes.IncreaseAllowanceParams memory params) public returns (CommonTypes.BigInt memory) { return DataCapAPI.increaseAllowance(params); } function decrease_allowance(DataCapTypes.DecreaseAllowanceParams memory params) public returns (CommonTypes.BigInt memory) { return DataCapAPI.decreaseAllowance(params); } function revoke_allowance(CommonTypes.FilAddress memory operator) public returns (CommonTypes.BigInt memory) { return DataCapAPI.revokeAllowance(operator); } function burn(CommonTypes.BigInt memory amount) public returns (CommonTypes.BigInt memory) { return DataCapAPI.burn(amount); } function burn_from(DataCapTypes.BurnFromParams memory params) public returns (DataCapTypes.BurnFromReturn memory) { return DataCapAPI.burnFrom(params); } function handle_filecoin_method(uint64 method, uint64 codec, bytes calldata params) public pure { Utils.handleFilecoinMethod(method, codec, params); } } Copy pragma solidity ^0.8.17; import "../MarketAPI.sol"; import "../types/MarketTypes.sol"; contract MarketApiTest { function add_balance(CommonTypes.FilAddress memory providerOrClient, uint256 value) public payable { MarketAPI.addBalance(providerOrClient, value); } function withdraw_balance(MarketTypes.WithdrawBalanceParams memory params) public returns (CommonTypes.BigInt memory) { return MarketAPI.withdrawBalance(params); } function get_balance(CommonTypes.FilAddress memory addr) public returns (MarketTypes.GetBalanceReturn memory) { return MarketAPI.getBalance(addr); } function get_deal_data_commitment(uint64 dealID) public returns (MarketTypes.GetDealDataCommitmentReturn memory) { return MarketAPI.getDealDataCommitment(dealID); } function get_deal_client(uint64 dealID) public returns (uint64) { return MarketAPI.getDealClient(dealID); } function get_deal_provider(uint64 dealID) public returns (uint64) { return MarketAPI.getDealProvider(dealID); } function get_deal_label(uint64 dealID) public returns (string memory) { return MarketAPI.getDealLabel(dealID); } function get_deal_term(uint64 dealID) public returns (MarketTypes.GetDealTermReturn memory) { return MarketAPI.getDealTerm(dealID); } function get_deal_total_price(uint64 dealID) public returns (CommonTypes.BigInt memory) { return MarketAPI.getDealTotalPrice(dealID); } function get_deal_client_collateral(uint64 dealID) public returns (CommonTypes.BigInt memory) { return MarketAPI.getDealClientCollateral(dealID); } function get_deal_provider_collateral(uint64 dealID) public returns (CommonTypes.BigInt memory) { return MarketAPI.getDealProviderCollateral(dealID); } function get_deal_verified(uint64 dealID) public returns (bool) { return MarketAPI.getDealVerified(dealID); } function get_deal_activation(uint64 dealID) public returns (MarketTypes.GetDealActivationReturn memory) { return MarketAPI.getDealActivation(dealID); } function publish_storage_deals(MarketTypes.PublishStorageDealsParams memory params) public returns (MarketTypes.PublishStorageDealsReturn memory) { return MarketAPI.publishStorageDeals(params); } } Copy pragma solidity ^0.8.17; import "../MinerAPI.sol"; import "../types/MinerTypes.sol"; contract MinerApiTest { function get_owner(CommonTypes.FilActorId target) public returns (MinerTypes.GetOwnerReturn memory) { return MinerAPI.getOwner(target); } function change_owner_address(CommonTypes.FilActorId target, CommonTypes.FilAddress memory addr) public { MinerAPI.changeOwnerAddress(target, addr); } function is_controlling_address(CommonTypes.FilActorId target, CommonTypes.FilAddress memory addr) public returns (bool) { return MinerAPI.isControllingAddress(target, addr); } function get_sector_size(CommonTypes.FilActorId target) public returns (uint64) { return MinerAPI.getSectorSize(target); } function get_available_balance(CommonTypes.FilActorId target) public returns (CommonTypes.BigInt memory) { return MinerAPI.getAvailableBalance(target); } function get_vesting_funds(CommonTypes.FilActorId target) public returns (MinerTypes.GetVestingFundsReturn memory) { return MinerAPI.getVestingFunds(target); } function change_beneficiary(CommonTypes.FilActorId target, MinerTypes.ChangeBeneficiaryParams memory params) public { return MinerAPI.changeBeneficiary(target, params); } function get_beneficiary(CommonTypes.FilActorId target) public returns (MinerTypes.GetBeneficiaryReturn memory) { return MinerAPI.getBeneficiary(target); } function change_worker_address(CommonTypes.FilActorId target, MinerTypes.ChangeWorkerAddressParams memory params) public { MinerAPI.changeWorkerAddress(target, params); } function change_peer_id(CommonTypes.FilActorId target, CommonTypes.FilAddress memory newId) public { MinerAPI.changePeerId(target, newId); } function change_multiaddresses(CommonTypes.FilActorId target, MinerTypes.ChangeMultiaddrsParams memory params) public { MinerAPI.changeMultiaddresses(target, params); } function repay_debt(CommonTypes.FilActorId target) public { MinerAPI.repayDebt(target); } function confirm_change_worker_address(CommonTypes.FilActorId target) public { MinerAPI.confirmChangeWorkerAddress(target); } function get_peer_id(CommonTypes.FilActorId target) public returns (CommonTypes.FilAddress memory) { return MinerAPI.getPeerId(target); } function get_multiaddresses(CommonTypes.FilActorId target) public returns (MinerTypes.GetMultiaddrsReturn memory) { return MinerAPI.getMultiaddresses(target); } function withdraw_balance(CommonTypes.FilActorId target, CommonTypes.BigInt memory amount) public returns (CommonTypes.BigInt memory) { return MinerAPI.withdrawBalance(target, amount); } } Copy pragma solidity ^0.8.17; import "../types/PowerTypes.sol"; import "../types/CommonTypes.sol"; import "../PowerAPI.sol"; contract PowerApiTest { function create_miner(PowerTypes.CreateMinerParams memory params, uint256 value) public payable returns (PowerTypes.CreateMinerReturn memory) { return PowerAPI.createMiner(params, value); } function miner_count() public returns (uint64) { return PowerAPI.minerCount(); } function miner_consensus_count() public returns (int64) { return PowerAPI.minerConsensusCount(); } function network_raw_power() public returns (CommonTypes.BigInt memory) { return PowerAPI.networkRawPower(); } function miner_raw_power(uint64 minerID) public returns (PowerTypes.MinerRawPowerReturn memory) { return PowerAPI.minerRawPower(minerID); } } Copy pragma solidity ^0.8.17; import "../types/VerifRegTypes.sol"; import "../types/CommonTypes.sol"; import "../VerifRegAPI.sol"; contract VerifRegApiTest { function get_claims(VerifRegTypes.GetClaimsParams memory params) public returns (VerifRegTypes.GetClaimsReturn memory) { return VerifRegAPI.getClaims(params); } function add_verified_client(VerifRegTypes.AddVerifiedClientParams memory params) public { VerifRegAPI.addVerifiedClient(params); } function remove_expired_allocations( VerifRegTypes.RemoveExpiredAllocationsParams memory params ) public returns (VerifRegTypes.RemoveExpiredAllocationsReturn memory) { return VerifRegAPI.removeExpiredAllocations(params); } function extend_claim_terms(VerifRegTypes.ExtendClaimTermsParams memory params) public returns (CommonTypes.BatchReturn memory) { return VerifRegAPI.extendClaimTerms(params); } function remove_expired_claims(VerifRegTypes.RemoveExpiredClaimsParams memory params) public returns (VerifRegTypes.RemoveExpiredClaimsReturn memory) { return VerifRegAPI.removeExpiredClaims(params); } } sun-brightdesktopmoon --- # Cross-chain bridges | Filecoin Docs Cross-chain bridges have many use cases, such as enabling decentralized exchanges to support the trading of assets from multiple blockchain networks or allowing users to access decentralized applications (dApps) on different networks. They are also helpful for interoperability between separate blockchain networks, essential for the growth and adoption of blockchain technology. [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#available-bridges) Available bridges ------------------------------------------------------------------------------------------------------------------------- Regarding bridges, security is the top concern. The Filecoin team is focused on integrating with notary-based bridges that have a solid security model. Eventually, trustless light-client-based bridging solutions will be available. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#axelar) [Axelararrow-up-right](https://axelar.network/) Axelar enables both token bridge and general message passing and is well-connected to major EVM chains & Cosmos ecosystem. Initially, the bridge will support the following assets: wFIL, wETH, wBTC, USDC, and USDT. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#axelar-smart-contracts) **Axelar smart contracts** Currently, Axelar supports Filecoin Mainnet. Name Mainnet wFIL `0x60E1773636CF5E4A227d9AC24F20fEca034ee25A` axlUSDC `0xEB466342C4d449BC9f53A865D5Cb90586f405215` axlUSDT `0x7f5373AE26c3E8FfC4c77b7255DF7eC1A9aF52a6` axlWBTC `0x1a35EE4640b0A3B87705B0A4B45D227Ba60Ca2ad` axlWETH `0xb829b68f57CC546dA7E5806A929e53bE32a4625D` axlDAI `0x5C7e299CF531eb66f2A1dF637d37AbB78e6200C7` #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#further-axelar-resources) **Further Axelar resources** * [Axelar docs for developersarrow-up-right](https://docs.axelar.dev/dev/intro) * [Axelar with Squid Routerarrow-up-right](https://app.squidrouter.com/) * [Getting Started with Axelar on FVM Tutorialarrow-up-right](https://www.youtube.com/watch?v=L7cw5FhxW4s) ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#celer) [Celerarrow-up-right](https://cbridge.celer.network/1/314) Celer is a blockchain interoperability protocol enabling a one-click user experience accessing tokens, DeFi, GameFi, NFTs, governance, and privacy solutions across multiple chains. Celer has been successfully supporting Filecoin on both assets bridging using it’s CBridge and messaging passing through Celer Inter-chain Messaging (Celer IM). Initially, the bridge will support the following assets: wFIL, wETH, wBTC, USDC, and USDT. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#celer-smart-contracts) **Celer smart contracts** Celar’s CBridge supports both Filecoin Mainnet and Calibration testnet. Name Mainnet Calibration wFIL `0x60E1773636CF5E4A227d9AC24F20fEca034ee25A` ceUSDC `0x2421db204968A367CC2C866CD057fA754Cb84EdF` `0xf5C6825015280CdfD0b56903F9F8B5A2233476F5` ceUSDT `0x422849b355039bc58f2780cc4854919fc9cfaf94` `0x7d43AABC515C356145049227CeE54B608342c0ad` ceWBTC `0x592786e04c47844aa3b343b19ef2f50a255a477f` `0x265B25e22bcd7f10a5bD6E6410F10537Cc7567e8` ceWETH `0x522b61755b5ff8176b2931da7bf1a5f9414eb710` `0x5471ea8f739dd37E9B81Be9c5c77754D8AA953E4` MessageBus `0x6ff2130fbdd2837b0c92d7f56f6c017642d84f66` `0xd5818D039A702DdccfD11A900A40B3dc6DA03CEc` ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#further-celer-resources) **Further Celer resources** * [cBridge docsarrow-up-right](https://cbridge-docs.celer.network/) * [Celer IM Docsarrow-up-right](https://im-docs.celer.network/) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges) [PreviousFEVM Indexerschevron-left](https://docs.filecoin.io/smart-contracts/advanced/fevm-indexers) [NextAggregated deal-makingchevron-right](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making) Last updated 3 months ago * [Available bridges](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#available-bridges) * [Axelar](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#axelar) * [Celer](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#celer) * [Celer smart contracts](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#celer-smart-contracts) * [Further Celer resources](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges#further-celer-resources) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filecoin Pin dApp Demo | Filecoin Docs [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#what-youll-build) 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 [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#walkthrough-recording) Walkthrough Recording ---------------------------------------------------------------------------------------------------------------------------- [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#setup) Setup -------------------------------------------------------------------------------------------- We will start building by [forking the \*filecoin-pin-website demo repoarrow-up-right](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. ⏲️ ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-1-fork-clone-and-install-dependencies) Step 1: Fork, Clone, and Install Dependencies ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-2-set-up-your-filecoin-wallet) **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 [herearrow-up-right](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 MetaMaskarrow-up-right](https://docs.filecoin.io/basics/assets/metamask-setup#tab-calibration) ). 2. Visit the [Filecoin Calibration Faucetarrow-up-right](https://faucet.calibnet.chainsafe-fil.io/funds.html) to get free test FIL (to pay for transaction gas). 3. Visit the [Filecoin USDFC faucetarrow-up-right](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. ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-3-run-your-dapp) **Step 3: Run Your dApp** Fire up your local development server: 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! [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#store-ipfs-files-on-filecoin) Store IPFS Files on Filecoin ------------------------------------------------------------------------------------------------------------------------------------------ The magic happens in one key file [`**src/hooks/use-filecoin-upload.ts**`arrow-up-right](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. ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-1-upload-the-data) 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). ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-836ac54c045fa15ed110fcecd12a12cf547aa765%252Fpinapp-upload.gif%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=c414a8ee&sv=2) ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-2-announce-cids-and-confirm-the-transaction) 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. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-eb722fbf0569bcc6a6dcb1ba198b95ea22fdd75c%252Fpinapp-publish.gif%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=7fb2f6b0&sv=2) ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-3-download-the-data) 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. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-7b64447546afb77e168ad4a78966a820c5d7138b%252Fpinapp-download.gif%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=71730376&sv=2) ### [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-4-verify-your-data-storage) **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 Scanarrow-up-right](https://pdp.vxb.ai/calibration) . ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-be4db3cbd93419940724bb2051f55d03477d1a6d%252Fpinapp-viewproof.gif%3Falt%3Dmedia%26token%3Dbcc806be-2022-4d17-9b0e-387b28edb5fd&width=768&dpr=3&quality=100&sign=3e5b26bc&sv=2) That is it - you now have a dapp with a drag-and-drop interface to store IPFS Files on Filecoin! [hashtag](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#next-steps) Next Steps ------------------------------------------------------------------------------------------------------ 1. Check back on the [filecoin-pin-website repoarrow-up-right](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-pinarrow-up-right](https://github.com/filecoin-project/filecoin-docs/blob/main/builder-cookbook/README.md) . 4. Ask questions or get help with filecoin-pin in the [supported communcation channelsarrow-up-right](https://github.com/filecoin-project/filecoin-pin?tab=readme-ov-file#support-info) . [PreviousFilecoin Pin Github Actionchevron-left](https://docs.filecoin.io/builder-cookbook/filecoin-pin/github-action) [NextFilecoin Pin for ERC-8004 Agentschevron-right](https://docs.filecoin.io/builder-cookbook/filecoin-pin/erc-8004-agent-registration) Last updated 6 months ago * [What You'll Build](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#what-youll-build) * [Walkthrough Recording](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#walkthrough-recording) * [Setup](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#setup) * [Step 1: Fork, Clone, and Install Dependencies](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-1-fork-clone-and-install-dependencies) * [Step 2: Set Up Your Filecoin Wallet](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-2-set-up-your-filecoin-wallet) * [Step 3: Run Your dApp](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-3-run-your-dapp) * [Store IPFS Files on Filecoin](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#store-ipfs-files-on-filecoin) * [Step 1: Upload the data](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-1-upload-the-data) * [Step 2: Announce CIDs and confirm the transaction](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-2-announce-cids-and-confirm-the-transaction) * [Step 3: Download the data](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-3-download-the-data) * [Step 4: Verify your data storage](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#step-4-verify-your-data-storage) * [Next Steps](https://docs.filecoin.io/builder-cookbook/filecoin-pin/dapp-demo#next-steps) sun-brightdesktopmoon Copy # 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 Copy npm run dev sun-brightdesktopmoon --- # Remix | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#launch-an-erc-20-token) Launch an ERC-20 token --------------------------------------------------------------------------------------------------------------------------------- As a simple introduction, we’re going to use Remix to create an ERC-20 token on the Filecoin network. In this guide, we’re using the Calibration testnet, but this process is the same for mainnet. This guide assumes you’ve already connected your [MetaMask extension to a Filecoin network](https://docs.filecoin.io/basics/assets/metamask-setup) . ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#create-a-workspace) Create a workspace In Remix, workspaces are where you can create a contract, or group of contracts, for each project. Let’s create a new workspace to create our new ERC-20 token. 1. Open [remix.ethereum.orgarrow-up-right](https://remix.ethereum.org/) . 2. Click the `+` icon next to **Workspaces** to create a new workspace. 3. In the **Choose a template** dropdown, select **ERC20**. 4. Select the **Mintable** checkbox. 5. Enter a fun name for your token in the **Workspace name** field. Something like `CorgiCoin` works fine. 6. Click **OK** to create your new workspace. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#customize-the-contract) Customize the contract The contract template we’re using is pretty simple. We just need to modify a couple of variables. 1. Under the **contract** directory, click **MyToken.sol**. 2. In the editor panel, replace `MyToken` with whatever you’d like to name your token. In this example, we’ll use `CorgiCoin`. 3. On the same line, replace the second string with whatever you want the symbol of your token to be. In this example, we’ll use `CRG` That’s all we need to change within this contract. You can see on line 4 that this contract is importing another contract from `@openzeppelin` for us, meaning that we can keep our custom token contract simple. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#compile) Compile 1. Click the green play symbol at the top of the workspace to compile your contract. You can also press `CMD` + `s` on MacOS or `CTRL` + `s` on Linux and Windows. 2. Remix automatically fetches the two `import` contracts from the top of our `.sol` contract. You can see these imported contracts under the `.deps` directory. You can browse the contracts there, but Remix will not save any changes you make. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#deploy) Deploy Now that we’ve successfully compiled our contract, we need to deploy it somewhere! This is where our previous MetaMask setup comes into play. 1. Click the **Deploy** tab from the left. 2. Under the **Environment** dropdown, select **Injected Provider - MetaMask**. 3. MetaMask will open a new window confirming that you want to connect your account to Remix. 4. Click **Next**: 5. Click **Connect** to connect your `tFIL` account to Remix. 6. Back in Remix, under the **Account** field, you’ll see that it says something like `0x11F... (5 ether)`. This value is 5 `tFIL`, but Remix doesn’t support the Filecoin network, so it doesn’t understand what `tFIL` is. This isn’t a problem; it’s just a little quirk of using Remix. 7. Under the **Contract** dropdown, ensure the contract you created is selected. 8. Click **Deploy**. 9. MetaMask will open a window and as you to confirm the transaction. Scroll down and click **Confirm** to have MetaMask deploy the contract. If you’re deploying to mainnet, we advise you to [adjust your gas fees](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#adjusting-your-gas-fees) for a cheaper deployment. 10. Back in Remix, a message at the bottom of the screen shows that the creation of your token is pending. 11. Wait around 90 seconds for the deployment to complete. On the Filecoin network, a new set of blocks, also called a tipset, is created every thirty seconds. When deploying a contract, the transaction needs to be received by the network, and then the network needs to confirm the contract. This process takes around one to two tipsets to process – or around 60 to 90 seconds. [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#use-your-contract) Use your contract ----------------------------------------------------------------------------------------------------------------------- Now that we’ve compiled and deployed the contract, it’s time to actually interact with it! ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#mint-your-tokens) Mint your tokens Let’s call a method within the deployed contract to mint some tokens. 1. Back in Remix, open the **Deployed Contracts** dropdown, within the **Deploy** sidebar tab. 2. Expand the `mint` method. You must fill in two fields here: `to` and `amount`. 3. The `to` field specifies where address you want these initial tokens sent. Open MetaMask, copy your address, and paste it into this field. 4. This field expects an `attoFil` value. 1 `FIL` is equal to 1,000,000,000,000,000,000 `attoFil`. So if you wanted to mint 100 `FIL`, you would enter `100` followed by 18 zeros: `100000000000000000000`. 5. Click **Transact**. 6. MetaMask will open a window and ask you to confirm the transaction: Again, you must wait for the network to process the transaction, which should take about 90 seconds. You can move on to the next section while you’re waiting. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#add-to-metamask) Add to MetaMask Currently, MetaMask has no idea what our token is or what it even does. We can fix this by explicitly telling MetaMask the address of our contract. 1. Go back to Remix and open the **Deploy** sidebar tab. 2. Under **Deployed Contracts**, you should see your contract address at the top. Click the copy icon to copy the address to your clipboard. 3. Open MetaMask, select **Assets**, and click **Import your tokens.** 4. In the **Token contract address** field, paste the contract address you just copied from Remix and then click **Add custom token**. MetaMask should autofill the rest of the information based on what it can find from the Filecoin network. 5. Click **Import token**: 6. You should now be able to see that you have 100 of your tokens within your MetaMask wallet! And that’s it! Deploying an ERC-20 token on Filecoin is simple! ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#adjusting-your-gas-fees) Adjusting your gas fees Remix uses a default of 2.5 nanoFIL per gas as a priority fee, which is usually too high for the Filecoin network. If you don’t adjust this, you may end up overpaying when deploying to mainnet. We recommend that you switch from the site-suggested gas fees to oracle-supplied gas fees when deploying your contract. 1. When the deployment transaction confirmation pop-up window shows up, click on **Site suggested**. 2. Switch to **Market**, **Aggressive**, or **Low**. The **Market** option is generally suitable for most situations. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/remix) [PreviousGet test tokenschevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/get-test-tokens) [NextHardhatchevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat) Last updated 1 year ago * [Launch an ERC-20 token](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#launch-an-erc-20-token) * [Create a workspace](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#create-a-workspace) * [Customize the contract](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#customize-the-contract) * [Compile](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#compile) * [Deploy](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#deploy) * [Use your contract](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#use-your-contract) * [Mint your tokens](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#mint-your-tokens) * [Add to MetaMask](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#add-to-metamask) * [Adjusting your gas fees](https://docs.filecoin.io/smart-contracts/developing-contracts/remix#adjusting-your-gas-fees) sun-brightdesktopmoon sun-brightdesktopmoon --- # Aggregated deal-making | Filecoin Docs Filecoin is designed to store large data for extended periods. Small-scale data (<4 GiB) can be combined with other small deals into larger ones, either on-chain or off-chain. Smart contracts can handle programmatic data storing. This article explains the process, referring to small-scale data as _sub-piece data_. For context, a [_piece_arrow-up-right](https://spec.filecoin.io/systems/filecoin_files/piece/) of data in Filecoin refers to a unit of negotiation for data to be stored on Filecoin. A sub-piece refers to a sub-unit of that larger piece. These are typically small data like NFT images, short videos and more. Aggregation is the process of combining multiple packages of _sub-piece data_ into a single package. This large package is stored on the Filecoin network instead of multiple smaller packages. Aggregation can be done off-chain or on-chain. [hashtag](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#process) Process -------------------------------------------------------------------------------------------------------- The base interface for aggregation requires the following components: 1. A client who has data to upload. 2. An aggregator platform that clients can interact with to request to make a storage deal and retrieve Proof of Deal Sub-piece Inclusion (PoDSI) from. 3. An aggregation node to aggregate the sub-piece data into a larger file and to provide PoDSI that can be called via an API endpoint. Aggregation of data always happens off-chain. This is typically hosted by the aggregator platform 4. An optional aggregation smart contract that clients can submit an on-chain request to, to request an off-chain aggregation node to make a storage deal ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Ffilecoin-project%2Ffilecoin-docs%2Fassets%2F113331491%2F29d6cc11-680e-4aa1-9c3c-422cb12795c7&width=768&dpr=3&quality=100&sign=f99495a6&sv=2) Aggregation [hashtag](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#proof-of-deal-sub-piece-inclusion-podsi) Proof of Deal Sub-piece Inclusion (PoDSI) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Proof of Deal Sub-piece Inclusion (PoDSI) is motivated by a need for sub-piece data uploads to eventually issue verification and proof that the data was included in an associated deal on Filecoin. PoDSI is heavily used in the aggregated deal-making workflow. PoDSI is a proof construction and is generated for each sub-piece CID (within the large data segment) and stored in an off-chain database. The proof consists of two elements: 1. An inclusion proof of a sub-tree, which contains the size and position of the sub-piece data in the larger aggregated data piece, corresponding to the tree of the aggregator's committed larger aggregated data piece. 2. An inclusion proof of the double leaf data segment descriptor, which describes the sub-piece data within the larger [data segment indexarrow-up-right](https://github.com/filecoin-project/go-data-segment) , which is contained at the end of a deal, describing all the data segments contained within that deal. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#requesting-for-aggregation-off-chain) Requesting for aggregation off-chain To request for aggregation and PoDSI off-chain, developers interact with an aggregator platform: 1. The client submits sub-piece data to an aggregator platform. The aggregator prepares the data and generates the sub-piece CID, known as pCID, and URL to download the CAR file. 2. The aggregator hosts an off-chain aggregation node, which aggregates the sub-piece CAR files into a larger aggregated CAR file. 3. Simultaneously, the aggregator aggregates indexed data segments (based on specs [herearrow-up-right](https://github.com/filecoin-project/FIPs/discussions/512) ). It runs the proofing library and generates PoDSI proofs for each sub-piece pCID, storing them in an off-chain database. 4. The aggregator uses [programmatic deal-making](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making) or [manual deal-makingarrow-up-right](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. 5. Storage Providers download the aggregated CAR file and publish storage deals. 6. Clients can query a proofing endpoint provided by the aggregator, which will look up the sub-piece CID (pCID) in the database and return the PoDSI proof, aggregated CID, and associated deal ID. 7. Clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. [Lighthouse.storagearrow-up-right](https://lighthouse.storage/) is the first aggregator platform available. You can find their [docs on how to utilize their SDK for the above processarrow-up-right](https://docs.lighthouse.storage/) . ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Ffilecoin-project%2Ffilecoin-docs%2Fassets%2F113331491%2F47691259-5665-43c7-bea6-79ed2b453f86&width=768&dpr=3&quality=100&sign=85be4985&sv=2) Aggregation off-chain ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#requesting-for-aggregation-on-chain) Requesting for aggregation on-chain On-chain aggregation and PoDSI requests go through aggregator oracle smart contracts: 1. The client [prepares the data](https://docs.filecoin.io/storage-providers/filecoin-deals/storage-deals#data-preparation) and generates the sub-piece CID, known as pCID (CommPc). Here is an easy [data preparation toolarrow-up-right](https://data.lighthouse.storage/) by [lighthouse.storagearrow-up-right](https://lighthouse.storage/) . 2. The client submits a sub-piece CID (CommPc) with metadata (e.g. URL to download the sub-piece CAR file) directly to the aggregation smart contract. 3. The aggregator watches the aggregation contract, and when the aggregator decides there are enough sub-pieces, it downloads all sub-piece data, to generate the aggregated piece from the CAR file URL. 4. The aggregator aggregates indexed data segments into a larger data file for deal-making (based on specs [herearrow-up-right](https://github.com/filecoin-project/FIPs/discussions/512) ). 5. The aggregator combines the sub-piece data into the aggregated CommP (CommPa) by computing within aggregator's off-chain node. 6. The aggregator uses [programmatic deal-making](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making) or [manual deal-makingarrow-up-right](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. 7. Storage Providers download the aggregated CAR file and publish storage deals. Upon the client's request, they can find the data via sub-piece CID. 8. Clients can query the aggregation smart contract, which notifies the aggregator platform to look up the sub-piece CID (pCID) in its aggregation node's database and return the PoDSI proof, aggregated CID, and associated deal ID. 9. Simultaneously, clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Ffilecoin-project%2Ffilecoin-docs%2Fassets%2F113331491%2F3588073e-a98e-4245-8a85-a087f4e403d2&width=768&dpr=3&quality=100&sign=83be6d9d&sv=2) Aggregation on-chain To build your own on-chain aggregator oracle smart contract, check out one of the implementations with [Filecoin Data Toolsarrow-up-right](https://github.com/application-research/fevm-data-segment) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making) [PreviousCross-chain bridgeschevron-left](https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges) [NextContract automationchevron-right](https://docs.filecoin.io/smart-contracts/advanced/contract-automation) Last updated 1 year ago * [Process](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#process) * [Proof of Deal Sub-piece Inclusion (PoDSI)](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#proof-of-deal-sub-piece-inclusion-podsi) * [Requesting for aggregation off-chain](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#requesting-for-aggregation-off-chain) * [Requesting for aggregation on-chain](https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making#requesting-for-aggregation-on-chain) sun-brightdesktopmoon sun-brightdesktopmoon --- # Spin up a lite-node | Filecoin Docs In this guide, we will use the [Lotus](https://docs.filecoin.io/nodes/implementations/lotus) Filecoin implementation to install a lite-node on MacOS and Ubuntu. For other Linux distributions, check out the [Lotus documentationarrow-up-right](https://lotus.filecoin.io/lotus/install/linux/#building-from-source) . To run a lite-node on Windows, install [WSL with Ubuntuarrow-up-right](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview) on your system and follow the _Ubuntu_ instructions below. [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#prerequisites) Prerequisites --------------------------------------------------------------------------------------------------------- Lite-nodes have relatively lightweight hardware requirements. Your machine should meet the following hardware requirements: 1. At least 2 GiB of RAM 2. A dual-core CPU. 3. At least 4 GiB of storage space. To build the lite-node, you’ll need some specific software. Run the following command to install the software prerequisites: MacOS Ubuntu 1. Ensure you have [XCodearrow-up-right](https://developer.apple.com/xcode/) and [Homebrewarrow-up-right](https://brew.sh/) installed. 2. Install the following dependencies: Copy brew install go jq pkg-config hwloc coreutils rust 1. Install the following dependencies: Copy sudo apt update -y sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y 2. [Install Goarrow-up-right](https://go.dev/doc/install) and add `/usr/local/go/bin` to your `$PATH` variable: Copy wget https://go.dev/dl/go1.21.7.linux-amd64.tar.gz sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.7.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && source ~/.bashrc 3. [Install Rustarrow-up-right](https://www.rust-lang.org/tools/install) , choose the standard installation option, and source the `~/.cargo/env` config file: Copy curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source "$HOME/.cargo/env" [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#pre-build) Pre-build ------------------------------------------------------------------------------------------------- Before we can build the Lotus binaries, we need to follow a few pre-build steps. MacOS users should select their CPU architecture from the tabs: MacOS Intel MacOS ARM Ubuntu 1. Clone the repository and move into the `lotus` directory: Copy git clone https://github.com/filecoin-project/lotus.git cd lotus/ 2. Retrieve the latest Lotus release version: Copy git tag -l 'v*' | grep -v '-' | sort -V -r | head -n 1 This should output something like: Copy v1.34.1 3. Using the value returned from the previous command, checkout to the latest release branch: Copy git checkout v1.34.1 4. Done! You can move on to the [Buildarrow-up-right](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section. 1. Clone the repository and move into the `lotus` directory: Copy git clone https://github.com/filecoin-project/lotus.git cd lotus 2. Retrieve the latest Lotus release version: Copy git tag -l 'v*' | grep -v '-' | sort -V -r | head -n 1 This should output something like: Copy v1.34.1 3. Using the value returned from the previous command, checkout to the latest release branch: Copy git checkout v1.34.1 4. Create the necessary environment variables to allow Lotus to run on M1 architecture: Copy export LIBRARY_PATH=/opt/homebrew/lib export FFI_BUILD_FROM_SOURCE=1 export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH" 5. Done! You can move on to the [Buildarrow-up-right](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section. 1. Clone the repository and move into the `lotus` directory: 2. Retrieve the latest Lotus release version: This should output something like: 3. Using the value returned from the previous command, checkout to the latest release branch: 4. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable SHA extensions by adding these two environment variables. If in doubt, ignore this command and move on to [the next sectionarrow-up-right](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) . 5. Done! You can move on to the Build section. [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#build-the-binary) Build the binary --------------------------------------------------------------------------------------------------------------- The last thing we need to do to get our node setup is to build the package. The command you need to run depends on which network you want to connect to: Mainnet Calibration 1. Remove or delete any existing Lotus configuration files on your system: 2. Make the Lotus binaries and install them: 3. Once the installation finishes, query the Lotus version to ensure everything is installed successfully and for the correct network: This will output something like: 1. Remove or delete any existing Lotus configuration files on your system: 2. Make the Lotus binaries and install them: 3. Once the installation finishes, query the Lotus version to ensure everything is installed successfully and for the correct network: This will output something like: [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#start-the-node) Start the node ----------------------------------------------------------------------------------------------------------- Let's start the lite-node by connecting to a remote full-node. We can use the public full-nodes from [glif.ioarrow-up-right](https://www.glif.io/en) : Mainnet Calibration 1. Create an environment variable called `FULLNODE_API_INFO` and set it to the WebSockets address of the node you want to connect to. At the same time, start the Lotus daemon with the `--lite` tag: This will output something like: 2. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. 1. Create an environment variable called `FULLNODE_API_INFO` and set it to the WebSockets address of the node you want to connect to. At the same time, start the Lotus daemon with the `--lite` tag: This will output something like: 2. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#expose-the-api) Expose the API ----------------------------------------------------------------------------------------------------------- To send JSON-RPC requests to our lite-node, we need to expose the API. Mainnet Calibration 1. Open `~/.lotus/config.toml` and uncomment `ListenAddress` on line 6: 2. Open the terminal window where your lite-node is running and press `CTRL` + `c` to close the daemon. 3. In the same window, restart the lite-node: This will output something like: 4. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. 1. Open `~/.lotus/config.toml` and uncomment `ListenAddress` on line 6: 2. Open the terminal window where your lite-node is running and press `CTRL` + `c` to close the daemon. 3. In the same window, restart the lite-node: This will output something like: 4. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. The lite-node is now set up to accept local JSON-RPC requests! However, we don't have an authorization key, so we won't have access to privileged JSON-RPC methods. [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#create-a-key) Create a key ------------------------------------------------------------------------------------------------------- To access privileged JSON-RPC methods, like creating a new wallet, we need to supply an authentication key with our Curl requests. 1. Create a new admin token and set the result to a new `LOTUS_ADMIN_KEY` environment variable: This will output something like: 2. Keep this key handy. We're going to use it in the next section. [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#send-requests) Send requests --------------------------------------------------------------------------------------------------------- Let's run a couple of commands to see if the JSON-RPC API is set up correctly. 1. First, let's grab the head of the Filecoin network chain: This will output something like: 2. Next, let's try to create a new wallet. Since this is a privileged method, we need to supply our auth key `eyJhbGc...`: This will output something like: The result field is the public key for our address. The private key is stored within our lite-node. 3. Set the new address as the default wallet for our lite-node. Remember to replace the Bearer token with our auth key `eyJhbGc...` and the `"params"` value with the wallet address, `f1vuc4...`, returned from the previous command: This will output something like: [hashtag](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#next-steps) Next steps --------------------------------------------------------------------------------------------------- You should now have a local lite-node connected to a remote full-node with an admin API key! You can use this setup to continue playing around with the JSON-RPC, or start building your applications on Filecoin! [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) [PreviousLite-nodeschevron-left](https://docs.filecoin.io/nodes/lite-nodes) [NextFundamentalschevron-right](https://docs.filecoin.io/smart-contracts/fundamentals) Last updated 5 months ago * [Prerequisites](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#prerequisites) * [Pre-build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#pre-build) * [Build the binary](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#build-the-binary) * [Start the node](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#start-the-node) * [Expose the API](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#expose-the-api) * [Create a key](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#create-a-key) * [Send requests](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#send-requests) * [Next steps](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node#next-steps) sun-brightdesktopmoon Copy git clone https://github.com/filecoin-project/lotus.git cd lotus Copy git tag -l 'v*' | grep -v '-' | sort -V -r | head -n 1 Copy v1.34.1 Copy git checkout v1.34.1 Copy export RUSTFLAGS="-C target-cpu=native -g" export FFI_BUILD_FROM_SOURCE=1 Copy mv ~/.lotus ~/.lotus-backup Copy make clean all sudo make install Copy lotus --version Copy lotus version 1.34.1+mainnet+git.1ff3b360b Copy mv ~/.lotus ~/.lotus-backup Copy make clean && make calibrationnet sudo make install Copy lotus --version Copy lotus version 1.34.1+calibnet+git.1ff3b360b Copy FULLNODE_API_INFO=wss://wss.node.glif.io/apigw/lotus lotus daemon --lite Copy 2023-01-26T11:18:54.251-0400 INFO main lotus/daemon.go:219 lotus repo: /Users/johnny/.lotus 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited. ... Copy FULLNODE_API_INFO=wss://wss.calibration.node.glif.io/apigw/lotus lotus daemon --lite Copy 2023-01-26T11:18:54.251-0400 INFO main lotus/daemon.go:219 lotus repo: /Users/johnny/.lotus 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited. ... Copy [API] # Binding address for the Lotus API # # type: string # env var: LOTUS_API_LISTENADDRESS ListenAddress = "/ip4/127.0.0.1/tcp/1234/http" # type: string # env var: LOTUS_API_REMOTELISTENADDRESS # RemoteListenAddress = "" ... Copy FULLNODE_API_INFO=wss://wss.node.glif.io/apigw/lotus lotus daemon --lite Copy 2023-01-26T11:18:54.251-0400 INFO main lotus/daemon.go:219 lotus repo: /Users/johnny/.lotus 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited ... Copy [API] # Binding address for the Lotus API # # type: string # env var: LOTUS_API_LISTENADDRESS ListenAddress = "/ip4/127.0.0.1/tcp/1234/http" # type: string # env var: LOTUS_API_REMOTELISTENADDRESS # RemoteListenAddress = "" ... Copy FULLNODE_API_INFO=wss://wss.calibration.node.glif.io/apigw/lotus lotus daemon --lite Copy 2023-01-26T11:18:54.251-0400 INFO main lotus/daemon.go:219 lotus repo: /Users/johnny/.lotus 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited. ... Copy lotus auth create-token --perm "admin" Copy eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.um-LqY7g-SDOsMheDRbQ9JIaFzus_Pan0J88VQ6ZLVE Copy curl -X POST '127.0.0.1:1234/rpc/v0' \ -H 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.ChainHead","params":[]}' \ | jq Copy { "jsonrpc": "2.0", "result": { "Cids": [\ {\ "/": "bafy2bzacead2v2y6yob7rkm4y4snthibuamzy5a5iuzlwvy7rynemtkdywfuo"\ },\ {\ "/": "bafy2bzaced4zahevivrcdoefqlh2j45sevfh5g3zsw6whpqxqjig6dxxf3ip6"\ },\ ...\ \ Copy\ \ curl -X POST '127.0.0.1:1234/rpc/v0' \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.um-LqY7g-SDOsMheDRbQ9JIaFzus_Pan0J88VQ6ZLVE' \\ --data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.WalletNew","params":["secp256k1"]}' \\ | jq\ \ Copy\ \ {\ "id": 1,\ "jsonrpc": "2.0",\ "result": "f1vuc4eu2wgsdnce2ngygyzuxky3aqijqe7gj5qqa"\ }\ \ Copy\ \ curl -X POST '127.0.0.1:1234/rpc/v0' \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.um-LqY7g-SDOsMheDRbQ9JIaFzus_Pan0J88VQ6ZLVE' \\ --data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.WalletSetDefault","params":["f1vuc4eu2wgsdnce2ngygyzuxky3aqijqe7gj5qqa"]}' \\ | jq \ \ Copy\ \ {\ "id": 1,\ "jsonrpc": "2.0",\ "result": null\ }\ \ sun-brightdesktopmoon --- # Hardhat | Filecoin Docs While originally created for the Ethereum blockchain, the Filecoin Ethereum Virtual Machine runtime (FEVM) allows Hardhat to be used to develop and deploy smart contracts on the Filecoin network. [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#quickstart) Quickstart ----------------------------------------------------------------------------------------------------------- The [FEVM Hardhat kitarrow-up-right](https://github.com/filecoin-project/FEVM-Hardhat-Kit) is a starter hardhat project for developing, deploying, and testing Solidity smart contracts on the Filecoin network. It functions in the same way as other Hardhat development kits. Check out the quickstart below to test it out! ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#prerequisites) Prerequisites This guide assumes you have the following installed: * [Yarnarrow-up-right](https://yarnpkg.com/) * A Filecoin address stored in [MetaMask](https://docs.filecoin.io/basics/assets/metamask-setup) ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#environment-setup) Environment setup First, we need to grab the starter kit and install the dependencies. 1. Clone the Hardhat starter kit and move into the new `fevm-hardhat-kit` directory: Copy git clone https://github.com/filecoin-project/fevm-hardhat-kit.git cd fevm-hardhat-kit # Cloning into 'fevm-hardhat-kit'... # remote: Enumerating objects: 758, done. # remote: Counting objects: 100% (725/725), done. # # ... 1. Use Yarn to install the project’s dependencies: 1. Add your private key to the `.env` file: circle-info Always be careful when dealing with your private key. Double-check that you’re not hardcoding it anywhere or committing it to Git. Remember: anyone with access to your private key has complete control over your funds. 1. Get the addresses associated with the private key from Hardhat: Now that we’ve got the kit set up, we can start using it to develop and deploy our contracts. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#manage-the-contracts) Manage the contracts There are two main types of contracts: * Basic Solidity examples: Simple contracts to show off basic Solidity. * Filecoin API Examples: Contracts that demo how to use the Filecoin APIs in Solidity to access storage deals and other Filecoin-specific functions. Make sure that your account has funds. You won’t be able to deploy any contracts without `FIL` or `tFIL`. 1. Run `hardhat deploy` to deploy all the contracts. This can take a few minutes: 1. Interact with the contracts using the available functions within the `tasks` folder. For example, you can get the balance of the `simple-coin` contract by calling the `get-balance` function: [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#hardhat-docs) Hardhat docs --------------------------------------------------------------------------------------------------------------- You can view the official Hardhat documentation over at [`hardhart.org/docs`arrow-up-right](https://hardhat.org/docs) . [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat) [PreviousRemixchevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/remix) [NextFoundrychevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry) Last updated 1 year ago * [Quickstart](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#quickstart) * [Prerequisites](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#prerequisites) * [Environment setup](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#environment-setup) * [Manage the contracts](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#manage-the-contracts) * [Hardhat docs](https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat#hardhat-docs) sun-brightdesktopmoon Copy yarn install # [1/4] 🔍 Resolving packages... # [2/4] 🚚 Fetching packages... # [3/4] 🔗 Linking dependencies... # # ... # # ✨ Done in 16.34s. Copy PRIVATE_KEY= Copy yarn hardhat get-address # Ethereum address (this address should work for most tools): 0x11Fc070e5c0D32024c9B63c136913405e07C8c48 # f4address (also known as t4 address on testnets): f410fch6aods4buzaete3mpatnejuaxqhzdci3j67vyi # ✨ Done in 1.40s. Copy yarn hardhat deploy # Compiled 18 Solidity files successfully # Wallet Ethereum Address: 0x11Fc070e5c0D32024c9B63c136913405e07C8c48 # Deploying Simplecoin... # # ... # # ✨ Done in 211.76s. Copy yarn hardhat get-balance --contract '0xA855520fcCB6422976F7Ac78534edec2379Be5f6' --account '0x11Fc070e5c0D32024c9B63c136913405e07C8c48' # Reading SimpleCoin owned by 0x11Fc070e5c0D32024c9B63c136913405e07C8c48 on network calibration # Amount of Simplecoin owned by 0x11Fc070e5c0D32024c9B63c136913405e07C8c48 is 12000 # Total amount of minted tokens is 12000 # ✨ Done in 3.73s. sun-brightdesktopmoon --- # Oracles | Filecoin Docs In the Filecoin network, on-chain data and the state of smart contracts are isolated from external data sources. They cannot access real-world information without breaking the deterministic attributes of the network. Since smart contracts cannot access information outside the Filecoin network, oracles are used as trusted entities to provide external data to the network. Oracles are an essential component of many blockchain applications, as they enable the blockchain to interact with the real world and provide more functionality to blockchain-based systems. Oracles can retrieve data from external sources, verify the data, and submit it to the blockchain for use by smart contracts and decentralized applications (dapps). Oracles enable builders to integrate the following features into their projects: * **Price feeds**: DeFi protocols like cross-chain lending rely on oracles for various token or token pair prices. * **Cross-chain storage deal verification**: enable applications running on any blockchains to use the Filecoin decentralized storage and allow them to verify deal status and proofs. * **Perpetual storage**: enable automated deal renewal and repair with the oracle providing deal status off-chain. [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#available-oracles) Available oracles ------------------------------------------------------------------------------------------------------------- There are several oracle-protocols built upon the FVM. Builders can integrate these oracles into their applications today. ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#pyth) [Pytharrow-up-right](https://pyth.network/) Pyth data is sourced directly from financial institutions across both traditional finance and the cryptocurrency industry. Pyth publishes both the price feed and a confidence interval for each product. Learn more about [Pyth confidence intervalsarrow-up-right](https://docs.pyth.network/price-feeds/best-practices#confidence-intervals) . **Pyth smart contracts** Pyth’s smart contracts are live on the Filecoin Mainnet and Calibration testnet. Name Address Mainnet Calibration [Pyth - Mainnetarrow-up-right](https://filecoin.blockscout.com/address/0xA2aa501b19aff244D90cc15a4Cf739D2725B5729?tab=contract) `0xA2aa501b19aff244D90cc15a4Cf739D2725B5729` ✔️ [Pyth - Calibrationarrow-up-right](https://calibration.filfox.info/en/address/0xA2aa501b19aff244D90cc15a4Cf739D2725B5729) `0xA2aa501b19aff244D90cc15a4Cf739D2725B5729` ✔️ **Pyth x Filecoin Price Feed IDs** Price Feed IDs for FIL are also available on various chains. These can be found at [Pyth - Price Feed IDsarrow-up-right](https://pyth.network/developers/price-feed-ids) and search for 'FIL'. #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#further-pyth-resources) **Further Pyth resources** * [Pyth docsarrow-up-right](https://docs.pyth.network/) * [Pyth - Best Practicesarrow-up-right](https://docs.pyth.network/price-feeds/best-practices) * [Pyth Benchmarks - historical price feedsarrow-up-right](https://docs.pyth.network/metrics/) ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#tellor) [Tellorarrow-up-right](https://tellor.io/) Tellor is an _optimistic_ oracle. Builders should not accept instant price quotes and should wait a few minutes before locking in details. Tellor supports a price feed oracle and a data oracle for the Filecoin network. The data oracle can provide Filecoin-specific data, such as the reputation of storage providers, which helps lending protocols determine interest rates for SPs. **Tellor smart contracts** Tellor’s smart contracts are live on the Filecoin Mainnet and Calibration testnet. Name Address Mainnet Calibration Bridged TRB `0x045CE60839d108B43dF9e703d4b25402a6a28a0d` ✔️ Playground/TRB `0x15e6Cc0D69A162151Cadfba035aa10b82b12b970` ✔️ Oracle `0xb2CB696fE5244fB9004877e58dcB680cB86Ba444` ✔️ ✔️ Governance `0xb55bB55f7D8b4F26Bd18198088C96488D95cab39` ✔️ ✔️ Autopay `0x60cBf3991F05a0671250e673Aa166e9D1A0C662E` ✔️ ✔️ TellorFlex `0xb2CB696fE5244fB9004877e58dcB680cB86Ba444` ✔️ ✔️ QueryDataStorage `0xf44166ca8bdB612268a4D401e4c5147968E5a190` ✔️ ✔️ Multisig `0x34Fae97547E990ef0E05e05286c51E4645bf1A85` ✔️ ✔️ #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#further-tellor-resources) **Further Tellor resources** * [Tellor docsarrow-up-right](https://docs.tellor.io/) * [Filecoin Storage Insurance Contractarrow-up-right](https://github.com/tellor-io/filecoin-query-insurance-impl/tree/main) * [Getting Tellor Data for any use casearrow-up-right](https://www.youtube.com/watch?v=AQIDqTLguyI) - FVM Dataverse Hackathon ### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#eoracle) [eOraclearrow-up-right](https://www.eoracle.io/) eOracle extends Ethereum's trust to connect decentralized applications with off-chain data as the largest restaking protocol backed by over $5B of stake ETH through 120,000 stakers and over 110 validators distributed around the globe. eOracle provides reliable and secure on-chain price feeds, as well as custom data feeds. **eOracle Smart Contracts** eOracle's smart contracts are live on the Filecoin Calibration testnet. Name Address Mainnet Calibration EOFeedManager `0x4BCafd5f3fB32221BaEAF6B986d1449772885D1E` ✔️ EOFeedAdapter - AUD/USD `0x6243357B9241Fe9C3BAfbA79DeD3300a855113FA` ✔️ EOFeedAdapter - BTC/USD `0x705256d9B37950628F97A1a8De7Ab557345a0A80` ✔️ EOFeedAdapter - ETH/USD `0x2bada837140A310f4A1d9D0e7fab114da6b87031` ✔️ EOFeedAdapter - EUR/USD `0x7C01e105B9c3772Bc72ef55F450b9B96f81EDE82` ✔️ EOFeedAdapter - FIL/USD `0x335C47CF754cf7f5d6DF78EF9fAb065aa5988D89` ✔️ EOFeedAdapter - GBP/USD `0x2Af9bb239936aC3e5a35CC804CD09a8CF3B589e7` ✔️ EOFeedAdapter - LINK/USD `0x7E8326Fd75aCa5A7dF43E999A1119c392EDFC93a` ✔️ EOFeedAdapter - SOL/USD `0x7E3e2953d69890f6B7E5831144986113E9199593` ✔️ EOFeedAdapter - USDT/USD `0x30f43F80279b7BB1b9206896DB90Aabf69494c16` ✔️ EOFeedAdapter - XAU/USD `0x8609B3087D473cD2B6bc7674dD54FF13c909027f` ✔️ EOFeedAdapter - sFRAX/FRAX `0xd56f6CC400f3bFC77faeC4bBb1e0400c6A26A925` ✔️ EOFeedAdapter - sfrxETH/frxETH `0x626A1Cb309289Eb542710D6093C6341562769983` ✔️ EOFeedAdapter - stETH/ETH `0x0834Bb4baf2758a3642636C89D18F97ED6672D1C` ✔️ #### [hashtag](https://docs.filecoin.io/smart-contracts/advanced/oracles#further-eoracle-resources) **Further eOracle resources** * [eOracle docsarrow-up-right](https://eoracle.gitbook.io/eoracle) * [eOracle GitHubarrow-up-right](https://github.com/eoracle) * [eOracle Price Feed Integration Guidearrow-up-right](https://eoracle.gitbook.io/eoracle/price-feeds/integration-guide) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/oracles) [PreviousWrapped FILchevron-left](https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil) [NextMulticallchevron-right](https://docs.filecoin.io/smart-contracts/advanced/multicall) Last updated 3 months ago * [Available oracles](https://docs.filecoin.io/smart-contracts/advanced/oracles#available-oracles) * [Pyth](https://docs.filecoin.io/smart-contracts/advanced/oracles#pyth) * [Tellor](https://docs.filecoin.io/smart-contracts/advanced/oracles#tellor) * [eOracle](https://docs.filecoin.io/smart-contracts/advanced/oracles#eoracle) sun-brightdesktopmoon sun-brightdesktopmoon --- # Cross-Chain Data Bridge(CCDB) | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#introduction) Introduction ------------------------------------------------------------------------------------------------------------ As one of the leading decentralized storage networks, Filecoin is designed to store and safeguard large volumes of data in a distributed and censorship-resistant manner. With the addition of the Filecoin Virtual Machine (FVM), programmatic storage is now available on Filecoin and enables fully trustless, on-chain storage deal-making. It will open up opportunities for Filecoin to offer its verifiable storage service to other smart contract platforms like Ethereum, Polygon, Avalanche, and other EVM-compatible blockchains. In the context of decentralized storage, Cross-chain Data Bridge (AKA onramp contract) allows applications on EVM-compatible blockchains (such as Ethereum, Avalanche, Polygon, Linea, etc.) to seamlessly store data on Filecoin’s decentralized storage network without users interacting directly with Filecoin. The process includes escrowed payments on the source chain, data preparation and aggregation for Filecoin storage deals, and cross-chain proof validation before payment release. This tutorial will guide you through: * Understanding the architecture and workflow of the data bridge. * Setting up connections from any EVM-compatible source chain. * Uploading data to Filecoin via the bridge. * Hands-on code examples. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#architecture-overview) Architecture Overview ------------------------------------------------------------------------------------------------------------------------------ A combination of on-chain contracts and off-chain services powers the cross-chain data bridge. At a high level, it consists of: 1. [**Smart contracts**arrow-up-right](https://github.com/FIL-Builders/onramp-contracts) * **OnRamp Contract (Source Chain – Any EVM Chain)** * This smart contract receives storage requests from users. * Verifies the data aggregation proof. * It holds the user’s payment in escrow and emits an event for off-chain agents. * **Oracle Contract (Source Chain – Same EVM Chain)** * Receives storage confirmations from Filecoin. * Validates proofs and triggers the OnRamp to release escrowed funds. * **Prover Contract (Destination Chain – Filecoin Network)** * Verifies storage deals sealed on Filecoin. * Sends attestations (proofs) back to the source chain via a cross-chain messaging layer. * **Cross-Chain Messaging Bridge (e.g, Axelar)** * The system uses the Axelar network to transport messages between Avalanche and Filecoin. 2. [**xChain Client (Off-Chain Agent)**arrow-up-right](https://github.com/FIL-Builders/xchainClient) * Monitors the OnRamp contract for new data offers. * Handles file packaging (CAR file creation), CommP calculation, and deal submission to Filecoin. * It can also serve as a storage buffer for storage providers to retrieve data to make storage deals on Filecoin. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#high-level-workflow) High-Level Workflow ![](https://docs.filecoin.io/~gitbook/image?url=https%3A%2F%2F3376433986-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FxNWFG7bQkjLkl5BBGjbD%252Fuploads%252Fgit-blob-a162bd00e06adcea50c47437e1fe25b80dddaeb9%252FCCDB.gif%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=ee88368&sv=2) The bridge’s workflow can be summarized in a multi-step process: 1. **Upload Data**: A user submits a storage offer to the OnRamp contract on their EVM-compatible chain. 2. **Data Aggregation**: The xChain client detects the offer from smart contract events, fetches the data, aggregates smaller data into a big piece, and sends the proof of aggregation back to the onramp contract. 3. **Filecoin storage deal making**: The xChain client will send the storage deal proposal to the storage providers either through an on-chain smart contract or an off-chain process. 4. **Bridging Proofs**: Once Filecoin confirms the data is stored, the Prover contract will receive the deal notification automatically and emit a proof via the Axelar cross-chain messaging network. 5. **Payment Release**: The Oracle contract on the source chain verifies the proof and instructs the OnRamp to release payment. Each component plays a vital role in ensuring trust-minimized and seamless data storage between chains. This modular design also makes the bridge extensible—one could integrate a different messaging layer or deal aggregator without changing the overall flow. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#using-the-bridge-to-store-data) Using the Bridge to store data ------------------------------------------------------------------------------------------------------------------------------------------------ Now that we understand the architecture, let’s see how to interact with the cross-chain bridge as a developer. We will use the Avalanche Fuji testnet as an example. We will cover how to connect to an existing bridge deployment, upload data from Avalanche to Filecoin step-by-step, and what tools or SDKs are involved. **Pre-Requisites** * **RPC endpoints** for your source EVM chain (e.g., Avalanche Fuji). * **Wallet** with enough native tokens (FIL & AVAX) and ERC-20 tokens for fees and storage payments. * Access to OnRamp and Oracle contracts on Avalanche Fuji & Prover contract on the Filecoin network. * In this tutorial, we are going to use the pre-deployed contracts on Avalanche and Filecoin. The details are [here](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#deployed-contracts-info) . * In any case, if you need to deploy your version. Please follow the [deployment instructionsarrow-up-right](https://github.com/fil-builders/onramp-contracts?tab=readme-ov-file#-getting-started) on GitHub. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-1-connect-to-existing-bridge) Step 1: Connect to Existing Bridge To use the cross-chain data bridge, you must interact with the deployed smart contracts on your desired source chain (e.g., Avalanche) and Filecoin. OnRamp (and related) contracts have been deployed on the Avalanche Fuji testnet and the Filecoin Calibration testnet in a development or test environment. You can connect to those networks and call the contracts directly without deploying your own. To store data to Filecoin from your UI code, you must configure the following parameters so your project can interact with the onramp contract on the source chain (e.g., Avalanche). * Wallet Connection to Metamask so you can use Fuji testnet configs and wallet with AVAX test tokens. * Onramp contract details are deployed on one source chain (e.g., Avalanche). * `ONRAMP_CONTRACT_ADDRESS`: `0xeE857540dddB6E6EA10a5c84f57562F11D5Fb47D` * `ONRAMP_CONTRACT_ABI`: retrieve from [herearrow-up-right](https://github.com/FIL-Builders/dataBridgeDemo/blob/ea9c6bcecaa6ea0b96a92e00dd148b69a141a8df/components/contracts/onrampContract.tsx#L3) . The OnRamp is an EVM-compatible contract, so standard Ethereum libraries (ethers.js, web3.js, etc.) will work. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-2-prepare-data-and-submit-offer) Step 2: Prepare Data and Submit Offer Interacting with the bridge to store data involves a few steps, both on-chain and off-chain. Overall, we need to prepare a data offer structure to send to the onramp contract by calling `offerData(Offer calldata offer)`. 1. **Choose or upload the file you want to store** 2. **Generate a CommP (Piece Commitment)** Ideally, you will generate a [CommP (Piece Commitment)arrow-up-right](https://spec.filecoin.io/systems/filecoin_files/piece/#section-systems.filecoin_files.piece) for your data, which is a hash that uniquely represents the piece of data in Filecoin’s format. You can use [@web3-storage/data-segmentarrow-up-right](https://www.npmjs.com/package/@web3-storage/data-segment) library to generate CommP for your data. Once the _CommP_ is generated, you can get the pieceCid and pieceSize for calling the onramp contract. 3. **Upload your data to a buffer (e.g. IPFS)** Your data must be uploaded to a buffer before the data is aggregated and sent to Filecoin storage providers. We use IPFS as a storage buffer and will provide a link to download the data. One of the options for uploading data to IPFS is the [Pinataarrow-up-right](https://pinata.cloud/) IPFS pinning service. 4. **Approve the OnRamp contract to spend the chosen ERC-20 token (for payment).** If you want to add ERC20 tokens on Avalanche as a payment for storage data on Filecoin as an extra incentive, you can specify the ERC20 token address and amount you want to pay. These tokens will be escrowed in the onramp contract temperately, and they will be released to the payout address once the data is proven stored on Filecoin. Make sure you approve the OnRamp contract to spend the chosen ERC-20 token before you invoke the OnRamp contract. 5. **Call the** `**offerData(...)**` **function on the OnRamp contract.** Now, we have prepare the data to make an offer struct to send it to OnRamp contract for Filecoin storage deals. Then we can call the Onramp contract on Avalanche to initialize the Filecoin storage process, using the contract feature from [wagmiarrow-up-right](https://wagmi.sh/react/api/hooks/useWriteContract) . We are already done sending the data from the source chain (e.g., Avalanche) to store on Filecoin. Once the offer is recorded on-chain, the xChain Client and Filecoin storage providers will process the storage deal on Filecoin and send the storage proof back to the source chain (e.g., Avalanche). circle-info Step 3 and 4 explain how the xChain client & Filecoin are handling cross-chain data storage and proofing. Avalanche dApp builders do not need to implement it. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-3-xchain-client-processes-the-offer) Step 3: xChain Client Processes the Offer * The xChain client listens to `DataReady()` events emitted by the OnRamp contract. * It aggregates the data, calculates CommP if needed, and submits a storage deal to the Filecoin network for storage providers to process. * Deals may be aggregated for efficiency. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-4-proof-delivery-and-payment-release) Step 4: Proof Delivery & Payment Release * Once Filecoin confirms the storage (deal sealed) on-chain, the Filecoin built-in actor will automatically notify the Prover contract and emit proof of attestation. * This proof is sent via the cross-chain messaging layer (e.g, Axelar) to the Oracle contract on your source chain (e.g, Avalanche). * The Oracle calls the `OnRamp.proveDataStored(...)` to prove that the data is stored and releases payment to the payout address. * The offer status in the Onramp contract will be updated once proven. ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-5-storage-confirmation) Step 5: Storage Confirmation The storage should be completed after some time (depending on the speed of the Filecoin deal sealing and any batching delays). We can verify this in a couple of ways. * **Listen for the Onramp event:** If we had the Onramp contract’s address/ABI, we could listen for a `ProveDataStored` event which fires when the proof comes back. * **Poll the OnRamp contract:** * If your application is tracking the offer ID, it can call a view function like `getOfferDetails(uint64 offerId)` or `getOfferStatus(uint64 offerId)` on the OnRamp contract to confirm that the status of a specific offer ID. * If not, your application can always retrieve all the data offers sent by a clients by calling `getClientOffers(address client)` on the OnRamp contract. You can also refer to this [dataBridgeDemo repoarrow-up-right](https://github.com/FIL-Builders/dataBridgeDemo) as a reference for the implementation of storing your application data on Avalanche to the Filecoin network. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#best-practices) Best Practices ---------------------------------------------------------------------------------------------------------------- When using a cross-chain data bridge in production or advanced projects, keep in mind the following best practices to ensure security and efficiency: * **Chain-Agnostic Integration:** The contracts work across any EVM-compatible chain. Always check that you are connected to the correct RPC endpoint. * **Token Approvals:** Ensure sufficient allowance is given to the OnRamp contract for ERC-20 tokens. * **Data Handling and Privacy:** All data sent through this system will be stored on a public decentralized network. If your application deals with sensitive data, **encrypt** the files before offering them to the bridge. * **Monitoring:** Implement monitoring of Oracle events and OnRamp status for better UX. * **Stay Updated:** The cross-chain storage tooling is evolving rapidly. Keep an eye on updates to the FIL-Builders onramp repositories and related documentation from [here](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#references) . By following these steps, you can integrate Filecoin storage into any EVM-compatible blockchain application via this cross-chain bridge. [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#deployed-contracts-info) Deployed Contracts Info ---------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#source-chain) Source Chain **Avalanche Fuji testnet** * Onramp.sol: [0xeE857540dddB6E6EA10a5c84f57562F11D5Fb47Darrow-up-right](https://subnets-test.avax.network/c-chain/address/0xeE857540dddB6E6EA10a5c84f57562F11D5Fb47D) * Oracle.sol: [0x476eE57404BD06c957a9BB6BF31216BFFa32dE18arrow-up-right](https://subnets-test.avax.network/c-chain/address/0x476eE57404BD06c957a9BB6BF31216BFFa32dE18) **Base Sepolia testnet** * Onramp.sol: [0x8d227741feCB90973B338c405011916Ea72df403arrow-up-right](https://repo.sourcify.dev/84532/0x8d227741feCB90973B338c405011916Ea72df403) * Oracle.sol: [0xfDe90468898d5D2996Cf0850E9ac3646D454154Barrow-up-right](https://repo.sourcify.dev/84532/0xfDe90468898d5D2996Cf0850E9ac3646D454154B) ### [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#destination-chain-filecoin-calibration-testnet) Destination Chain - Filecoin Calibration testnet * Prover.sol: [0x75c9C9fAC04C696820260CC0bE4201859ff85397arrow-up-right](https://calibration.filfox.info/en/address/0x75c9C9fAC04C696820260CC0bE4201859ff85397) [hashtag](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#references) References -------------------------------------------------------------------------------------------------------- * [onramp-contracts repoarrow-up-right](https://github.com/FIL-Builders/onramp-contracts/) * [xChainClient repoarrow-up-right](https://github.com/FIL-Builders/xchainClient) * [dataBridgeDemo repoarrow-up-right](https://github.com/FIL-Builders/dataBridgeDemo) * [Under the Hood: Architecture and Prototype of Cross Chain Data Storagearrow-up-right](https://medium.com/@filoz/under-the-hood-architecture-and-prototype-of-cross-chain-data-storage-6f8ba2c480d6) * * * _Note:_ For chain-specific deployment instructions (e.g., deploying to Polygon or Linea), refer to the onramp-contracts & xChainClient repository deployment guide. [PreviousDirect deal-makingchevron-left](https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making) [NextData replication, renewal and repair (RaaS)chevron-right](https://docs.filecoin.io/smart-contracts/programmatic-storage/raas) Last updated 7 months ago * [Introduction](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#introduction) * [Architecture Overview](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#architecture-overview) * [High-Level Workflow](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#high-level-workflow) * [Using the Bridge to store data](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#using-the-bridge-to-store-data) * [Step 1: Connect to Existing Bridge](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-1-connect-to-existing-bridge) * [Step 2: Prepare Data and Submit Offer](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-2-prepare-data-and-submit-offer) * [Step 3: xChain Client Processes the Offer](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-3-xchain-client-processes-the-offer) * [Step 4: Proof Delivery & Payment Release](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-4-proof-delivery-and-payment-release) * [Step 5: Storage Confirmation](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#step-5-storage-confirmation) * [Best Practices](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#best-practices) * [Deployed Contracts Info](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#deployed-contracts-info) * [Source Chain](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#source-chain) * [Destination Chain - Filecoin Calibration testnet](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#destination-chain-filecoin-calibration-testnet) * [References](https://docs.filecoin.io/smart-contracts/programmatic-storage/ccdb#references) sun-brightdesktopmoon Copy struct Offer { bytes commP; uint64 size; string location; uint256 amount; IERC20 token; OfferStatus status; } Copy //Generate Commp from a given file export async function generateCommp(file: File) { const bytes = new Uint8Array(await file.arrayBuffer()); //Using the Piece Info to get the legacy coding for CID const piece = Piece.fromPayload(bytes).toInfo(); return piece; } Copy const commP = await generateCommp(file); //commp & size for making offer struct const pieceCid = commP.link.bytes; const pieceSize = commP.size; Copy const apiKey = process.env.NEXT_PUBLIC_PINATA_API_KEY; const res = await fetch('https://api.pinata.cloud/pinning/pinFileToIPFS', { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, }, body: fileData, }); //CID of your data const fileCid = resData?.IpfsHash; //the buffer URL for Offer struct const ipfsU = 'https://gateway.pinata.cloud/ipfs/'+ fileCid Copy const TOKEN_ADDRESS = "0x..."; // ERC-20 token (payment token) on Avalanche const paymentToken = new ethers.Contract(TOKEN_ADDRESS, ERC20_ABI, signer); const paymentAmount = ethers.utils.parseUnits("10", 18); // e.g. 10 tokens (assuming 18 decimals) // 2. Approve the OnRamp contract to pull payment await paymentToken.approve(ONRAMP_ADDRESS, paymentAmount); console.log("Payment approved"); Copy //Making offer struct const offer = { commP: ethers.hexlify(pieceCid) as `0x${string}`, size: BigInt(pieceSize), cid: fileCid.toString(), location: ipfsURL, amount: BigInt(0), token: PAYMENT_TOKEN_ADDRESS as `0x${string}`, }; Copy writeContract({ address: ONRAMP_CONTRACT_ADDRESS, abi: ONRAMP_CONTRACT_ABI, functionName: 'offerData', args: [offer], }); Copy const ONRAMP_ADDRESS = "0x..."; // OnRamp contract on Avalanche const ONRAMP_ABI = [ /* ... offerData ABI ... */ ]; // Initialize contract objects const onRamp = new ethers.Contract(ONRAMP_ADDRESS, ONRAMP_ABI, signer); const status = await onRamp.getOfferStatus(offerId); sun-brightdesktopmoon --- # General | Filecoin Docs [hashtag](https://docs.filecoin.io/reference/general#about-filecoin) About Filecoin ---------------------------------------------------------------------------------------- * [**Filecoin Specification**arrow-up-right](https://spec.filecoin.io/) - technical specification for Filecoin protocol and its associated subsystems. * [**Filecoin Slack**arrow-up-right](https://filecoin.io/slack) - announcements and open discussion of Filecoin. * [**Filecoin Orbit Community Program**arrow-up-right](https://www.fil.org/orbit) - the Filecoin Orbit Community Program is an effort of dozens of volunteers around the world to organize meetups and hackathons in their local jurisdictions. * [**Filecoin YouTube channel**arrow-up-right](https://www.youtube.com/channel/UCPyYmtJYQwxM-EUyRUTp5DA) - various Filecoin workshops, conference talks, and meetups. [hashtag](https://docs.filecoin.io/reference/general#filecoin-network) Filecoin Network -------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/reference/general#node-implementations) Node implementations * [**Lotus**arrow-up-right](https://github.com/filecoin-project/lotus) - _**Recommended**_ most advanced implementation and [security auditedarrow-up-right](https://spec.filecoin.io/#section-intro.implementations-status) , in GoLang. * Other implementations: * [Venusarrow-up-right](https://github.com/filecoin-project/venus) - also in GoLang ([Venus documentationarrow-up-right](https://venus.filecoin.io/) ). * [Forestarrow-up-right](https://github.com/ChainSafe/forest) - Rust. * Lotus Docker Hub Images (unofficial): * [`glif/lotus`arrow-up-right](https://github.com/glifio/filecoin-docker) ### [hashtag](https://docs.filecoin.io/reference/general#networks) Networks [`network.filecoin.io`arrow-up-right](https://network.filecoin.io/) - lists all current Filecoin networks and related information. * **Mainnet** * [Mainnet network statusarrow-up-right](https://filecoin.statuspage.io/) - reports the status and incident of the Filecoin Mainnet. * **Calibration** * Largest testnet which support 32 GiB and 64 GiB sectors. * See [`#fil-net-calibration-discuss`arrow-up-right](https://filecoinproject.slack.com/archives/C01D42NNLMS) for questions and discussion in [Filecoin Slackarrow-up-right](https://filecoin.io/slack) . * **Local Devnet** * [Run a Local Devnet using Lotusarrow-up-right](https://lotus.filecoin.io/lotus/developers/local-network/) . [hashtag](https://docs.filecoin.io/reference/general#network-status) Network status ---------------------------------------------------------------------------------------- Tools to check status and details of the network and chain. ### [hashtag](https://docs.filecoin.io/reference/general#block-explorers) Block explorers * [`Filfox.info`arrow-up-right](https://filfox.info/en) - Mainnet * [Filscanarrow-up-right](https://filscan.io/) - Mainnet & Calibration ### [hashtag](https://docs.filecoin.io/reference/general#chain-data-and-monitoring) Chain data and monitoring * [Starboardarrow-up-right](https://dashboard.starboard.ventures/) - network health monitoring * [Sentinel Projectarrow-up-right](https://lilium.sh/) - Filecoin Network Monitoring and Analysis System * [DataCapStatsarrow-up-right](https://datacapstats.io/) - data providing insight on the Filecoin Plus program. ### [hashtag](https://docs.filecoin.io/reference/general#storage-deals-status) Storage/Deals status * [Starboardarrow-up-right](https://dashboard.starboard.ventures/capacity-services) - Filecoin storage provider analytics * [`filecoin.tools`arrow-up-right](https://filecoin.tools/) - check your CID’s storage deal status. Also provides an API - check [`filecoin.tools/docs`arrow-up-right](https://filecoin.tools/docs) for reference * [Deals list at `Filfox.io`arrow-up-right](https://filfox.info/en/deal) [hashtag](https://docs.filecoin.io/reference/general#storage-onramps) Storage Onramps ------------------------------------------------------------------------------------------ Web-based applications that store your data on Filecoin. No command-line or coding experience required. * [Lighthousearrow-up-right](https://lighthouse.storage/) "offers permanent, decentralized storage powered by Filecoin. Secure, scalable, and ideal for individuals, developers, and enterprises." * [Storachaarrow-up-right](https://storacha.network/) is an open hot storage network scales IPFS and Filecoin. Upload any data and Storacha will ensure it ends up on a decentralized set of IPFS and Filecoin storage providers. There Storacha [docsarrow-up-right](https://docs.storacha.network/) detail the JavaScript and Go API libraries, and there is a no-code web uploader available as well. * [Singularityarrow-up-right](https://singularity.storage/) "facilitates onboarding of large quantaties of data (PB-scale) to the Filecoin network in an efficient, secure, and flexible way." * [CID Gravityarrow-up-right](https://www.cidgravity.com/) is a "seamless gateway to the decentralized web", allowing you to drag and drop files through an easy-to-use UI that uploads files to Filecoin and IPFS. * [Ramoarrow-up-right](https://www.ramo.io/) is "a network coordinating people, hardware and capital to build a more open and resilient internet infrastructure for everyone." * [Starling Framework for Data Integrityarrow-up-right](https://www.starlinglab.org/) * to securely capture, store and verify human history * learn more at [`starlinglab.org/78days`arrow-up-right](https://www.starlinglab.org/78days/) or the [Filecoin blog interviewarrow-up-right](https://filecoin.io/blog/starling-framework/) [hashtag](https://docs.filecoin.io/reference/general#apis-and-developer-tools) APIs & Developer tools ---------------------------------------------------------------------------------------------------------- Developer tools, API clients & storage services that developers can use to build on Filecoin. ### [hashtag](https://docs.filecoin.io/reference/general#storage-apis-for-app-builders) Storage APIs for app builders * [Lighthousearrow-up-right](https://www.lighthouse.storage/) - Lighthouse offers a suite of tools to enable builders to store data on Filecoin when building apps. * [Fleek’s toolsarrow-up-right](https://fleek.xyz/) - provides access to Fleek’s hosted services using IPFS, Filecoin, Ethereum, etc. * [Akavearrow-up-right](https://www.akave.ai/) is "revolutionizing data management with a decentralized, modular solution that combines the robust storage of Filecoin with cutting-edge encryption and easy-to-use interfaces." ### [hashtag](https://docs.filecoin.io/reference/general#javascript-tools) JavaScript tools * [iso-filecoinarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin) - Filecoin Javascript Standard Library. Used by the [Metamask Filecoin Walletarrow-up-right](https://github.com/filecoin-project/filsnap) and [Ledger Live Filecoin apparrow-up-right](https://www.ledger.com/coin/wallet/filecoin) . * [iso-filecoin-reactarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin-react) - React hooks and context to easily integrate Filecoin wallet interactions into your React applications. It works seamlessly with the wallet adapters from iso-filecoin-wallets. Check out the [documentation websitearrow-up-right](https://filecoin.hugomrdias.dev/) for more information. ### [hashtag](https://docs.filecoin.io/reference/general#wallet-related-tools) Wallet-related tools * [Metamask Filecoin Walletarrow-up-right](https://github.com/filecoin-project/filsnap) - A MetaMask [Snaparrow-up-right](https://snaps.metamask.io/snap/npm/filsnap/) to add Filecoin support to the MetaMask extension. Check out [filsnap.devarrow-up-right](https://filsnap.dev/) built with the [iso-filecoinarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin) and [filsnaparrow-up-right](https://github.com/filecoin-project/filsnap) libraries. * [iso-filecoin-walletsarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin-wallets) - Filecoin wallet adapters to interact with different types of Filecoin wallets through a common interface. Supports Ledger, MetaMask Filecoin Wallet, and more. ### [hashtag](https://docs.filecoin.io/reference/general#node-infrastructure-and-apis) Node Infrastructure & APIs > NOTE: making deep calls into the chain’s history may take some time to return and it may be more efficient to use a chain database (e.g. used by block explorers) that stores the chain’s history and is optimized for queries. * [Chain.lovearrow-up-right](https://lotus.filecoin.io/lotus/developers/chain-love/) - A hosted endpoint to Filecoin mainnet and testnet. Note: as of Q1 2023, Infura no longer supports Filecoin. * The GLIF endpoint supports read-only calls and `MPoolPush()` for sending signed transactions to the network (which can be signed using the [Message signing toolsarrow-up-right](https://docs.filecoin.io/reference/general/overview/#message-signing-tools) ). * [**Lotus JSON-RPC API**arrow-up-right](https://lotus.filecoin.io/lotus/get-started/what-is-lotus/) - Lotus offers the full feature set of its capabilities through API. * [lotus API Postman samplearrow-up-right](https://documenter.getpostman.com/view/4872192/SWLh5mUd?version=latest) - (shows sample wallet calls only) **Scalable endpoint hosting** For running a node cluster of load balanced Lotus JSON RPC API endpoints. * [Filecoin-chartarrow-up-right](https://github.com/glifio/filecoin-chart) (k8 cluster) - Helm chart for hosting Lotus Node clients. **Filecoin API clients** * [iso-filecoinarrow-up-right](https://github.com/hugomrdias/filecoin/tree/main/packages/iso-filecoin) - Filecoin Javascript Standard Library includes an API client for the Lotus JSON-RPC API. **Storage provider index API** * [Filrep.io APIarrow-up-right](https://filrep.io/api) - A suite of RESTFul JSON endpoints to discover the best storage provider to make deals with. ### [hashtag](https://docs.filecoin.io/reference/general#data-prep-tools) Data prep tools * [CAR filesarrow-up-right](https://ipld.io/specs/transport/car/) - automatically used on Lotus import for less than 32 and 64 GiB, Filecoin archive format serialized from DAGs, see also [building with the Lotus APIarrow-up-right](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) . * [`go-graphsplit`arrow-up-right](https://github.com/filedrive-team/go-graphsplit) - FileDrive chunks a larger single DAG for storage in default Filecoin 32 and 64 GiB sector sizes. * [IPFSarrow-up-right](https://ipfs.tech/) - you can use `ipfs add` with an IPFS node then [add the CID from a Filecoin nodearrow-up-right](https://docs.filecoin.io/builder-cookbook/data-storage/store-data) . ### [hashtag](https://docs.filecoin.io/reference/general#databases-using-ipfs-and-filecoin) Databases using IPFS and Filecoin * [Tablelandarrow-up-right](https://tableland.xyz/) - (new) create familiar SQL tables to read and write dynamic NFT metadata or application data for dApps, from Textile. * [OrbitDBarrow-up-right](https://orbitdb.org/) - decentralized multi-party database on IPFS with multi-party syncing with topic pubsub and CRDTs. * [ThreadsDBarrow-up-right](https://docs.textile.io/threads/) - decentralized multi-party database for user-siloed data on IPFS, from Textile. ### [hashtag](https://docs.filecoin.io/reference/general#other-developer-tools) Other developer tools * [`js-rle`arrow-up-right](https://github.com/willscott/js-rle) - RLE+ Spec. Learn about [`rle-bitset-encoding` in the Filecoin Specarrow-up-right](https://spec.filecoin.io/#section-appendix.data_structures.rle-bitset-encoding) . * [Truffle for Filecoinarrow-up-right](https://www.trufflesuite.com/docs/filecoin/truffle/quickstart) - building apps to preserve files to IPFS and Filecoin. [hashtag](https://docs.filecoin.io/reference/general#storage-providers) Storage providers ---------------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/reference/general#storage-provider-reputation-systems) Storage provider reputation systems * [Filrep.ioarrow-up-right](https://filrep.io/) - Index of online storage providers and their pricing, ranked by power and reputation score. * [SpaceGaparrow-up-right](https://spacegap.github.io/) - shows storage proof deadlines and sector details for the top 50 storage providers. ### [hashtag](https://docs.filecoin.io/reference/general#storage-provider-tools) Storage provider tools * [Lotus Farcasterarrow-up-right](https://github.com/s0nik42/lotus-farcaster) - Prometheus, Grafana and Python monitoring dashboard. ### [hashtag](https://docs.filecoin.io/reference/general#storage-client-and-miner-programs) Storage client and miner programs * [Filecoin Plus Verified Data Programarrow-up-right](https://www.fil.org/filecoin-plus) * Incentivizes valuable data stored on Filecoin with a social trust network for verified data. * Clients can apply to allocators to receive DataCap and incentivize storage providers at 10x to their quality-adjusted power, increasing probability of block rewards. [hashtag](https://docs.filecoin.io/reference/general#ecosystem) Ecosystem ------------------------------------------------------------------------------ * [Filecoin Ecosystemarrow-up-right](https://www.fil.org/ecosystem-explorer) - explore the hundreds of projects in the Filecoin ecosystem using Filecoin Foundation's "Ecosystem Explorer." * [Upcoming Hackathonsarrow-up-right](https://hackathons.filecoin.io/) - keep a lookout for upcoming hackathons! * [Eventsarrow-up-right](https://www.fil.org/events) - attend a Filecoin event to engage with other ecosystem members. ### [hashtag](https://docs.filecoin.io/reference/general#grants-and-accelerators) Grants and accelerators * [**Filecoin Developer Grants**arrow-up-right](https://www.fil.org/grants) - ongoing monthly developer grant program to support open source projects and new [Open Grantsarrow-up-right](https://github.com/filecoin-project/devgrants/blob/master/Program%20Resources/Open%20Grants%20README.md) on Filecoin. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/general) [PreviousDeprecated networkschevron-left](https://docs.filecoin.io/networks/deprecated-networks) [NextGlossarychevron-right](https://docs.filecoin.io/reference/general/glossary) Last updated 3 months ago * [About Filecoin](https://docs.filecoin.io/reference/general#about-filecoin) * [Filecoin Network](https://docs.filecoin.io/reference/general#filecoin-network) * [Node implementations](https://docs.filecoin.io/reference/general#node-implementations) * [Networks](https://docs.filecoin.io/reference/general#networks) * [Network status](https://docs.filecoin.io/reference/general#network-status) * [Block explorers](https://docs.filecoin.io/reference/general#block-explorers) * [Chain data and monitoring](https://docs.filecoin.io/reference/general#chain-data-and-monitoring) * [Storage/Deals status](https://docs.filecoin.io/reference/general#storage-deals-status) * [Storage Onramps](https://docs.filecoin.io/reference/general#storage-onramps) * [APIs & Developer tools](https://docs.filecoin.io/reference/general#apis-and-developer-tools) * [Storage APIs for app builders](https://docs.filecoin.io/reference/general#storage-apis-for-app-builders) * [JavaScript tools](https://docs.filecoin.io/reference/general#javascript-tools) * [Wallet-related tools](https://docs.filecoin.io/reference/general#wallet-related-tools) * [Node Infrastructure & APIs](https://docs.filecoin.io/reference/general#node-infrastructure-and-apis) * [Data prep tools](https://docs.filecoin.io/reference/general#data-prep-tools) * [Databases using IPFS and Filecoin](https://docs.filecoin.io/reference/general#databases-using-ipfs-and-filecoin) * [Other developer tools](https://docs.filecoin.io/reference/general#other-developer-tools) * [Storage providers](https://docs.filecoin.io/reference/general#storage-providers) * [Storage provider reputation systems](https://docs.filecoin.io/reference/general#storage-provider-reputation-systems) * [Storage provider tools](https://docs.filecoin.io/reference/general#storage-provider-tools) * [Storage client and miner programs](https://docs.filecoin.io/reference/general#storage-client-and-miner-programs) * [Ecosystem](https://docs.filecoin.io/reference/general#ecosystem) * [Grants and accelerators](https://docs.filecoin.io/reference/general#grants-and-accelerators) sun-brightdesktopmoon sun-brightdesktopmoon --- # Exchange integration | Filecoin Docs [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#running-a-filecoin-node) Running a Filecoin node --------------------------------------------------------------------------------------------------------------------------------- If you plan to offer FIL on your exchange, you will need to run a Filecoin node. [Lotusarrow-up-right](https://lotus.filecoin.io/) is the reference implementation node for the Filecoin network, and as such, is currently the most production-ready implementation available. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#node-setup-and-installation) Node setup and installation Follow the [Lotus installation guidearrow-up-right](https://lotus.filecoin.io/lotus/install/prerequisites) to properly install the Lotus applications and launch node. The basic steps are: * Prepare your hardware by meeting the minimal requirements. * Install dependencies. * Start the Lotus daemon and sync the chain by either: * Syncing from scratch: in your lotus directory run `lotus daemon` * Syncing from a full snapshot. * Syncing from minimal snapshot A snapshot only has the state trees from the recent tipset (2000 epochs) onward and nothing before that tipset, which means it does not have all the historical states of the network. In addition, only a full snapshot has full state trees from a certain tipset. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#check-sync-status) Check sync status You can check the sync status by running `lotus sync status`. You are fully synced when the `Height` difference is `0`. Lotus will output any sync error. Copy lotus sync status > worker 28975: > Base: [bafy2bzacec2exqtdvxzzvikwg3sg67e57yaocpmrljkfxth3isjmruzd45vsa bafy2bzacecbbqdvidaf56eeth7oul2raycjpddvgtb23ywoyrqyh7ajulepai bafy2bzaceajtc3mgie5b72ivuiv3svwnbfq7kl2gnbni5tqc2ja6zi22vkttu bafy2bzacebf7oavffgiajf5goi6verhepsclhb7pcfwirkptu4dxrdoqshadw bafy2bzaceddtymcr5onnh63uznctks5hujpgzxcd45f5ef7oiuqocpmqs6rh2 bafy2bzacebuqm43mspki4ekdbu6xj663mpkrcoxtdss64t27fo77bg7pzbaia bafy2bzaceaxurgudmnphjcoz5sfad7yd63axyhmretqr5jjmvnicyu7betvvi bafy2bzaceali3oihrslxmnjdu2ysesxradorczjimruxdbkqidtcuag7wlr5a] > Target: [bafy2bzacedmswd73yn5faqzpbu5ofqinmh6fnzxfvazy52jrfthfhod4ssfgw] (1272951) > Height diff: 1 > Stage: complete > Height: 1272951 > Elapsed: 243.770396ms > worker 28976: > Base: [bafy2bzacedmswd73yn5faqzpbu5ofqinmh6fnzxfvazy52jrfthfhod4ssfgw] > Target: [bafy2bzacebxf27yxmzksno5ajkvp6shwojrx5mxsrtmlchrdchaqfg2wo7o3i] (1272951) > Height diff: 0 > Stage: complete > Height: 1272951 > Elapsed: 1.00020144s > worker 28977: > Base: [] > Target: [] (0) > Height diff: 0 > Stage: idle > Height: 0 You can run `lotus sync wait` to wait for the sync to be complete. Lotus will output `Done!` once your node is fully synced. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#basic-network-technology-info) Basic network technology info --------------------------------------------------------------------------------------------------------------------------------------------- The Filecoin network uses a [Proof of Storage (PoRep)arrow-up-right](https://spec.filecoin.io/#section-glossary.proof-of-replication-porep) + [Proof of SpaceTime (PoSt)arrow-up-right](https://spec.filecoin.io/#section-glossary.proof-of-spacetime-post) consensus algorithm. Time in the Filecoin network is dissected into [epochsarrow-up-right](https://spec.filecoin.io/#section-glossary.epoch) set to 30 seconds. A new set of blocks is produced for every epoch for a [tipsetarrow-up-right](https://spec.filecoin.io/#section-glossary.tipset) . The hard finality of the Filecoin network is 900 epochs. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#accounts-and-wallets) Accounts and wallets --------------------------------------------------------------------------------------------------------------------------- Filecoin uses an account-based model. There are 4 types of account prefixes: * `f0` for ID address * `f1` for Secp256k1 wallets * `f2`for [actorarrow-up-right](https://spec.filecoin.io/#section-glossary.actor) accounts * `f3` for BLS wallets `f1`, `f2`, and `f3` prefixed addresses are called account addresses. An account address is activated when it first receives a transaction. `f0` prefixed addresses are mapped to each active account address. **Testnet addresses** Within a testnet, the address prefix is `t`. So ID addresses become `t0`, Secp256k1 wallets become `t1`, etc. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#signatures) Signatures ------------------------------------------------------------------------------------------------------- Filecoin currently uses two types of signatures: * ECDSA signatures over the Secp256k1 elliptic curve * BLS signatures over the BLS12-381 group of curves. Details and reference implementations can be found [in the Filecoin specificationarrow-up-right](https://spec.filecoin.io/#section-algorithms.crypto.signatures.signature-types) . [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#messages) Messages --------------------------------------------------------------------------------------------------- There are two message types: * [Signed messagesarrow-up-right](https://github.com/filecoin-project/lotus/blob/9deda06ec632da3f7a035cc63b9408de72c96f79/chain/types/signedmessage.go#L44) * [Unsigned messagesarrow-up-right](https://github.com/filecoin-project/lotus/blob/9deda06ec632da3f7a035cc63b9408de72c96f79/chain/types/message.go#L28) . Messages are fully irreversible at 900 epochs. Waiting 200 epochs for message confirmation is acceptable. There are multiple gas fees associated with each message. Refer to the [practical guide to gas section of this blog postarrow-up-right](https://filecoin.io/blog/filecoin-features-gas-fees/) for details. An `ExitCode` of `0` in the message receipt indicates that the message was sent successfully. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#mempool) Mempool When a user sends a transaction to the network, it gets placed into the mempool queue. If a transaction doesn’t have enough gas, it stays in the mempool and doesn’t go anywhere. To new users, it looks like this transaction is lost forever. However, users can update the transaction with an updated `GasLimit`, `GasFeeCap`, and/or `GasPremium`. As long as you don’t change anything else in the transaction (`nonse`, `to`, `from`, `value`), then the transaction that is sat in the mempool will get updated with the new gas allowance. **Expiration** There is no limit for how long a message can spend in the mempool. However, the mempool does get _cleaned_ when there are too many messages in it, starting with the messages with the least gas. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#automatic-gas-values) Automatic gas values When `GasFeeCap`, `GasPremium` and `MaxFee` are set to `0`, Lotus will do the gas estimation for the message with 25% overestimation for the gas limit based on the current network condition. Some JavaScript libraries attempt to estimate the gas fees before sending the transaction to the Filecoin network. However, they sometimes underestimate, leading to transactions getting stuck in the mempool. If you are noticing your transactions getting stuck in the mempool after sending them to the network using a JavaScript library, try `GasFeeCap`, `GasPremium`, and `MaxFee` to `0`. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#filecoins-evm-and-send-method-number) Filecoin's EVM and Send method number A summary of the Filecoin's EVM differences with Ethereum is available in the [FEVM - Difference with Ethereum section](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum) . triangle-exclamation Note that when sending funds to a Filecoin EVM recipient address (f410f or 0x), it is recommended to always use the **InvokeEVM** **method 3844450837** to prevent possible loss of funds in case the recipient is a smart contract. The `lotus send 0x` CLI method always defaults to this method number. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#integration) Integration --------------------------------------------------------------------------------------------------------- You can interact with the network by using Lotus CLI or using the [JSON-RPC APIsarrow-up-right](https://lotus.filecoin.io/reference/basics/overview/) . Follow the [API tokens guidearrow-up-right](https://lotus.filecoin.io/docs/developers/api-access/) to set up API tokens on your node and grant necessary permissions. To find all CLI usage, run `lotus -h` in your lotus folder. You can find some other API client libraries developed by the Filecoin community [within the API client libraries pagearrow-up-right](https://lotus.filecoin.io/docs/developers/api-access/#api-client-libraries) . ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#api-examples) API examples Here are some Curl examples for connecting to a Lotus node using the JSON-RPC API: [**ChainHead**arrow-up-right](https://lotus.filecoin.io/reference/lotus/chain/#chainhead) [**ChainGetTipSetByHeight**arrow-up-right](https://lotus.filecoin.io/reference/lotus/chain/#chaingettipset) `bafy2bzacecxm6lhhzem3wshktatwzrcqbvc3k3jepzz7a6wqyc7w3fvav256i` is the block CID. This field is nullable. [**ChainGetParentMessages**arrow-up-right](https://lotus.filecoin.io/reference/lotus/chain/#chaingetparentmessages) `bafy2bzacedplsg3tqrv7e3v5rssvq3qwbd3c6g3en55zpqnyrymexhynz6ixu` is the block CID. You can pass in any one of the block CIDs included in the desired tipset. [**WalletNew**arrow-up-right](https://lotus.filecoin.io/reference/lotus/wallet/#walletnew) `1` for Secp2561K account and `2` for BLS account. [**WalletBalance**arrow-up-right](https://lotus.filecoin.io/reference/lotus/wallet/#walletbalance) `f1d7x4euqwtlk2bqzhclr6gubkufezgddkqftsnky` is the account address. [**MpoolPushMessage**arrow-up-right](https://lotus.filecoin.io/reference/lotus/mpool/#mpoolpushmessage) `Method` ID of `0` with null `Params` is a balance transfer transaction. When the `GasFeeCap`, `GasPremium` and `MaxFee` is `0`, Lotus will do the gas estimation for the message with a 25% overestimation for the gas limit based on the current network condition. You can change this value via the `GasLimitOverestimation` field. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#faq) FAQ ----------------------------------------------------------------------------------------- ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-do-i-sign-a-message) How do I sign a message? Use [WalletSignarrow-up-right](https://lotus.filecoin.io/reference/lotus/wallet/#walletsign) to sign the message and send the signed message using [MpoolPusharrow-up-right](https://lotus.filecoin.io/reference/lotus/mpool/#mpoolpush) . You may also use this [Filecoin signing tool library](https://docs.filecoin.io/reference/general/tools) . ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-do-i-retrieve-the-gas-fees-of-a-message) How do I retrieve the gas fees of a message? Call [StateReplayarrow-up-right](https://lotus.filecoin.io/reference/lotus/state/#statereplay) and look up the `GasCost` in the response. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-to-get-the-gas-estimation-of-a-message) How to get the gas estimation of a message? You can estimate the gas cost of a message by calling [GasEstimateMessageGasarrow-up-right](https://lotus.filecoin.io/reference/lotus/gas/#gasestimatemessagegas) . This API estimates the gas limit with a 25% overestimation based on the network condition under the given tipset key. You can change this value via the `GasLimitOverestimation` field. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-do-i-ensure-that-all-balances-transfer-in-any-messages-are-captured-including-msig-transfers) How do I ensure that all balances transfer in any messages are captured, including msig transfers? Call [StateComputearrow-up-right](https://lotus.filecoin.io/reference/lotus/state/#statecompute) or [StateReplayarrow-up-right](https://lotus.filecoin.io/reference/lotus/state/#statereplay) and go through all the transactions in the execution trace. Whenever the value `!=0 && exit code == 0`, it indicates a balance transfer has occurred. ### [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-can-i-check-if-my-transaction-is-stuck) How can I check if my transaction is stuck? The Lotus RPC method to retrieve the list of transactions waiting on the mempool is `Filecoin.MpoolPending`. The RPC call is: If you are using a JavaScript library, the method you need is `mpoolPending`. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#join-the-filecoin-slack) Join the Filecoin Slack --------------------------------------------------------------------------------------------------------------------------------- Join the [Filecoin Slackarrow-up-right](https://filecoinproject.slack.com/signup) and post any questions you have in there. [hashtag](https://docs.filecoin.io/reference/exchanges/exchange-integration#useful-links) Useful Links ----------------------------------------------------------------------------------------------------------- * [Filecoin websitearrow-up-right](https://filecoin.io/) * [Filecoin Specsarrow-up-right](https://spec.filecoin.io/) * [Filecoin Networksarrow-up-right](https://status.filecoin.io/) * [Lotusarrow-up-right](https://github.com/filecoin-project/lotus) - the reference implementation for the Filecoin network * [Block Explorersarrow-up-right](https://docs.filecoin.io/networks/mainnet/explorers/) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/exchanges/exchange-integration) [PreviousExchangeschevron-left](https://docs.filecoin.io/reference/exchanges) [NextBuilt-in actorschevron-right](https://docs.filecoin.io/reference/built-in-actors) Last updated 1 year ago * [Running a Filecoin node](https://docs.filecoin.io/reference/exchanges/exchange-integration#running-a-filecoin-node) * [Node setup and installation](https://docs.filecoin.io/reference/exchanges/exchange-integration#node-setup-and-installation) * [Check sync status](https://docs.filecoin.io/reference/exchanges/exchange-integration#check-sync-status) * [Basic network technology info](https://docs.filecoin.io/reference/exchanges/exchange-integration#basic-network-technology-info) * [Accounts and wallets](https://docs.filecoin.io/reference/exchanges/exchange-integration#accounts-and-wallets) * [Signatures](https://docs.filecoin.io/reference/exchanges/exchange-integration#signatures) * [Messages](https://docs.filecoin.io/reference/exchanges/exchange-integration#messages) * [Mempool](https://docs.filecoin.io/reference/exchanges/exchange-integration#mempool) * [Automatic gas values](https://docs.filecoin.io/reference/exchanges/exchange-integration#automatic-gas-values) * [Filecoin's EVM and Send method number](https://docs.filecoin.io/reference/exchanges/exchange-integration#filecoins-evm-and-send-method-number) * [Integration](https://docs.filecoin.io/reference/exchanges/exchange-integration#integration) * [API examples](https://docs.filecoin.io/reference/exchanges/exchange-integration#api-examples) * [FAQ](https://docs.filecoin.io/reference/exchanges/exchange-integration#faq) * [How do I sign a message?](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-do-i-sign-a-message) * [How do I retrieve the gas fees of a message?](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-do-i-retrieve-the-gas-fees-of-a-message) * [How to get the gas estimation of a message?](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-to-get-the-gas-estimation-of-a-message) * [How do I ensure that all balances transfer in any messages are captured, including msig transfers?](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-do-i-ensure-that-all-balances-transfer-in-any-messages-are-captured-including-msig-transfers) * [How can I check if my transaction is stuck?](https://docs.filecoin.io/reference/exchanges/exchange-integration#how-can-i-check-if-my-transaction-is-stuck) * [Join the Filecoin Slack](https://docs.filecoin.io/reference/exchanges/exchange-integration#join-the-filecoin-slack) * [Useful Links](https://docs.filecoin.io/reference/exchanges/exchange-integration#useful-links) sun-brightdesktopmoon Copy curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat ~/.lotus/token)" --data '{ "jsonrpc":"2.0", "method":"Filecoin.ChainHead", "params":[\ \ ], "id":0 }' http://127.0.0.1:1234/rpc/v0 Copy curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat ~/.lotus/token)" --data '{ "jsonrpc":"2.0", "method":"Filecoin.ChainGetTipSetByHeight", "params":[\ 100000,\ [\ {\ "/":"bafy2bzacecxm6lhhzem3wshktatwzrcqbvc3k3jepzz7a6wqyc7w3fvav256i"\ }\ ]\ ], "id":0 }' http://127.0.0.1:1234/rpc/v0 Copy curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat ~/.lotus/token)" --data '{ "jsonrpc":"2.0", "method":"Filecoin.ChainGetParentMessages", "params":[\ {\ "/":"bafy2bzacedplsg3tqrv7e3v5rssvq3qwbd3c6g3en55zpqnyrymexhynz6ixu"\ }\ ], "id":0 }' http://127.0.0.1:1234/rpc/v0 Copy curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat ~/.lotus/token)" --data '{ "jsonrpc":"2.0", "method":"Filecoin.WalletNew", "params":[\ 1\ ], "id":1 }' http://127.0.0.1:1234/rpc/v0 Copy curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat ~/.lotus/token)" --data '{ "jsonrpc":"2.0", "method":"Filecoin.WalletBalance", "params":[\ “f1d7x4euqwtlk2bqzhclr6gubkufezgddkqftsnky”\ ], "id":1 }' http://127.0.0.1:1234/rpc/v0 Copy curl -X POST -H 'Content-Type: application/json' -H "Authorization: Bearer $(cat ~/.lotus/token)" --data '{ "jsonrpc":"2.0", "method":"Filecoin.MpoolPushMessage", "params":[\ {\ "To":"t14pu4ogatxvok5727bd7ikp52mnnpxxxqicwyx7i",\ "From":"t3w5afgpwisxkryfb676h7xyku57uupigdh3zdoxj3kyep53hmo5njykfatqx5rga75ra5oucbyczr7lbjaezq",\ "Value":"1000000000000000000001",\ "Method":0,\ "Params":null,\ "GasLimit":20000000,\ "GasFeeCap":"0",\ "GasPremium":"0",\ "Nonce":0\ },\ {\ "MaxFee":"0"\ }\ ], "id":0 }' http://127.0.0.1:1234/rpc/v0 Copy { "jsonrpc": "2.0", "method": "Filecoin.MpoolPending", "id": 1, "params": [null] } sun-brightdesktopmoon --- # Direct deal-making with Client contract | Filecoin Docs In this tutorial we will cover the background of creating storage deals using smart contracts, and how to create storage deals with smart contracts on the [Filecoin virtual machine](https://docs.filecoin.io/reference/general/glossary#filecoin-virtual-machine) . You can find a video form of this walkthrough on [ETHGlobal’s YouTube Channelarrow-up-right](https://www.youtube.com/watch?v=27EV3gQGY9k) . [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#prerequisites) Prerequisites ---------------------------------------------------------------------------------------------------------------------------------- Before continuing, make sure you have the following software installed and prerequisites ready: * Git * NodeJS * Yarn or NPM (Yarn is used in this tutorial) * A code editor such as VS Code * A wallet with Calibration testnet FIL [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#steps) Steps ------------------------------------------------------------------------------------------------------------------ Let’s run through how to create storage deals using smart contracts. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#setup) Setup First, let’s grab the kit and set up the development environment. 1. Clone the Filecoin virtual machine deal-making kit, including all submodules: Copy git clone --recurse-submodules https://github.com/filecoin-project/fvm-starter-kit-deal-making.git This will copy the FVM deal-making kit into your current directory and initiate the `go-generate-car` submodule. 2. Move into the `fvm-starter-kit-deal-making` directory and grab all the dependencies using `yarn`: Copy cd fvm-starter-kit-deal-making yarn 3. Now that all the packages are downloaded, you need to create a `.env` file with your private key. This is so the Hardhat kit knows what wallet to use for transactions. Open up the repo in your code editor of choice and find the file titled `.env.example`. Rename the file to `.env`. You can do this in your terminal by running: Copy mv .env.example .env 4. Within the `.env` file, replace the example private key with your actual private key. If you are using Metamask, follow [this tutorial to get your private keyarrow-up-right](https://support.metamask.io/configure/accounts/how-to-export-an-accounts-private-key/) . circle-info Take precautions and never share your private key with anyone! Also make sure to not check your private key into Git. The `.gitignore` of the Hardhat kit is already set to ignore `.env` files. 1. Deploy the contracts with `hardhat`: This should compile and deploy all the contracts, including the client contract, which is the one we will be interacting with. Take note of the address of the deployed contract; we'll be using this later. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#preparing-a-file-for-storage) Preparing a file for storage Before storing a file with a storage provider it needs to be prepared by turning it into a `.car` file. The metadata also needs to be recorded. The Hardhat kit has a tool [which can do this for youarrow-up-right](https://github.com/filecoin-project/fevm-hardhat-kit/tree/main/tools) . However, to keep things nice and simple, we’re going to use the [FVM Data Depot websitearrow-up-right](https://data.lighthouse.storage/) . This website will automatically convert files to the `.car` format, output all the necessary metadata, and act as an HTTP retrieval point for the storage providers. 1. Go to the [FVM Data Depot websitearrow-up-right](https://data.lighthouse.storage/) and create an account. 2. Click **Upload File** and select a file you wish to upload. 3. Select the **File ID** of the file to read all the relevant metadata. Make a note of the: * Piece CID * Payload CID * Car size * Piece size * URL We’ll use this information in the next step when invoking the `MakeDealProposal` method. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#invoke-the-makedealproposal-method) Invoke the `MakeDealProposal` method Now that we have the `.car` file prepared in the data depot, we can invoke the MakeDealProposal method on the smart contract we deployed earlier. To do this, we will run the `make-deal-proposal` task in Hardhat. There are quite a few parameters to include in this call: * `contract`: the address of your deployed `ClientContract.sol`. * \`piece-cid: gathered from the previous step. * `piece-size`: gathered from the previous step. * `car-size`: gathered from the previous step. * `start-epoch`: The block number you want the deal to begin on. It should be a block in the future. You can find the current block number on [Beryxarrow-up-right](https://beryx.io/) , making sure to select the correct network. * `end-epoch`: The block number you want the deal to end on. It should be a block in the future and after the `Start-Epoch`. You can find the current block number on [FILFOXarrow-up-right](https://filfox.info/en) . * `location-ref`: The location of where the storage provider can find the .car file. This is the `URL` from the previous step. When calling the `make-deal-proposal` task in Hardhat, your command will look something like this: Parameters such as the `collateral` and `price-per-epoch` are set to `0`. On mainnet, these would be determined by storage providers, but since this is on the Calibration testnet, the storage providers should pick up the jobs even with these parameters set to `0`. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#storage-provider-picks-up-the-job) Storage provider picks up the job Now if you’ve invoked the task with all the correct parameters, the method will execute on-chain and emit an event that Boost storage providers will be listening for. If the deal is well-formed and the parameters are acceptable, they will download the `.car` file, double-check to ensure the `piece-cid` and `piece-size` match the deal, and publish your storage deal! This could take up to a day. Once the deal is published, you'll be able to find it on a Calibration testnet [block explorer](https://docs.filecoin.io/networks/calibration/explorers) . The client in the deal should be the `t4` address of the smart contract we called `MakeStorageDeal` on. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#monitoring-deal-proposal-acceptance) Monitoring deal proposal acceptance After emitting an event and waiting for storage providers to accept your deal, you can monitor its status on a provided Boost logs dashboard. This feature is only available on the Calibration testnet. [See this guide on GitHubarrow-up-right](https://github.com/filecoin-project/community/discussions/659) for help diagnosing why deals might not be accepted and adjusting your proposal for re-submission. [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#conclusion) Conclusion ---------------------------------------------------------------------------------------------------------------------------- During this tutorial, we have shown the significance of making deals using smart contracts and then walked through making a storage deal using the FVM deal-making kit and web3.storage. Developers can make use of this workflow to integrate decentralized storage on Filecoin with their smart contracts and decentralized applications. [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial) [PreviousFilecoin.solchevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/filecoin.sol) [NextUsing RaaSchevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas) Last updated 3 months ago * [Prerequisites](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#prerequisites) * [Steps](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#steps) * [Setup](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#setup) * [Preparing a file for storage](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#preparing-a-file-for-storage) * [Invoke the MakeDealProposal method](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#invoke-the-makedealproposal-method) * [Storage provider picks up the job](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#storage-provider-picks-up-the-job) * [Monitoring deal proposal acceptance](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#monitoring-deal-proposal-acceptance) * [Conclusion](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial#conclusion) sun-brightdesktopmoon Copy yarn hardhat deploy Copy yarn hardhat make-deal-proposal \ --contract 0x0219eB1740C315fe5e20612D7E13AE2A883dB3f4 \ --piece-cid baga6ea4seaqn4eomxfk3ttog7lnvlvedu7nia377w4gotw2pm746k6kq7gwe6ga \ --piece-size 2097152 \ --verified-deal false \ --car-size 1439368 \ --label baga6ea4seaqn4eomxfk3ttog7lnvlvedu7nia377w4gotw2pm746k6kq7gwe6ga \ --start-epoch 180000 \ --end-epoch 700000 \ --storage-price-per-epoch 0 \ --provider-collateral 0 \ --client-collateral 0 \ --extra-params-version 1 \ --location-ref "https://bafybeidguwwno5ohjss7g4l6ygvyy3dzxxrkkgtxqkobnnxnu62aw4ipxa.ipfs.w3s.link/ipfs/bafybeidguwwno5ohjss7g4l6ygvyy3dzxxrkkgtxqkobnnxnu62aw4ipxa/baga6ea4seaqn4eomxfk3ttog7lnvlvedu7nia377w4gotw2pm746k6kq7gwe6ga.car \ --skip-ipni-announce true \ --remove-unsealed-copy true \ sun-brightdesktopmoon --- # Solidity libraries | Filecoin Docs [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#openzeppelin) OpenZeppelin -------------------------------------------------------------------------------------------------------------------------- [OpenZeppelinarrow-up-right](https://www.openzeppelin.com/contracts) provides a library of battle-tested smart contract templates, including widely used implementations of ERC token standards. For a guided example that implements an ERC20 token on the Filecoin network, see [Example using an ERC20 contract](https://docs.filecoin.io/smart-contracts/fundamentals/erc-20-quickstart) . ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#benefits) Benefits OpenZeppelin offers the following to smart contract developers: * Implementations of standards like ERC20, ERC721, and ERC1155. * Flexible access control schemes like `Ownable`, `AccessControl`, and `onlyRole`. * Useful and secure utilities for signature verification, `SafeMath`, etc.. Token standards, such as [ERC20arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc20) , are the most widely used smart contract libraries from OpenZeppelin. These contracts, listed below, implement both _fungible_ and _non-fungible_ tokens: * [ERC20arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc20) is the simplest and most widespread token standard for fungible assets. * [ERC721arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc721) is the standard solution for non-fungible tokens and is often used for collectibles and games. * [ERC777arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc777) provides a richer standard for fungible tokens, supporting new use cases and backwards compatibility with ERC20. * [ERC1155arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc1155) is a new standard for _multi-tokens_, where a single contract represents multiple fungible and non-fungible tokens, and operations are batched for increased gas efficiency. ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#using-openzeppelin-with-fvm) Using OpenZeppelin with FVM The _general_ procedure for using OpenZeppelin with FVM is as follows: 1. Install OpenZeppelin. For example, using `npm`: 1. Import the specific library you want to use. 2. In your smart contract, inherit the library. Thanks to the FVM, your contract can be integrated and deployed on the Filecoin network with OpenZeppelin inheritance. For a guided example that implements an ERC20 token on the Filecoin network, see [Example using an ERC20 contract](https://docs.filecoin.io/smart-contracts/fundamentals/erc-20-quickstart) . ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#example-using-an-erc-20-contract) Example using an ERC-20 contract In the following tutorial, you’ll write and deploy a smart contract that implements the [ERC-20arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc20) on the Calibration testnet using Remix and MetaMask: **Prerequisites** Let’s take an ERC20 contract as an example to write and deploy it on the Calibration testnet using Remix & MetaMask: * Remix. * MetaMask. * [MetaMask connected to the Calibration testnet](https://docs.filecoin.io/networks/calibration) . * Test tokens (tFIL) [from the faucetarrow-up-right](https://faucet.calibnet.chainsafe-fil.io/) . **Procedure** In this procedure, you will create, deploy, mint and send an [ERC20arrow-up-right](https://docs.openzeppelin.com/contracts/4.x/erc20) token on Calibration using Remix and MetaMask. 1. Navigate to [remix.ethereum.orgarrow-up-right](https://remix.ethereum.org/) . 2. Next to **Workspaces**, click the **+** icon to create a new workspace. 3. In the **Choose a template** dropdown, select **ERC20** along with the **Mintable** checkbox 4. Click **OK**. 5. In the **contract** directory, open **MyToken.sol**. 6. Set the token `` and ``: 1. Next, compile and deploy the contract on Filecoin. 2. At the top of the workspace, click the green play symbol to compile the contract. 3. Once the contract compiles, open the **Deploy** tab on the left. 4. Under the **Environment** dropdown, select **Injected Provider - MetaMask**. 5. In the MetaMask popup window, select **Confirmed connection**. 6. Click **Deploy**, and confirm the transaction on MetaMask. Your token contract will be deployed to the Calibration testnet once the network confirms the transaction. 7. In Remix, open the **Deployed Contracts** dropdown. 8. In the `mint` method, set: * `to` to your wallet address. * `amount` to `1000000000000000000` (1 `FIL`). 9. Click **Transact**. 10. In MetaMask, confirm the transaction. Once the network processes the transaction, the token is minted and sent to your network address. Congratulations, you’ve completed the tutorial! ### [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#additional-resources) Additional resources Learn more about OpenZeppelin with the following resources: * [OpenZeppelin Contracts websitearrow-up-right](https://www.openzeppelin.com/contracts) * [Documentationarrow-up-right](https://docs.openzeppelin.com/contracts/4.x/) * [GitHubarrow-up-right](https://github.com/OpenZeppelin/openzeppelin-contracts) [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#dappsys) DappSys ---------------------------------------------------------------------------------------------------------------- The DappSys library provides safe, simple, and flexible Ethereum contract building blocks for common Ethereum and Solidity use cases. * [Documentationarrow-up-right](https://dappsys.readthedocs.io/en/latest/) * [GitHubarrow-up-right](https://github.com/dapphub/dappsys) [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#id-0x-protocol) 0x protocol --------------------------------------------------------------------------------------------------------------------------- The 0x protocol library provides a set of secure smart contracts that facilitate peer-to-peer exchange of Ethereum-based assets. * [Documentationarrow-up-right](https://docs.0x.org/introduction/introduction-to-0x) * [GitHubarrow-up-right](https://github.com/0xProject) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries) [PreviousFoundrychevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/foundry) [NextCall built-in actorschevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/call-built-in-actors) Last updated 1 year ago * [OpenZeppelin](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#openzeppelin) * [Benefits](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#benefits) * [Using OpenZeppelin with FVM](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#using-openzeppelin-with-fvm) * [Example using an ERC-20 contract](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#example-using-an-erc-20-contract) * [Additional resources](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#additional-resources) * [DappSys](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#dappsys) * [0x protocol](https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries#id-0x-protocol) sun-brightdesktopmoon Copy npm install @openzeppelin/contracts Copy // contracts/GLDToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MyToken is ERC20 { constructor(uint256 initialSupply) ERC20(, ) { _mint(msg.sender, initialSupply); } } sun-brightdesktopmoon --- # Privacy & Access Control | Filecoin Docs ### [hashtag](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control#encrypting-data-for-storing-on-filecoin) Encrypting data for storing on Filecoin Ensuring your dataset is encrypted is critical to good privacy hygiene when storing files on decentralized networks, including Filecoin and IPFS. Uploading an unencrypted file would allow the storage provider to read the files you store with them, and allow them to send copies to unknown third parties. The Lighthouse team developed the Kavach encryption SDK, which is included in the Lighthouse SDK by default, to enable encryption of files pinned to IPFS or stored on Filecoin. The below examples are pulled directly from their documentation, you can read more [herearrow-up-right](https://docs.lighthouse.storage/how-to/upload-encrypted-data) . **Ingredients:** * [Kavach encryption SDKarrow-up-right](https://github.com/lighthouse-web3/encryption-sdk) * [Access control to a datasetarrow-up-right](https://docs.lighthouse.storage/how-to/encryption-features/access-control-conditions) **Instructions:** There are two options for encrypting files being uploaded to Filecoin. 1. The first option is encrypting your uploaded file using the Kavach SDK in the backend of your app. Copy import {ethers} from "ethers" import lighthouse from '@lighthouse-web3/sdk' import kavach from "@lighthouse-web3/kavach" const signAuthMessage = async(privateKey) =>{ const signer = new ethers.Wallet(privateKey) const authMessage = await kavach.getAuthMessage(signer.address) const signedMessage = await signer.signMessage(authMessage.message) const { JWT, error } = await kavach.getJWT(signer.address, signedMessage) return(JWT) } const uploadEncrypted = async() =>{ /** * This function lets you upload a file to Lighthouse with encryption enabled. * * @param {string} path - Location of your file. * @param {string} apiKey - Your unique Lighthouse API key. * @param {string} publicKey - User's public key for encryption. * @param {string} signedMessage - A signed message or JWT used for authentication at encryption nodes. * * @return {object} - Returns details of the encrypted uploaded file. */ const pathToFile = '/home/cosmos/Desktop/wow.jpg' const apiKey = 'YOUR_API_KEY_HERE' const publicKey = 'YOUR_PUBLIC_KEY_HERE' const signedMessage = await signAuthMessage(privateKey) const response = await lighthouse.uploadEncrypted(pathToFile, apiKey, publicKey, signedMessage) console.log(response) /* Sample Response { data: [\ {\ Name: 'decrypt.js',\ Hash: 'QmeLFQxitPyEeF9XQEEpMot3gfUgsizmXbLha8F5DLH1ta',\ Size: '1198'\ }\ ] } */ } uploadEncrypted() 1. Alternatively, files can be encrypted with MetaMask in your browser application. 1. The following code also demonstrates how to encrypt JSON / text files stored on IPFS or Filecoin. * * * ### [hashtag](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control#gated-access-to-your-dataset) Gated access to your dataset Lighthouse also provides a number of methods to gate access a given data set. In the below code, the variables are: Variable Description id the condition number chain the current blockchain network method function used to check a condition standardContractType the type of contract being checked. Options include ERC20, ERC1155, ERC721 or Custom returnValueTest details what is being compared parameters allow for the function to take in any data it may need inputArrayType the type of the parameter being taken as input outputType the type of response returned by the function **Sample Code:** * The first method is “NFT-based access,” where a user is able to access a file if they own at least one NFT of a given ERC721 contract. * The second method is “Custom contract,” where a user is able to access a file if the returned value of a given function in the custom contract satisfies a certain condition. In the below example, the condition being checked is whether the “get()” function returns “1”. * The third method is to check native tokens. In the below example, the condition being checked is whether the wallet address looking to access a file owns at least 1 ETH. * The fourth and final method is to condition the access of a file on the block height, which is effectively time-based gate access. In the example below, a user can access the file above the block height of 133494. To review the Lighthouse documentation in its entirety, please visit: [https://docs.lighthouse.storagearrow-up-right](https://docs.lighthouse.storage/) [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control) [PreviousRetrieve Datachevron-left](https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data) [NextdAppschevron-right](https://docs.filecoin.io/builder-cookbook/dapps) Last updated 3 months ago * [Encrypting data for storing on Filecoin](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control#encrypting-data-for-storing-on-filecoin) * [Gated access to your dataset](https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control#gated-access-to-your-dataset) sun-brightdesktopmoon Copy import React, { useState } from "react" import lighthouse from "@lighthouse-web3/sdk" function App() { const [file, setFile] = useState(null) // Define your API Key (should be replaced with secure environment variables in production) const apiKey = process.env.REACT_APP_API_KEY // Function to sign the authentication message using Wallet const signAuthMessage = async () => { if (window.ethereum) { try { const accounts = await window.ethereum.request({ method: "eth_requestAccounts", }) if (accounts.length === 0) { throw new Error("No accounts returned from Wallet.") } const signerAddress = accounts[0] const { message } = (await lighthouse.getAuthMessage(signerAddress)).data const signature = await window.ethereum.request({ method: "personal_sign", params: [message, signerAddress], }) return { signature, signerAddress } } catch (error) { console.error("Error signing message with Wallet", error) return null } } else { console.log("Please install Wallet!") return null } } // Function to upload the encrypted file const uploadEncryptedFile = async () => { if (!file) { console.error("No file selected.") return } try { // This signature is used for authentication with encryption nodes // If you want to avoid signatures on every upload refer to JWT part of encryption authentication section const encryptionAuth = await signAuthMessage() if (!encryptionAuth) { console.error("Failed to sign the message.") return } const { signature, signerAddress } = encryptionAuth // Upload file with encryption const output = await lighthouse.uploadEncrypted( file, apiKey, signerAddress, signature, progressCallback ) console.log("Encrypted File Status:", output) /* Sample Response { data: [\ Hash: "QmbMkjvpG4LjE5obPCcE6p79tqnfy6bzgYLBoeWx5PAcso",\ Name: "izanami.jpeg",\ Size: "174111"\ ] } */ // If successful, log the URL for accessing the file console.log( `Decrypt at https://decrypt.mesh3.network/evm/${output.data[0].Hash}` ) } catch (error) { console.error("Error uploading encrypted file:", error) } } // Function to handle file selection const handleFileChange = (e) => { const selectedFile = e.target.files if (selectedFile) { setFile(selectedFile) } } return (
) } export default App Copy import lighthouse from '@lighthouse-web3/sdk' /** * Use this function to upload an encrypted text string to IPFS. * * @param {string} text - The text you want to upload. * @param {string} apiKey - Your unique Lighthouse API key. * @param {string} publicKey - Your wallet's public key. * @param {string} signedMessage - A message you've signed using your private key. * @param {string} [name] - optional name for text * * @return {object} - Details of the uploaded file on IPFS. */ const yourText = "PLACE_YOUR_TEXT_HERE" const apiKey = "PLACE_YOUR_API_KEY_HERE" const publicKey = "PLACE_YOUR_PUBLIC_KEY_HERE" const signedMessage = "SIGNATURE/JWT" const name = "anime" const response = await lighthouse.textUploadEncrypted(yourText, apiKey, publicKey, signedMessage) console.log(response) /* Sample Response { data: { Name: 'anime', Hash: 'QmTsC1UxihvZYBcrA36DGpikiyR8ShosCcygKojHVdjpGd', Size: '67' } } */ Copy { id: 1, chain: "wallaby", method: "balanceOf", standardContractType: "ERC721", contractAddress: "0x1a6ceedD39E85668c233a061DBB83125847B8e3A", returnValueTest: { comparator: ">=", value: "1" }, parameters: [":userAddress"], } Copy { id: 1, chain: "Mumbai", method: "get", standardContractType: "Custom", contractAddress: "0x019e5A2Eb07C677E0173CA789d1b8ed4384e59A5", returnValueTest: { comparator: "==", value: "1" }, parameters: [], inputArrayType: [], outputType: "uint256" } Copy { id: 1, chain: "Ethereum", method: "getBalance", standardContractType: "", returnValueTest: { comparator: ">=", value: "1000000000000000000" } } Copy { id: 1, chain: "Optimism", method: "getBlockNumber", standardContractType: "", returnValueTest: { comparator: ">", value: "133493" }, } sun-brightdesktopmoon --- # Programmatic | Filecoin Docs Programmatic verification allows you to automate the contract verification process directly from your development environment. This approach is ideal for CI/CD pipelines and streamlined deployment workflows. [hashtag](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract/programmatic#available-frameworks) Available Frameworks ------------------------------------------------------------------------------------------------------------------------------------------------------ Choose your preferred development framework: * [**Hardhat**](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract/programmatic/hardhat) - Popular Ethereum development environment with extensive plugin ecosystem * [**Foundry**](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract/programmatic/foundry) - Fast, portable, and modular toolkit for Ethereum application development [Was this page helpful?arrow-up-right](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract/programmatic) [PreviousVerify a contractchevron-left](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract) [NextHardhatchevron-right](https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract/programmatic/hardhat) Last updated 8 months ago sun-brightdesktopmoon sun-brightdesktopmoon ---