TrustFlow is per-second USDC subscription billing on Arc.A subscriber deposits a buffer, the balance drains to the merchant every second it's used, and cancelling instantly refunds whatever wasn't consumed — no support ticket, no waiting, no rounding. The subscriber can be a person or an autonomous agent.
Every subscription you've ever cancelled early paid the provider for time they never delivered. TrustFlow makes that impossible — usage is tracked to the second, and the contract enforces the refund automatically.
Every operation is onchain on Arc. Usage is computed from (rate × elapsed) — no off-chain scheduler, no batch window, no support queue. Cancel anytime and the contract does the math.
Set the rate, grace period, and cancellation terms. The plan lives as a single onchain record anyone can subscribe to.
// one transaction, one source of truth PlanRegistry.createPlan({ name: "Pro API", rate: 9_000000, // $9/mo in 6-dec USDC grace: 86400, // 1 day dispute: "agent+panel" })
Approve a bounded USDC allowance. Deposit a small buffer (1 week is typical). The stream begins ticking in the same block.
// 2 txs · ~$0.02 total gas on Arc USDC.approve(streamManager, buffer) StreamManager.createStream(planId, buffer) // → streamId · status: STREAMING
No cron job. No off-chain scheduler. Consumed balance is computed on-demand from (rate × elapsed). Merchant can claim accrued revenue anytime.
// merchant claims what's earned so far StreamManager.claim(streamId) // → transfers accrued USDC to merchant // → stream continues uninterrupted
Subscriber hits cancel. Unused buffer returns to their wallet in the same transaction. Arc's deterministic finality means the refund is final before the next heartbeat.
// one call · final in < 1 second StreamManager.cancel(streamId) // → consumed stays with merchant // → unused returns to subscriber
Autonomous agents buy APIs, compute, and data continuously. Prepaid credits strand capital; per-request payments (x402) can't meter a six-hour job or a live feed. TrustFlow is the continuous counterpart — a stream an agent opens, funds, and cancels itself, with no human in the loop.
Opens a stream, watches its runway, tops up before it expires, and cancels when the job is done. One human funds the wallet once; the agent signs everything after.
// the agent, unattended while (working) { runway = getBalance(streamId) if (runway < floor) topUp(streamId) } cancel(streamId) // refund is instant
The wallet is a Circle Agent Wallet. MPC key shares never touch the agent, and every transfer is bounded by the policy you set — that policy is the budget you hand it.
// key never enters the agent circle wallet execute \ "createStream(uint256,uint128)" \ planId buffer // policy-checked, then signed
If service degrades, the agent freezes payment and commits evidence onchain — a chargeback without a card network. It doesn't need a human to notice. The agent only opens the case: an arbitrator settles it, or the subscriber wins by default if the merchant never responds.
// bad service? freeze + escalate DisputeResolver.openDispute(streamId, amt) // → funds frozen onchain // → merchant has 7 days to respond // → arbitrator settles, or subscriber wins by default
Drop this into any backend. Returns active: true when the caller has a live stream. No SDK. No webhook setup. No auth server.
$ curl https://trustflowonarc.vercel.app/api/check \ -d "planId=42" \ -d "address=0xC8B1...44aA" # ← response { "active": true, "streamId": "0x3e…b7", "rate": "9000000", // per month "consumed": "412336", "remaining": "8587664", "canceledAt": null }
No policy. No support ticket. No waiting period. The contract refunds exactly what wasn't used — the moment you cancel.