AI workflows that move money only after a World ID human says yes: USDC on Arc, proof on 0G
Automate Trust Layer adds trust to Automate, my live workflow builder (automateplatform.in) that small businesses in India use to run AI agents on WhatsApp, email, Zoho and Shopify. Once an AI agent can take payments or issue refunds, two things still run on trust: who approved the money, and what the workflow actually did.
I added six steps to the flow builder's canvas:
The demo: a customer orders on WhatsApp, pays USDC into escrow, asks for a refund, proves they are one unique human, the owner approves with World ID, the escrow refunds them, and the run's proof lands on 0G. Denied, expired, repeat-claim and second-refund paths move no money.
I also added Sign in with MetaMask (Sign-In with Ethereum), from the browser extension or by QR code on a phone. Testnet only.
Automate is a React Router 8 app on a Node.js engine that walks each flow's node graph. A pending store pauses a run at a trust step and resumes it on the outcome's wire (approved, denied, expired, paid). Every trust page is a public link, checked entirely on the server.
World ID: Agent Pass through World's OIDC (auth.world.org) with PKCE, a nonce and max_age=300. The server verifies the id_token against World's JWKS (signature, audience, nonce, sign-in time) and binds the first approver. IDKit v4 (@worldcoin/idkit-core) uses a request signed on the server; proofs are verified with /api/v4/verify against our own action, one nullifier per action.
Arc: ethers v6 on Arc testnet, with native USDC. TrustEscrow was written, reviewed, tested (65 Foundry tests) and deployed with Arc Studio. Automate's operator signs keccak256(chainId, escrow, orderId, amount, deadline), so only the exact quoted amount can be paid; a watcher reads the escrow's Paid events with eth_getLogs; only the operator can refund or release, and a payer can reclaim after 14 days.
0G: the run record becomes canonical JSON (sorted keys), is hashed with sha256 and uploaded with @0gfoundation/0g-storage-ts-sdk. Verify downloads it by root hash with the Merkle proof and compares three digests: downloaded, stored and rebuilt. Phone numbers become an HMAC id and no message text is stored. The AI step and the Python knowledge service (ported from my earlier MetaCortex RAG) call the 0G Compute Router's OpenAI-compatible API.
The hacky part: MetaMask QR sign-in uses our own relay instead of WalletConnect. The QR deep-links into the MetaMask app's browser, the phone signs an EIP-4361 message bound to that request, and the computer polls with a secret kept in an httpOnly cookie. A security review found the QR could be relayed from someone else's screen (QRLJacking), so the phone now shows a 6-digit code the computer must type. "One approval, one payment" is enforced in the engine, not in a prompt.
Tests: 333 offline checks (World ID 71, Arc 81, escrow 23, end-to-end flow 46, MetaMask sign-in 81, Python 31), with every outside call faked.

