Proof-gated payment streams that release funds to Storage Providers only when cryptographic proofs confirm data is stored.
| Landing Page | Dashboard |
|---|---|
![]() |
![]() |
Dashboard: slastream.vercel.app
Contract: SLAEscrow on Starknet Sepolia
Deal #5 settled 3/3 chunks on-chain. Select it in the dashboard to see real transaction hashes linked to Starkscan.
Filecoin Storage Providers get paid in bulk after long storage periods. This creates cash flow gaps and gives clients no way to enforce SLAs or claw back funds when an SP stops proving data.
SLAStream locks STRK tokens in an on-chain escrow and releases them in chunks, one per verified proof-of-storage event. If proofs stop, anyone can slash the deal and return collateral to the client.
- Proof-gated payments: Funds release only when Filecoin PDP proofs are cryptographically verified
- Cross-chain oracle: Lit Protocol PKP signs attestations after verifying FEVM proof transactions
- On-chain sig verification: Cairo secp256k1 recovery confirms PKP identity before releasing funds
- Automatic slashing: Anyone can slash expired deals, returning collateral to the client
- Real-time proof feed: Dashboard shows live ChunkReleased events from Starknet with Starkscan links
- Deal management: Create deals, browse active deals, monitor payment progress
| Layer | Technology |
|---|---|
| Smart Contracts | Cairo 2.x, Scarb 2.8, Starknet Foundry |
| Oracle Bridge | Lit Protocol PKP (Chronicle Yellowstone) |
| Relay Service | TypeScript, Bun, ethers.js v5, starknet.js v7 |
| Frontend | Next.js 16, Tailwind CSS, starknet-react |
| Networks | Starknet Sepolia, Filecoin Calibration FEVM |
Filecoin FEVM Lit Protocol PKP Starknet Sepolia
(Calibration) (Chronicle Yellowstone) (SLAEscrow)
SP posts PDP proof -----> Relay detects event -----> release_chunk()
(RootsAdded event) Lit Action verifies tx Verifies secp256k1 sig
Signs attestation Releases chunk payment
to SP
If SLA deadline expires without enough proofs:
Anyone calls slash() ----> Collateral returned to client
- Client creates a deal on Starknet, locking STRK tokens (chunk payments + collateral)
- Storage Provider stores data, posts PDP proofs to Filecoin Calibration FEVM
- Relay monitors FEVM for
RootsAddedevents, requests Lit PKP signature - Lit Action verifies the proof transaction on FEVM, signs an attestation
- SLAEscrow verifies the secp256k1 signature and releases the next chunk payment
- If the deadline passes without enough proofs, anyone can call
slash()
The contract uses Cairo's native secp256k1 support:
- Relay constructs:
keccak256(abi.encodePacked(dealId, chunkIndex, proofSetId, rootCID, timestamp)) - Lit Action verifies the FEVM proof tx, then signs the message with the PKP key
- Contract recovers the public key and compares against the stored PKP public key
- Replay protection via per-chunk release flags prevents double-spending
Current architecture: A single relay service monitors Filecoin FEVM events and requests Lit PKP signatures. The relay cannot steal funds or forge proofs (the PKP key is controlled by the Lit network, not the relay), but it can censor or delay proof submissions.
Why this is acceptable for v1:
- The escrow contract is trustless. Funds are only released with a valid PKP signature.
- The relay is stateless. Anyone can run their own relay instance.
- Slashing protects clients if the relay goes offline (proofs stop, deadline expires, client gets collateral back).
Path to full decentralization:
- Multi-relay with heartbeat: Multiple relay operators register on-chain. If one fails to submit within N blocks, the next in queue takes over.
- Incentivized relaying: Relayers earn a small fee per successful chunk release, funded from the escrow.
- Direct SP submission: SPs submit their own proof attestations to Starknet, removing the relay entirely. Requires Starknet-native Filecoin light client (future infrastructure).
Phase 1 -- Testnet (current)
- Starknet Sepolia + Filecoin Calibration
- Single relay, manual deal creation
- 5/5 integration tests passing
Phase 2 -- Mainnet Alpha
- Deploy SLAEscrow to Starknet mainnet
- Multi-token support (STRK, USDC, ETH)
- Gas optimization: batch chunk releases into single transactions
- Rate-limited RPC with dedicated Alchemy/Infura keys
Phase 3 -- Decentralized
- Multi-relay network with on-chain registration
- SP self-service portal with deal templates
- Automated SLA monitoring with email/webhook alerts
- Filecoin mainnet integration (real PDP proofs)
Phase 4 -- Protocol
- Governance token for relay operator staking
- Cross-chain expansion (Ethereum L1, other L2s)
- SDK for third-party integrations
- Insurance pool for slashing protection
| Contract | Network | Description |
|---|---|---|
| SLAEscrow | Starknet Sepolia | Escrow with secp256k1 sig verification, deal management, slashing |
| MockERC20 | Starknet Sepolia (tests) | Test token for snforge integration tests |
cd frontend
npm install
cp .env.example .env.local
# Edit .env.local with your contract address and RPC URL
npm run devcd relay
bun install
cp .env.example .env
# Edit .env with your keys (see .env.example for all required vars)
bun run src/index.tscd contracts
scarb build
snforge test # 5/5 passingslastream/
├── contracts/ # Cairo smart contracts
│ └── src/
│ ├── sla_escrow.cairo # Main escrow: deals, release, slash, sig verify
│ ├── interfaces/ # ISLAEscrow trait definition
│ └── tests/ # 5 integration tests (snforge)
│ ├── test_sla_escrow.cairo # create_deal, release_chunk, slash, replay
│ └── mock_erc20.cairo # Test ERC20 token
├── relay/ # TypeScript relay service
│ ├── src/
│ │ ├── index.ts # Entry point: monitor + sign + broadcast loop
│ │ ├── fevm-monitor.ts # Polls Filecoin FEVM for PDP proof events
│ │ ├── lit-bridge.ts # Lit Protocol PKP signature requests
│ │ ├── starknet-relay.ts # Broadcasts release_chunk to Starknet
│ │ └── local-signer.ts # Local secp256k1 fallback (dev mode)
│ ├── lit-action/
│ │ └── action.js # IPFS-hosted Lit Action: verify + sign
│ └── scripts/ # CLI tools: create-deal, deploy, demo
├── frontend/ # Next.js dashboard
│ └── src/
│ ├── app/dashboard/ # Deal browser, proof feed, slash UI
│ ├── components/ # DealCard, ProofFeed, CreateDealDrawer, etc.
│ ├── hooks/ # useDeals, useProofEvents, useTransaction
│ └── lib/ # Starknet RPC helpers, types, constants
└── docs/ # Planning docs
MIT

