Bringing decentralized storage to every blockchain! This project enables dApps to store data on Filecoin from multiple L1/L2 networks using cross-chain data onramp smart contracts.
The CrossChain Data Bridge(aka, onramp contracts) enables applications on various blockchains (source chains) to store and retrieve data directly on the Filecoin decentralized storage network.
Features
- ⚡ Cross-Chain Compatibility – Supports multiple L1 & L2 networks.
- 🔐 Verifiable Storage – Leverages Filecoin's decentralized storage with built-in verification.
- 🧩 Modular Design – Easily extendable to integrate additional blockchains and components.
Our contracts act as a bridge between source chains (e.g., Linea, Avalanche, Arbitrum) and Filecoin.
-
Source Chains (L1/L2 networks)
OnRampContract– Handles cross-chain storage requests & verification, and user payments.AxelarBridge– Bridges messages via Axelar
-
Filecoin (Storage Destination)
DealClientAxl– Receives deal notification from Filecoin builtIn actor, sends proof back to source chain.
The cross-chain data bridge works through two main components deployed across chains:
-
Onramp Contracts:
- Source Chain Contracts:
Onramp.sol&Oracle.sol - Destination Chain Contract (Filecoin):
Prover.sol
- Source Chain Contracts:
-
xChain Client: Monitoring storage requests from the source chain, aggregating data, and facilitating deal-making with storage providers or deal engines.
You can refer to a dataBridgeDemo to learn how to interact with onramp contract to onboard data from other L1 to Filecoin.
- Node.js and npm installed
- Go 1.22.7 or later
- Access to test tokens for your chosen source chain
- Test FIL for Filecoin Calibration network
git clone https://github.com/FIL-Builders/onramp-contracts.git
cd onramp-contracts
npm install --force- Copy
.env.exampleto.env - Set the private key of your deployer wallet:
DEPLOYER_PRIVATE_KEY=your-private-key
NETWORK=testnet # Change to "mainnet" if deploying to mainnetnpx hardhat compileDeploys the DealClientAxl contract on Filecoin to handle storage transactions.
npx hardhat deploy --tags Filecoin --network filecoinDeploys OnRampContract & AxelarBridge on your chosen L1/L2 source chain.
Example for Linea:
npx hardhat deploy --tags SourceChain --network avalancheOther supported networks:
npx hardhat deploy --tags SourceChain --network arbitrum-sepolia
npx hardhat deploy --tags SourceChain --network linea-sepoliaAutomatically detects all deployed source chains and configures DealClientAxl:
npx hardhat deploy --tags ConfigFilecoin --network filecoinSets up cross-chain messaging:
npx hardhat deploy --tags ConfigSourceChain --network avalanchenpx hardhat deploy --tags Filecoin --network filecoin && \
npx hardhat deploy --tags SourceChain --network avalanche && \
npx hardhat deploy --tags ConfigFilecoin --network filecoin && \
npx hardhat deploy --tags ConfigSourceChain --network avalancheThe bridge requires running the xChain client to process storage requests and proofs between chains.
👉 Follow the installation guide to build and run it.
1️⃣ Start the xChain server:
./xchainClient daemon --config ./config/config.json --chain avalanche --buffer-service --aggregation-service2️⃣ Upload data using the client tool:
./xchainclient client offer-file --chain avalanche --config ./config/config.json <file_path> <payment-addr> <payment-amount>3️⃣ Check deal status:
./xchainClient client dealStatus <cid> <offerId>- Under the Hood: Architecture and Prototype of Cross-Chain Data Storage
- Demo app on Avalanche
- xChain Client Documentation
- Shashank's Guide
- Filecoin Deals Repo
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
