Skip to content

Hebx/proof0g

Repository files navigation

Proof0G — portable proof pages for 0G-native AI apps

One public URL bundles a typed manifest, a 0G Galileo chain anchor, a 0G Storage receipt, and a 0G Compute summary.

builder -> ProofPack manifest -> 0G Storage root
        -> ProofPackRegistry anchor -> 0G Compute summary
        -> /p/<packId> verifier page

Why this exists

  • One URL replaces a scattered README, a loose tx hash, a storage link, and a model output screenshot.
  • 0G-native: chain anchor + storage receipt + compute attestation live in a single typed manifest.

The loop

create -> store -> anchor -> summarize -> verify

create: the app builds a ProofPack manifest with project metadata, creator wallet, artifact records, and verification fields.

store: the manifest and supporting artifacts are uploaded to 0G Storage and tracked by rootHash.

anchor: ProofPackRegistry commits the project name, proof type, storage root, manifest hash, repo URL, demo URL, and metadata URI on Galileo.

summarize: 0G Compute Router reads the proof pack and returns strict JSON for reviewers.

verify: the proof page shows the manifest, checklist, chain tx, storage root, compute summary, and badge markdown.

Live

Demo URL: https://proof0g-web.vercel.app

Latest live self-pack:

Field Value
Pack ID 0x289c4700aad7b704c3a61dd89fa6b5a2d27a76de81de2045a1168e4080c7fb87
Manifest hash 0x6f4dcf351d9200151431ed374e36ada98172a945b8dd0bf7e81511156ba7c150
Storage rootHash 0x636e7171b09e0493b2d3767fe3c1d02897ddce9fe99f9e22e728cc4144f80d9d
Chain tx 0x53081036f4b0773dc7998001f30e4347a35332702c5b634c768fe64a06b0af23
Compute summary verified

Reference note: if your local run still points to http://localhost:3000/p/..., set NEXT_PUBLIC_APP_URL to the deployed host and rerun pnpm demo:proof0g --live to regenerate docs/public/SELF-PACK.md with public links.

Production status

  • App: https://proof0g-web.vercel.app
  • Reference proof page: https://proof0g-web.vercel.app/p/0x289c4700aad7b704c3a61dd89fa6b5a2d27a76de81de2045a1168e4080c7fb87
  • Registry contract: 0x0a0aa37bf5ffe9d758ad66feff7c3bfa07ea8438
  • Reference transaction: https://chainscan-galileo.0g.ai/tx/0x53081036f4b0773dc7998001f30e4347a35332702c5b634c768fe64a06b0af23

0G facts

Item Value
Network 0G Galileo Testnet
chainId 16602
RPC https://evmrpc-testnet.0g.ai
Explorer https://chainscan-galileo.0g.ai
Faucet https://faucet.0g.ai
Compute router base https://router-api-testnet.integratenetwork.work/v1

API key (testnet): Use the official 0G Compute Router docs: open the PC dashboard (pc.testnet.0g.ai), connect a wallet, fund with testnet OG, then create an API key. Default model on this router’s catalog is qwen/qwen-2.5-7b-instruct (set ZERO_G_COMPUTE_MODEL); re-check with GET /v1/models if calls fail. For storage on testnet turbo indexer, set ZERO_G_STORAGE_INDEXER_RPC=https://indexer-storage-testnet-turbo.0g.ai.

Further reading: Project overview · 0G MVP integration brief

Quickstart

Mock mode needs no secrets.

pnpm install
pnpm dev
# open http://localhost:3000 -> /create -> submit

Run the end-to-end demo pack locally:

pnpm demo:proof0g

The script prints the seven-step trace and writes a commit-safe public subset to docs/public/SELF-PACK.md.

Live mode

Copy .env.example to apps/web/.env.local, then fill the required names for the deployed environment.

Required env names:

  • NEXT_PUBLIC_APP_URL
  • NEXT_PUBLIC_CHAIN_ID
  • NEXT_PUBLIC_PROOF_REGISTRY_ADDRESS
  • PRIVATE_KEY
  • ZERO_G_RPC_URL
  • ZERO_G_EXPLORER_URL
  • ZERO_G_COMPUTE_BASE_URL
  • ZERO_G_COMPUTE_API_KEY
  • ZERO_G_COMPUTE_MODEL
  • ZERO_G_STORAGE_INDEXER_RPC
  • ZERO_G_STORAGE_MODE

Deploying the registry is intentionally explicit:

PRIVATE_KEY=... ZERO_G_RPC_URL=... scripts/deploy-galileo.sh

The wrapper refuses non-16602 RPCs, builds the contracts package first, prints the registry address and explorer URL, and writes the address to a local-only file.

Run the live self-proof only after the registry address and 0G services are configured:

pnpm demo:proof0g --live

Architecture

  • apps/web: Next.js App Router proof creation and proof page surfaces.
  • packages/proofpack: Zod schema, canonical JSON, manifest hash, validation, and checklist rules.
  • packages/zero-g: storage, chain, and compute adapters with mock and live modes.
  • packages/contracts: ProofPackRegistry.sol, Hardhat 3, viem tests, and Galileo deploy script.
  • packages/ui: shared UI primitives.

Registry contract

ProofPackRegistry.createProofPack accepts projectName, proofType, storageRoot, manifestHash, repoUrl, demoUrl, and metadataURI. The live chain adapter waits for ProofPackCreated(bytes32 packId, address creator, ...) and extracts packId from the receipt event.

Verification checks

Required v0:

  • project_name_present
  • repo_url_present
  • demo_url_present
  • contract_address_valid
  • explorer_url_present
  • storage_root_present
  • manifest_hash_valid
  • chain_anchor_present
  • creator_wallet_present

Strong v0:

  • manifest_hash_matches_uploaded_manifest
  • registry_pack_matches_manifest
  • storage_download_success
  • summary_generated_by_compute

Embeddable badge

[![Proof0G verified](https://proof0g-web.vercel.app/badge/<packId>.svg)](https://proof0g-web.vercel.app/p/<packId>)

The badge is meant to make a verified proof page portable into any README or project documentation.

Reproduce the self-Proof0G demo

pnpm demo:proof0g
pnpm demo:proof0g --live

The mock variant uses deterministic no-op adapters and runs without secrets. The live variant refuses to start unless the required write, compute, storage, and registry env names are present.

License: MIT.

Checks

pnpm install
pnpm test
pnpm build
pnpm demo:proof0g

About

Portable proof pages for 0G-native AI apps — create Proof Packs, store artifacts on 0G Storage, anchor hashes on 0G Chain, and summarize verification with 0G Compute.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors