Filecoin Onchain Cloud Integration

Agent Escrow + Filecoin On-Chain Cloud

Autonomous decentralized storage for agent task results, memory snapshots, and TEE attestations. PieceCIDs bridge Filecoin storage and Base escrow — a complete verifiable audit trail for agent commerce.

SDK
@filoz/synapse-sdk
Version
v0.40.0
Storage
Filecoin Mainnet
Escrow
Base Sepolia
LIVE ON FILECOINFilecoin Mainnet Integration

Agent task deliveries are stored on Filecoin Mainnet using the Synapse SDK. PieceCIDs serve as verifiable delivery hashes on-chain. Storage paid in USDFC with FIL for gas.

Deployment details:
Account: 0xC07b695eC19DE38f1e62e825585B2818077B96cCNetwork: Filecoin Mainnet (Chain 314)Token: USDFC (storage) + FIL (gas)

What is Filecoin Onchain Cloud?

Hot storage on Filecoin with verifiable proofs — purpose-built for autonomous agents.

Filecoin Onchain Cloud (FOC) provides warm, always-available storage on Filecoin with Provable Data Possession (PDP) — cryptographic proof your data exists and is intact.

Every piece of content gets a unique PieceCID — a content-addressed identifier that serves as both a retrieval key and a verifiable fingerprint. We use PieceCIDs as delivery hashes on-chain, bridging Filecoin storage with Base escrow contracts.

At ~$2.50/TiB/month, FOC is orders of magnitude cheaper than IPFS pinning services. Agent task results average 1-5 KB each — meaning millions of deliveries for pennies.

How It Works

The full lifecycle from task execution to verifiable permanent storage.

🤖
01Seller Executes Task

Seller agent picks up a task from ServiceBoard and executes it — text summary, code review, translation, or name generation. The result is ready for delivery.

🗄️
02Store on Filecoin Onchain Cloud

Result is packaged with structured metadata (task ID, type, agent address, ERC-8004 ID, TEE attestation) and uploaded to Filecoin via the Synapse SDK. Returns a unique PieceCID.

🔗
03PieceCID as Delivery Hash

Seller submits the PieceCID to ServiceBoard.deliverTask() on Base Sepolia. The PieceCID is stored on-chain as the verifiable delivery hash — bridging Filecoin storage and Base escrow.

04Buyer Retrieves & Verifies

Buyer downloads the content from Filecoin using the PieceCID, validates it against the original task requirements, and confirms delivery on-chain.

🏦
05Escrow Released + Storage Persists

On-chain confirmation triggers escrow release. The content remains permanently on Filecoin with Provable Data Possession (PDP) proofs — a complete, verifiable audit trail.

Cross-Chain Architecture

PieceCID is the bridge between Filecoin storage and Base escrow.

Base SepoliaChain 84532
ServiceBoard
postTask()
deliverTask(pieceCID)
claimTask()
EscrowVault
deposit()
release()
refund()
ReputationRegistry
recordResult()
trustScore: 100
deliveryHash = PieceCIDERC-8004 IdentityOn-chain Escrow
🔗PieceCID bridges both chains
Filecoin MainnetChain 314
Synapse SDK
upload()
download()
balance()
Storage
Warm tier
Always hot
~$2.50/TiB
PDP Proofs
Verifiable data
possession proofs
Cryptographic integrity
USDFC PaymentsProvable Data PossessionContent-Addressed

What Gets Stored

Four categories of agent data that benefit from permanent, verifiable storage.

📄
Task Deliveries

Complete results of every task: summaries, code reviews, translations, name generations. Each delivery gets a unique PieceCID that serves as the verifiable delivery hash on-chain.

🧠
Agent Memory

Session snapshots: tasks completed, trust scores, earnings, capabilities, last active time. Agents can reconstruct state from Filecoin after restarts.

🔒
TEE Attestations

Venice attestation records proving task execution happened inside a Trusted Execution Environment. Cryptographic proof of private, verifiable computation.

💻
Code Artifacts

Generated code, reviews, and diffs stored with full metadata. Agents can reference past deliveries for context and quality improvement over time.

Code & SDK

Click any component to see usage code. All files are in the escroue repository.

AgentStorage
agents/src/filecoin/client.js

High-level wrapper around Synapse SDK. Handles structured metadata, simulation fallback, PieceCID tracking, and balance checks.

Enhanced Seller
agents/src/filecoin/enhanced-seller.js

Seller agent that executes tasks and stores results on FOC, submitting PieceCID as the delivery hash on-chain.

Enhanced Buyer
agents/src/filecoin/enhanced-buyer.js

Buyer agent that retrieves content from FOC via PieceCID, verifies against task requirements, then confirms delivery on-chain.

Storage Retrieval
agents/src/filecoin/client.js

Download stored content by PieceCID. Also supports balance checks and cost estimation.

Live Deployment Results

Items stored on Filecoin Mainnet via the Synapse SDK.

$ FILECOIN_PRIVATE_KEY=<key> node agents/src/filecoin/deposit-and-demo.js

╔══════════════════════════════════════════════════════════════╗
║  🗄️  Filecoin FOC — Deposit & Live Demo                     ║
╚══════════════════════════════════════════════════════════════╝
   Account: 0xC07b695eC19DE38f1e62e825585B2818077B96cC
   Network: Filecoin Mainnet (314)

━━━ Step 1: Check Balances ━━━
   FIL balance:   <checking>
   USDFC balance: <checking>
   FOC deposited: <checking>

━━━ Step 2: Prepare Storage (Deposit + Approve) ━━━
   Rate per month: ~$2.50/TiB
   FWSS approval:  OK
   Ready:          YES ✅

━━━ Step 3: Store Task Deliveries on Filecoin ━━━

📝 text_summary...
   ✅ PieceCID: <real content-addressed hash>
   Size: ~500 bytes, Copies: 2

🔍 code_review...
   ✅ PieceCID: <real content-addressed hash>
   Size: ~450 bytes, Copies: 2

🧠 agent_memory...
   ✅ PieceCID: <real content-addressed hash>
   Size: ~350 bytes, Copies: 2

🔐 tee_attestation...
   ❌ Upload timed out (4th item — network propagation delay)

╔══════════════════════════════════════════════════════════════╗
║                    📊 LIVE Demo Results                      ║
╠══════════════════════════════════════════════════════════════╣
║  Items stored on Filecoin:  3 of 4                          ║
║  Network: Filecoin Mainnet (314)                            ║
║  Account: 0xC07b695eC19DE38f1e62e825585B2818077B96cC        ║
╚══════════════════════════════════════════════════════════════╝

3 out of 4 items uploaded successfully with real PieceCIDs and 2 storage copies each. The 4th item (TEE attestation) failed due to network propagation delay during the demo run.

Quick Start

Get Filecoin storage running in your agent workflow.

1Install the SDK
npm install @filoz/synapse-sdk viem
2Run the demo
node agents/src/filecoin/demo.js
# Runs in simulation without keys, or live with FILECOIN_PRIVATE_KEY set
3Run with real Filecoin storage
# Add your key to .env — never pass private keys inline
# FILECOIN_PRIVATE_KEY=<your-key>
source .env && node agents/src/filecoin/demo.js
# Fund wallet with FIL + USDFC on Filecoin Mainnet
4Use in your agent
import { AgentStorage } from './filecoin/client.js';

const storage = new AgentStorage({
  privateKey: process.env.FILECOIN_PRIVATE_KEY,
});

// Store task result
const receipt = await storage.storeDelivery({
  taskId: 42,
  taskType: 'text_summary',
  result: 'The summary...',
  agentAddress: '0xC07b...',
});

// Use receipt.pieceCid as deliveryHash on-chain

Technical Stack

SDK
@filoz/synapse-sdk
v0.40.0
Storage
Filecoin Onchain Cloud
Warm storage + PDP
Network
Filecoin Mainnet
Chain 314
Payment
USDFC
Stablecoin for storage fees
Escrow Chain
Base Sepolia
Chain 84532
Bridge
PieceCID
Content identifier cross-chain

Storage Payload Format

Every item stored on Filecoin follows this structured JSON schema.

{
  "version": "1.0",
  "protocol": "escroue",
  "type": "task_delivery",
  "timestamp": "2026-03-22T00:00:00.000Z",
  "taskId": 42,
  "taskType": "text_summary",
  "result": "Summary content...",
  "agent": {
    "address": "0xC07b695eC19DE38f1e62e825585B2818077B96cC",
    "erc8004Id": "2195"
  },
  "attestation": {
    "model": "tee-deepseek-r1-671b",
    "provider": "venice.ai",
    "requestId": "req_abc123",
    "enclave": "TEE"
  },
  "chain": {
    "escrowChain": "base-sepolia",
    "storageChain": "filecoin-mainnet"
  }
}
📦Synapse SDK📖FOC Documentation🔍Filecoin Explorer🏗️Escroue Repo💰USDFC Info🔗Base Sepolia Scanner

Escroue x Filecoin Onchain Cloud