Architecture
Filecoin Onchain Cloud consists of several interrelated smart contracts:Contract Responsibilities
Filecoin Pay
Generic payment rails for continuous rate-based payments
Warm Storage
Storage service with PDP verification and payment integration
PDP Verifier
Neutral proof verification without business logic
SP Registry
Provider registration and discovery
Session Keys
Disposable key authorization for dapps
Data Flow
Upload Flow
import { signCreateDataSet } from '@filoz/synapse-core/typed-data'
const signature = await signCreateDataSet(client, {
dataSetInfo: {
client: client.account.address,
payer: client.account.address,
serviceProvider: provider.serviceProvider,
serviceProviderId: provider.id,
startEpoch: currentEpoch,
rate: estimatedRate,
lockup: estimatedLockup,
metadata: [],
},
nonce: currentNonce,
})
function addPieces(
uint256 dataSetId,
PieceInfo[] calldata pieces,
bytes calldata extraData
) external;
function beforeAddPieces(
uint256 dataSetId,
PieceInfo[] calldata pieces,
bytes calldata extraData
) external returns (bytes32);
Proof Flow
Contract Addresses
Mainnet
Contract addresses are auto-discovered from the network. Query via:Calibration Testnet
EIP-712 Signing
All contract interactions use EIP-712 typed data for security:Contract ABIs
All ABIs are available in@filoz/synapse-core:
Read vs Write Operations
Read Operations
Query contract state without transactions:Write Operations
Send transactions to modify state:Event Listening
Multicall
Batch multiple read operations:Gas Estimation
Contract Simulation
Error Handling
Network Configuration
Best Practices
Use SDK
Use Synapse SDK for high-level operations
Multicall Reads
Batch multiple reads with multicall
Simulate First
Always simulate before executing writes
Handle Reverts
Parse and handle contract-specific errors
Source Code
FWSS
Filecoin Warm Storage Service contracts
Filecoin Pay
Payment rails contract
PDP Verifier
Proof verification contract
SP Registry
Service provider registry
Next Steps
FWSS Contract
Learn about the storage service contract
Filecoin Pay
Understand payment rails
PDP Verifier
Explore proof verification