Visual drag-and-drop workflow builder that routes AI inference through 0G Compute, stores outputs on 0G Storage, and anchors provenance on 0G Chain.



Visual drag-and-drop workflow builder that routes AI inference through 0G Compute, stores outputs on 0G Storage, and anchors provenance on 0G Chain.
Live Demo · Slide Deck · Demo Video
Mainnet contract |
|
Testnet contract |
|
0G Explorer (mainnet) | https://explorer.0g.ai/address/0x2Dade1D970431445d1e9509751015c5F9C7F1F50 |
0G Explorer (testnet) | https://chainscan-galileo.0g.ai/address/0xC9B54F8437f87D3af6926876d32874f453121b7d |
0G components used | 0G Compute (Router API + TEE attestation), 0G Storage ( |
Every workflow execution writes two on-chain records: a WorkflowRegistered event (keccak256 manifest hash + storage root hash) and an ExecutionRecorded event — both verifiable on the 0G Explorer by contract address or workflow ID.
0G Flow is a visual workflow builder for verifiable AI on the 0G network. Users drag nodes onto a canvas, connect them, and deploy a signed manifest that:
Routes inference through the 0G Compute Router with optional TEE attestation
Uploads outputs to 0G Storage via merkle-tree-validated SDK transactions
Records a tamper-proof provenance receipt in WorkflowRegistry.sol on 0G Chain
Every execution produces a txHash, a rootHash, and an on-chain executionCount — all verifiable by workflow ID without trusting the application.
AI pipelines today are opaque: you can't prove which model ran, on what input, or that the output wasn't altered before it was stored. 0G Flow makes every step of a multi-model workflow verifiable on-chain — the manifest hash, the inference attestation, and the storage receipt are all anchored to 0G Chain in a single execution flow that anyone can audit.
┌─────────────────────────────────────────────────────────────┐
│ Browser │
│ Canvas (ReactFlow) → Manifest compiler → Deploy modal │
│ RainbowKit wallet (chain-aware: 16602 / 16661) │
└────────────────────┬────────────────────────────────────────┘
│ POST /api/execute
┌────────────────────▼────────────────────────────────────────┐
│ Next.js API Route │
│ ManifestExecutor → topological sort → variableResolver │
└──────┬──────────────────────┬───────────────────────────────┘
│ │
┌──────▼──────┐ ┌──────────▼────────────────────────────────┐
│ 0G Compute │ │ 0G Storage │
│ Router API │ │ @0gfoundation/0g-ts-sdk │
│ verify_tee │ │ merkle tree upload → txHash + rootHash │
│ → response │ └──────────────────────┬────────────────────┘
└─────────────┘ │
┌──────────▼────────────────────┐
│ 0G Chain │
│ WorkflowRegistry.sol │
│ registerWorkflow() │
│ recordExecution() │
│ → WorkflowRegistered event │
│ → ExecutionRecorded event │
└───────────────────────────────┘
Layer | Component | 0G integration |
|---|---|---|
Compute | 0G Router API |
|
Storage/DA |
| Merkle tree upload, |
Settlement |
|
|
Identity | Wagmi + RainbowKit | Chain-aware (Galileo 16602 / Aristotle 16661) |
Execution |
| Template reference resolution across nodes |
Protocol | Manifest schema |
|
Application | Canvas, 4-tab Drawer, run history | — |
Compute nodes send structured chat completions to the 0G Router. With sealed: true, the request includes verify_tee: true — the router returns x_0g_trace.tee_verified indicating whether inference ran inside a TEE enclave. The ZG-Res-Key / og_chat_id header enables independent verification via broker.inference.processResponse(providerAddress, chatID) from @0gfoundation/0g-compute-ts-sdk. A green TEE ✓ or red TEE ✗ badge appears inline in the execution log.
Mainnet models: zai-org/GLM-5.1-FP8, deepseek-v4-pro, 0GM-1.0-35B-A3B, qwen/qwen3-vl-30b-a3b-instruct Testnet models: qwen/qwen-2.5-7b-instruct
@0gfoundation/0g-ts-sdk)Storage Anchor and Memory Store nodes upload data via the 0G TypeScript SDK. Each upload goes through the SDK's merkle tree validation pipeline and returns a txHash and rootHash. The explorer link is constructed from the network's storageExplorer base URL. Storage writes are signed by the user's connected wallet — no server private key required.
WorkflowRegistry.sol is deployed on both networks. On each execution:
registerWorkflow(workflowId, manifestHash, storageKey) — records the keccak256 hash of the compiled manifest and the storage root hash
recordExecution(workflowId, executionTxHash, storageTxHash) — appends an execution record and increments executionCount
Both calls emit indexed events visible on the 0G Explorer. The Verify tab in the execution drawer calls getWorkflow and getLatestExecution to surface this data in-app.
Node | Role |
|---|---|
Data Input | JSON payload as the workflow trigger |
AI Compute | 0G Router inference with optional TEE attestation ( |
Memory Store | Read/write persistent memory via 0G Storage — wallet-signed upload on write, hash-based fetch on read |
Storage Anchor | Upload result to 0G Storage; returns |
Chain node outputs with {{nodeId.output.field}} in any downstream parameter.
Network | Chain ID | Router | Registry |
|---|---|---|---|
Galileo Testnet | 16602 |
|
|
Aristotle Mainnet | 16661 |
|
|
git clone https://github.com/erikamoji/0g-flow
cd 0g-flow
npm install
cp .env.example .env.localEdit .env.local:
# Required — 0G Compute API key from https://dashboard.0g.aiOG_ROUTER_API_KEY=your_key_here
# Optional — WalletConnect (app works in demo mode without it)
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
# WorkflowRegistry addresses — defaults already setNEXT_PUBLIC_REGISTRY_ADDRESS_16602=0xC9B54F8437f87D3af6926876d32874f453121b7d
NEXT_PUBLIC_REGISTRY_ADDRESS_16661=0x2Dade1D970431445d1e9509751015c5F9C7F1F50npm run devOpen http://localhost:3000, connect your wallet, and build a workflow.
Testnet (Galileo, Chain ID 16602) — recommended for review:
Add Galileo Testnet to MetaMask:
RPC: https://evmrpc-testnet.0g.ai
Chain ID: 16602
Symbol: A0G
Explorer: https://chainscan-galileo.0g.ai
Get testnet A0G: https://faucet.0g.ai (connect wallet, request tokens)
Connect wallet on 0G Flow — the app auto-detects the network and switches
Mainnet (Aristotle, Chain ID 16661):
RPC: https://evmrpc.0g.ai
Chain ID: 16661
Symbol: A0G
Explorer: https://explorer.0g.ai
WorkflowRegistry: 0x2Dade1D970431445d1e9509751015c5F9C7F1F50
Verifying a workflow on-chain:
Run any workflow in the app
Open the Verify tab in the execution drawer
The workflow ID is pre-filled — hit Verify
The app reads manifestHash, storageKey, executionCount, and the latest execTxHash directly from the registry contract and links to the 0G Explorer
To verify independently: call getWorkflow(ownerAddress, workflowId) on the registry contract via the 0G Explorer's Read Contract interface.
npm run execute manifests/example-vm0048.jsonRequires .env with OG_RPC_URL. See EXECUTOR.md for full docs.
The included example-vm0048.json demonstrates a carbon MRV workflow: data input → 0G inference validation → 0G Storage anchor.
Variable | Required | Description |
|---|---|---|
| yes | API key from the 0G compute dashboard |
| no | WalletConnect project ID (falls back to demo mode) |
| no | WorkflowRegistry on Galileo — default: |
| no | WorkflowRegistry on Aristotle — default: |
All RPC endpoints and router URLs resolve per-chain from lib/networks.ts. No server private key required — storage and registry writes are signed by the user's connected wallet.
Next.js 15 + React 19
ReactFlow (canvas)
RainbowKit + Wagmi (wallet, chain-aware)
@0gfoundation/0g-ts-sdk (storage)
Viem (registry contract reads/writes)
Tailwind v4
Hardhat (contract deployment)
Day 1–2: scaffolded the ReactFlow canvas, 3-node architecture (Input / Compute / Anchor), manifest executor, and wallet-gated landing page.
Day 3–4: wired real 0G Storage into anchor nodes, user-wallet signing, and UX polish.
Day 5: added WorkflowRegistry.sol, on-chain execution receipts, and pre-loaded demo workflow.
Day 6–8: network-aware routing across testnet/mainnet, full design overhaul, broker-based auth with wallet-signed requests, TEE verification, verify page, and mainnet deployment.
Pre-funding. 0G Flow is self-funded and actively seeking its first institutional backers. The hackathon marks our public debut.