Website: 0gkit.com · Docs: docs.0gkit.com · Playground: playground.0gkit.com
0gkit is the fastest way to build on the 0G network —
Storage, Compute (inference), Data Availability, TEE Attestation, and chain
helpers — as 18 small, independently-installable npm packages, plus a 0g
CLI, an MCP server for AI agents, and React hooks.
It is neutral and standalone: no package depends on any application framework or protocol. Install only what you need.
Packages publish under the
@foundryprotocol/0gkit-*npm scope. The code is protocol-neutral; the scope is just the publishing org. The CLI binary is0g.
npm create 0gkit-app@latest my-app
cd my-app
0g dev # in another terminal — starts the local devnet
npm run devThat is the whole thing. create-0gkit-app clones a template, writes a
network-aware .env.example, runs install, and git inits — so the only
thing left for you is cd + run.
Five templates ship today: storage-app, inference-app,
attestation-verify, mcp-agent, react-app. Pick one with
--template <name> or interactively at the prompt.
# One primitive at a time — install only what you use
npm i @foundryprotocol/0gkit-storage # upload / download / Merkle root
npm i @foundryprotocol/0gkit-compute # provider discovery + inference
npm i @foundryprotocol/0gkit-da # data availability publish / verify
npm i @foundryprotocol/0gkit-attestation
npm i @foundryprotocol/0gkit-chain # explorer URLs, balance, receipts, faucet
npm i @foundryprotocol/0gkit-contracts # typed contract clients + Foundry codegen
# The CLI — zero install
npx @foundryprotocol/0gkit-cli init
npx @foundryprotocol/0gkit-cli doctor
# React hooks
npm i @foundryprotocol/0gkit-reactimport { fromEnv } from "@foundryprotocol/0gkit-wallet";
import { Storage } from "@foundryprotocol/0gkit-storage";
// fromEnv() auto-picks: KMS_KEY_ID > KEY_FILE+KEY_PASSWORD > PRIVATE_KEY
const signer = await fromEnv();
const storage = new Storage({ network: "galileo", signer });
const { root, tx } = await storage.upload(new TextEncoder().encode("gm"));
const bytes = await storage.download(root);
// "What will this cost?" — every primitive answers, every write supports dry-run
const est = await storage.estimate(new TextEncoder().encode("gm"));
const dryRun = await storage.upload(new TextEncoder().encode("gm"), { dryRun: true });# Or from the CLI
0g estimate storage ./README.md
0g storage put ./README.md --dry-run| Package | What it does |
|---|---|
@foundryprotocol/0gkit-core |
Network presets, viem client factory, Receipt, ZeroGError taxonomy. The shared base. |
@foundryprotocol/0gkit-chain |
Explorer URLs, balance, waitForReceipt, testnet faucet. |
@foundryprotocol/0gkit-storage |
upload / download / computeRoot / exists. |
@foundryprotocol/0gkit-compute |
Provider discovery, broker inference, OpenAI-compatible shim. |
@foundryprotocol/0gkit-da |
Data Availability publish + verify (canonical digest). |
@foundryprotocol/0gkit-attestation |
TEE attestation parse / sign / recover / verify / report. |
@foundryprotocol/0gkit-contracts |
Typed contract clients — 5 standard 0G contracts + forge build → typed TS codegen. |
@foundryprotocol/0gkit-testing |
Vitest mocks, fixtures, testWallet, setupLocalDevnet, four 0G-aware matchers. |
@foundryprotocol/0gkit-indexer |
Reorg-safe event subscriptions on 0G (memory/sqlite/redis cursors). |
@foundryprotocol/0gkit-wallet |
Node wallet loaders: fromPrivateKey, fromFile, fromEnv, fromKMS, SIWE. |
@foundryprotocol/0gkit-wallet-react |
React + wagmi v2: ZeroGWalletProvider, useWallet, useConnect, useSwitchNetwork. |
@foundryprotocol/0gkit-cli |
The 0g command line — init, doctor, chain, storage, infer, da, attest, contracts, estimate. |
@foundryprotocol/0gkit-mcp |
Every primitive as an MCP tool for Claude / Cursor / Cline / any agent. |
@foundryprotocol/0gkit-react |
useUpload / useDownload / useInference / useAttestation / useEvent / useLogs. |
Full documentation — every package explained in detail, with examples and guidance on what / when / where to use each — lives in the docs site:
pnpm --filter @foundryprotocol/0gkit-docs dev # http://localhost:3000It is also deployable to Vercel from apps/docs.
Ready-to-clone starter projects under templates/:
| Template | Use case |
|---|---|
storage-app |
Upload + download a file, print the Merkle root + tx receipt |
inference-app |
Discover a provider and run an OpenAI-compatible chat completion |
attestation-verify |
Parse + verify a TEE attestation report (pure crypto) |
mcp-agent |
Wire @foundryprotocol/0gkit-mcp into an agent runtime |
react-app |
Next.js app using the React hooks |
packages/0gkit-* the published library packages
apps/playground zero-setup web console (private)
apps/docs the documentation site (private, Vercel-deployable)
templates/ degit-able starter projects
See CONTRIBUTING.md. Every change to a published package
needs a changeset (pnpm changeset). CI must be green.
MIT — see LICENSE.