Logo
Learn
  • Explore Course
Build
  • Explore Buildathon
  • Project Archive
Hack
Hack Coming Soon
  • Explore IRL Hackhouse
  • How to Qualify
  • Past Events

ZeroForge, your sovereignclaw

Sovereign-memory, multi-agent, iNFT-native agent framework for 0G. Encrypted memory on 0G Storage, TEE-attested inference on 0G Compute, ERC-7857 iNFT lifecycle with 1.5s cryptographic revocation.

Videos

Description

ZeroForge

ZeroForge is the visual side of the SovereignClaw stack — an open-source, sovereign-memory, multi-agent, iNFT-native agent framework for 0G. It gives developers four things that today's agent frameworks treat as afterthoughts: encrypted memory you own, TEE-attested inference, an ERC-7857 iNFT lifecycle with a real kill switch, and a drag-and-drop builder that compiles to the exact same TypeScript an engineer would write by hand.


The Problem

Almost every agent framework today treats memory as state in someone else's database. You don't own it, you can't prove what was there, and there's no lifecycle — no transfer story, no revocation, no audit trail. Agents are stateful programs without a sovereignty story.

ZeroForge fixes this at the framework layer, on 0G's primitives, end-to-end.


What We Built

Five composable npm packages

Package

What it does

@sovereignclaw/core

Agent runtime with the sealed0GInference adapter — calls 0G Compute with verify_tee: true

@sovereignclaw/memory

Encrypted KV / Log providers backed by 0G Storage. AES-256-GCM with HKDF-SHA-256, KEK derived from wallet signature

@sovereignclaw/inft

ERC-7857 helpers: mintAgentNFT, transferWithReencryption, revokeMemory, recordUsage. EIP-712 oracle proofs with per-token monotonic nonces

@sovereignclaw/mesh

Multi-agent orchestration over a 0G Log bus. Planner / Executor / Critic loop with typed events (agent.thinking.token, agent.handoff, task.complete)

@sovereignclaw/reflection

Self-critique with four built-in rubrics plus custom rubrics; learnings persisted under learning:<runId>

Two contracts on 0G Galileo (chainId 16602)

Contract

Address

AgentNFT.sol

0xc3f997545da4AA8E70C82Aab82ECB48722740601

MemoryRevocation.sol

0x735084C861E64923576D04d678bA2f89f6fbb6AC

Two production services

  • ZeroForge Studio — Next.js drag-and-drop builder + landing demo → https://sclaw-studio-82lp.vercel.app/

  • Docs site → https://sclaw-backend.vercel.app/

  • Dev oracle + studio deploy backend — Railway, EIP-712 signed proofs, bearer-token auth


0G Integration

Layer

Integration

0G Compute Router

sealed0GInference — every InferenceResult carries a typed Attestation envelope with tee_verified: true and the provider address

0G Storage Log

Encrypted sovereign memory (OG_Log) and the multi-agent mesh's event bus

0G EVM Chain

AgentNFT + MemoryRevocation — all writes are real on-chain txs on Galileo

ERC-7857 iNFT

mintAgentNFT / transferWithReencryption / revokeMemory helpers; oracle proofs in EIP-712


The Differentiator: Revocation That Actually Fires

Sovereignty without revocation is theater.

revokeMemory() zeroes the on-chain wrapped DEK, marks the MemoryRevocation registry, and the oracle refuses any future re-encryption — measured end-to-end at 1.5 seconds, well under our 5-second target. Chainscan-verifiable.

Honest about what it can't do: immutable ciphertext stays on 0G Storage forever; an already-decrypted session can't be recalled. Fully documented in docs/security.md's L1–L12 production-gap ledger.


Try It in Under 10 Minutes

git clone https://github.com/irajgill/sclaw.git
cd sclaw && cp .env.example .env   # fill PRIVATE_KEY + COMPUTE_ROUTER_API_KEY
pnpm install
cd examples/research-claw && pnpm dev

Output includes:

  • A TEE-verified inference result

  • A self-critique with a learning pointer

  • Four encrypted 0G Storage writes

  • A chainscan URL for your freshly-minted ResearchClaw iNFT

Prefer no CLI? Drag-build a 3-agent swarm at sovereignclaw-studio.vercel.app and click Deploy — three real iNFTs land on chainscan-galileo in ~60 seconds.

Progress During Hackathon

<h1>Build Journey</h1><p>ZeroForge was built in 10 sequenced phases, each ending in a verifiable Definition-of-Done artifact.</p><hr><h2>Phase 0 — Project Scaffolding</h2><p>pnpm monorepo + Turbo + Foundry. CI green from day one.</p><h2>Phase 1 — Core Primitives</h2><p><code data-inline="true" spellcheck="false">@sovereignclaw/memory</code> + <code data-inline="true" spellcheck="false">@sovereignclaw/core</code>. AES-256-GCM with HKDF-SHA-256 KEK derivation from wallet signatures. <code data-inline="true" spellcheck="false">OG_Log</code> provider backed by 0G Storage Log; <code data-inline="true" spellcheck="false">InMemory</code> for tests.</p><h2>Phase 2 — Smart Contracts</h2><p><code data-inline="true" spellcheck="false">AgentNFT.sol</code> (ERC-7857) + <code data-inline="true" spellcheck="false">MemoryRevocation.sol</code>. 77 Foundry tests across 7 suites including invariants × 128k handler calls per property. Deployed to 0G Galileo at <code data-inline="true" spellcheck="false">0xc3f99...0601</code> and <code data-inline="true" spellcheck="false">0x73508...b6AC</code>. Gas snapshot committed.</p><h2>Phase 3 — iNFT Lifecycle</h2><p><code data-inline="true" spellcheck="false">@sovereignclaw/inft</code> with <code data-inline="true" spellcheck="false">mint</code> / <code data-inline="true" spellcheck="false">transferWithReencryption</code> / <code data-inline="true" spellcheck="false">revoke</code> / <code data-inline="true" spellcheck="false">recordUsage</code>. EIP-712 byte-equality between on-chain <code data-inline="true" spellcheck="false">_verifyOracleProof</code> and off-chain <code data-inline="true" spellcheck="false">digestForOracleProof</code> enforced by a Foundry-emitted fixture both sides re-derive. Dev oracle (<code data-inline="true" spellcheck="false">apps/backend</code>, Hono) deployed to Railway with bearer-token auth. Full mint → transfer → revoke example shipped.</p><h2>Phase 4 — ResearchForge Example</h2><p>~120 LoC. Reproducible clone-to-iNFT path under 10 minutes. <code data-inline="true" spellcheck="false">pnpm benchmark:cold-start</code> measures wall time end-to-end <em>(current: ~85s)</em>.</p><h2>Phase 5 — Multi-Agent Mesh</h2><p><code data-inline="true" spellcheck="false">@sovereignclaw/mesh</code> over the 0G Log bus. <code data-inline="true" spellcheck="false">planExecuteCritique</code> pattern with typed events. 3-agent research-mesh example: 6 encrypted bus events on-log, all with chainscan-verifiable storage roots.</p><h2>Phase 6 — Reflection Loops</h2><p><code data-inline="true" spellcheck="false">@sovereignclaw/reflection</code>. <code data-inline="true" spellcheck="false">reflectOnOutput()</code> with 4 built-in rubrics + custom rubric support. Learnings persisted as <code data-inline="true" spellcheck="false">learning:&lt;runId&gt;</code>, queryable via <code data-inline="true" spellcheck="false">listRecentLearnings</code>. ResearchForge wired with reflect on every run.</p><h2>Phase 7 — ZeroForge Studio</h2><p><code data-inline="true" spellcheck="false">packages/studio</code> — Next.js drag-and-drop builder with 6 node types, pure-function codegen, Monaco live preview. <code data-inline="true" spellcheck="false">/studio/deploy</code> and <code data-inline="true" spellcheck="false">/studio/status/:id</code> added to backend: esbuild-validates generated code, writes manifest to 0G Storage, mints one iNFT per agent. <code data-inline="true" spellcheck="false">pnpm smoke:studio</code> deploys the seed 3-agent swarm in ~60s.</p><h2>Phase 8 — Documentation</h2><p>Per-package READMEs (install + 10-line quickstart + API table + errors table). <code data-inline="true" spellcheck="false">docs/architecture.md</code> with layered diagram and data flows. <code data-inline="true" spellcheck="false">docs/benchmarks.md</code> with five reproducible scripts (LoC, inference RTT, revoke latency, mesh throughput, cold start). Raw JSON committed under <code data-inline="true" spellcheck="false">scripts/.benchmarks/</code>.</p><h2>Phase 9 — Hardening</h2><p><code data-inline="true" spellcheck="false">revokeMemory</code> phase instrumentation (<code data-inline="true" spellcheck="false">onPhase</code> hook + <code data-inline="true" spellcheck="false">timings</code> result): oracle-side refuse now measured at <strong>1.5s</strong>, beating the 5s target. Studio wallet-connect with EIP-712 deploy auth. Server-side codegen echo diff rejects tampered client source before gas. Custom reflection rubrics in the inspector. <code data-inline="true" spellcheck="false">docs/security.md</code> upgraded to audit-grade (attacker-capability threat model + L1–L12 production-gap ledger). CI LoC gate added.</p><h2>Phase 10 — Public Release </h2><p>Five <code data-inline="true" spellcheck="false">@sovereignclaw/*</code> packages published to npm. Production oracle + studio backend live on Railway. Light + playful UI re-skin across studio builder, landing demo, and docs site. Five Mermaid architecture diagrams added to the root README. All in-app references repointed to <code data-inline="true" spellcheck="false">github.com/irajgill/sclaw</code>.</p><hr><h2>Final Tally</h2><table style="min-width: 50px"><colgroup><col style="min-width: 25px"><col style="min-width: 25px"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Artifact</p></th><th colspan="1" rowspan="1"><p>Count</p></th></tr><tr><td colspan="1" rowspan="1"><p>npm packages</p></td><td colspan="1" rowspan="1"><p>5</p></td></tr><tr><td colspan="1" rowspan="1"><p>Contracts on-chain</p></td><td colspan="1" rowspan="1"><p>2</p></td></tr><tr><td colspan="1" rowspan="1"><p>Production services</p></td><td colspan="1" rowspan="1"><p>2</p></td></tr><tr><td colspan="1" rowspan="1"><p>Working examples</p></td><td colspan="1" rowspan="1"><p>4</p></td></tr><tr><td colspan="1" rowspan="1"><p>Foundry tests</p></td><td colspan="1" rowspan="1"><p>77</p></td></tr><tr><td colspan="1" rowspan="1"><p>Vitest unit tests</p></td><td colspan="1" rowspan="1"><p>123</p></td></tr><tr><td colspan="1" rowspan="1"><p>Reproducible benchmarks</p></td><td colspan="1" rowspan="1"><p>5</p></td></tr></tbody></table><p></p>

Tech Stack

NextReactWeb3EthersSolidityNode

Fundraising Status

<h3>Fundraising Status</h3><p>Not currently raising. ZeroForge is open-source under Apache 2.0 — the framework and all examples are free for any 0G developer to use, fork, or build on top of.</p><p>We are open to:</p><ol><li><p><strong>0G Foundation ecosystem grants</strong> — to fund an external audit of <code data-inline="true" spellcheck="false">AgentNFT.sol</code> + <code data-inline="true" spellcheck="false">MemoryRevocation.sol</code> (Foundry tests already cover happy path, fuzz, and invariants; an independent review would unblock mainnet deployment)</p></li><li><p><strong>Infrastructure-focused funds and angels</strong> who back open-source agent / on-chain AI tooling</p></li></ol><p>No SAFE. No token. No presale. The framework is the product; the iNFTs minted by users are theirs, not ours.</p><p><strong>Contact:</strong> <a href="https://github.com/irajgill/sclaw">github.com/irajgill/sclaw</a> — issues, PRs, or the responsible-disclosure path in <code data-inline="true" spellcheck="false">docs/security.md</code></p>

Team Leader
Ttalha Ansari
GitHub Link
github

GitHub

https://github.com/irajgill/sclaw
Product Category
AINFTInfra