hackquest logo

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.

視頻

專案圖片 1
專案圖片 2
專案圖片 3
專案圖片 4

技術堆疊

Next
React
Web3
Ethers
Solidity
Node

描述

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


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.

黑客松進展

Build Journey

ZeroForge was built in 10 sequenced phases, each ending in a verifiable Definition-of-Done artifact.


Phase 0 — Project Scaffolding

pnpm monorepo + Turbo + Foundry. CI green from day one.

Phase 1 — Core Primitives

@sovereignclaw/memory + @sovereignclaw/core. AES-256-GCM with HKDF-SHA-256 KEK derivation from wallet signatures. OG_Log provider backed by 0G Storage Log; InMemory for tests.

Phase 2 — Smart Contracts

AgentNFT.sol (ERC-7857) + MemoryRevocation.sol. 77 Foundry tests across 7 suites including invariants × 128k handler calls per property. Deployed to 0G Galileo at 0xc3f99...0601 and 0x73508...b6AC. Gas snapshot committed.

Phase 3 — iNFT Lifecycle

@sovereignclaw/inft with mint / transferWithReencryption / revoke / recordUsage. EIP-712 byte-equality between on-chain _verifyOracleProof and off-chain digestForOracleProof enforced by a Foundry-emitted fixture both sides re-derive. Dev oracle (apps/backend, Hono) deployed to Railway with bearer-token auth. Full mint → transfer → revoke example shipped.

Phase 4 — ResearchForge Example

~120 LoC. Reproducible clone-to-iNFT path under 10 minutes. pnpm benchmark:cold-start measures wall time end-to-end (current: ~85s).

Phase 5 — Multi-Agent Mesh

@sovereignclaw/mesh over the 0G Log bus. planExecuteCritique pattern with typed events. 3-agent research-mesh example: 6 encrypted bus events on-log, all with chainscan-verifiable storage roots.

Phase 6 — Reflection Loops

@sovereignclaw/reflection. reflectOnOutput() with 4 built-in rubrics + custom rubric support. Learnings persisted as learning:<runId>, queryable via listRecentLearnings. ResearchForge wired with reflect on every run.

Phase 7 — ZeroForge Studio

packages/studio — Next.js drag-and-drop builder with 6 node types, pure-function codegen, Monaco live preview. /studio/deploy and /studio/status/:id added to backend: esbuild-validates generated code, writes manifest to 0G Storage, mints one iNFT per agent. pnpm smoke:studio deploys the seed 3-agent swarm in ~60s.

Phase 8 — Documentation

Per-package READMEs (install + 10-line quickstart + API table + errors table). docs/architecture.md with layered diagram and data flows. docs/benchmarks.md with five reproducible scripts (LoC, inference RTT, revoke latency, mesh throughput, cold start). Raw JSON committed under scripts/.benchmarks/.

Phase 9 — Hardening

revokeMemory phase instrumentation (onPhase hook + timings result): oracle-side refuse now measured at 1.5s, 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. docs/security.md upgraded to audit-grade (attacker-capability threat model + L1–L12 production-gap ledger). CI LoC gate added.

Phase 10 — Public Release

Five @sovereignclaw/* 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 github.com/irajgill/sclaw.


Final Tally

Artifact

Count

npm packages

5

Contracts on-chain

2

Production services

2

Working examples

4

Foundry tests

77

Vitest unit tests

123

Reproducible benchmarks

5

籌資狀態

Fundraising Status

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.

We are open to:

  1. 0G Foundation ecosystem grants — to fund an external audit of AgentNFT.sol + MemoryRevocation.sol (Foundry tests already cover happy path, fuzz, and invariants; an independent review would unblock mainnet deployment)

  2. Infrastructure-focused funds and angels who back open-source agent / on-chain AI tooling

No SAFE. No token. No presale. The framework is the product; the iNFTs minted by users are theirs, not ours.

Contact: github.com/irajgill/sclaw — issues, PRs, or the responsible-disclosure path in docs/security.md

團隊負責人
TTalha Ansari
專案連結
部署生態系
0G-Galileo-Testnet0G-Galileo-Testnet
行業
AINFTInfra