Welcome! If you are evaluating Gochi for the HackQuest 0G APAC Hackathon 2026, here is everything you need immediately:
| π Live App | gochi.edycu.dev |
| π Pitch Deck | gochi.edycu.dev/pitch |
| π¬ Demo Video | YouTube |
| π Contract | 0x9BDA4...8cf on 0G Galileo |
| ποΈ Architecture | docs/ARCHITECTURE.md |
To test in 60 seconds:
- Go to gochi.edycu.dev and click HATCH YOUR GOCHI
- Connect MetaMask β the app auto-switches to 0G Galileo Testnet (Chain ID: 16602)
- Mint your Gochi INFT, then feed, play, and chat with it
- Every action writes to 0G Storage KV (<50ms) and archives to 0G Storage Log (Merkle proof)
Landing β glitch hero, 0G stats, sponsor strip |
BORN ON 0G CHAIN β hatching after mint tx confirmed on-chain |
Feed β hunger stat written to 0G Storage KV |
Play β mood increases, memory archived to 0G Log |
Sleep β energy restored, Merkle root stored |
When Tamagotchi servers shut down in 2023, millions of virtual pets were erased overnight. Every Web2 pet is one server outage away from extinction.
What if a virtual pet's existence was cryptographically guaranteed?
Gochi is a Tamagotchi-inspired AI pet that lives entirely on the 0G modular stack:
| Layer | Technology | Why It Matters |
|---|---|---|
| Identity | ERC-721 INFT on 0G Chain | The pet owns a unique on-chain identity β provably yours |
| Reflexes | 0G Storage KV | Hunger, mood, energy update in <50ms β the pet feels alive |
| Memory | 0G Storage Log + Merkle proofs | Every moment is permanently archived and verifiable |
| Soul | 0G Compute Router (TEE) | AI personality β cryptographically proven to be authentic |
Take 0G out and you'd need Redis + IPFS + Arweave + OpenAI + Ethereum: four SDKs, four billing accounts, zero unified verification. With 0G it's one SDK, one token, four capabilities.
See full architecture with Mermaid diagrams, code samples, and API reference: docs/ARCHITECTURE.md
Browser β Wallet (wagmi/viem) β 0G Chain ERC-721 mint
β Next.js API /kv/write β 0G Storage KV pet state (<50ms)
β Next.js API /log/archive β 0G Storage Log Merkle memory
β Next.js API /chat β 0G Compute TEE-verified AI
β Next.js API /metadata β Dynamic ERC-721 metadata + SVG
All 0G operations fall back to Supabase when the testnet node is unavailable, so the demo is always live.
src/lib/zero-g.ts β 0G SDK wrapper (kvRead, kvWrite, logUpload)
src/lib/supabase.ts β Supabase fallback client
src/app/api/kv/ β Pet state read/write
src/app/api/log/ β Memory archive + retrieval
src/app/api/chat/ β AI personality (0G Compute / OpenAI)
src/app/api/metadata/ β ERC-721 tokenURI + dynamic SVG image
src/components/MintFlow.tsx β Mint / Resume INFT flow
src/components/PetViewport.tsx β Animated ghost pet UI
contracts/Gochi.sol β ERC-721 INFT contract
| # | 0G Component | Gochi Usage | Integration Method |
|---|---|---|---|
| 1 | 0G Chain | INFT identity (ERC-721) | Solidity contract, Hardhat deploy, wagmi writeContractAsync |
| 2 | 0G Storage KV | Real-time pet state | Batcher.streamDataBuilder.set() + KvClient.getValue() |
| 3 | 0G Storage Log | Permanent memory archive | Indexer.upload(MemData) β Merkle root returned + stored |
| 4 | 0G Compute | AI personality | Compute Router /v1/chat/completions β ZG-Res-Key TEE verification |
1. Dual-Layer Storage β No other protocol gives you KV + Log in one SDK. KV keeps the pet alive (real-time state); Log keeps it immortal (permanent memories). Without 0G you'd need two separate systems, two SDKs, two billing accounts.
2. Verified AI β 0G Compute's TEE signing (ZG-Res-Key header) provides cryptographic proof that the pet's responses came from a genuine compute environment β impossible with centralized providers.
3. Ecosystem Cohesion β One private key signs INFT mints, KV writes, Log uploads, and Compute payments. All visible in one explorer ecosystem (ChainScan + StorageScan).
- Node.js β₯ 20, npm
- MetaMask with 0G Galileo Testnet configured (Chain ID: 16602)
- Testnet tokens from the 0G Faucet
git clone https://github.com/edycutjong/gochi.git
cd gochi
npm install
cp .env.example .env.local| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_CONTRACT_ADDRESS |
β | Deployed Gochi.sol address |
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID |
β | cloud.walletconnect.com |
NEXT_PUBLIC_SUPABASE_URL |
β | Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
β | Supabase anon key |
SUPABASE_SERVICE_ROLE_KEY |
β | Supabase service role (server-only) |
PRIVATE_KEY |
β | Burner wallet for 0G Storage writes |
INDEXER_RPC |
β | https://indexer-storage-turbo-testnet.0g.ai |
KV_NODE_URL |
β | 0G KV node endpoint |
FLOW_CONTRACT_ADDRESS |
β | 0G FixedPriceFlow contract |
NEXT_PUBLIC_RPC_URL |
β | https://evmrpc-testnet.0g.ai |
OPENAI_API_KEY |
πΆ | Fallback AI (when ROUTER_API_KEY not set) |
ROUTER_API_KEY |
πΆ | 0G Compute Router key from pc.0g.ai |
npm run dev # http://localhost:3000npx hardhat run scripts/deploy.ts --network zero-g-galileo
# Update NEXT_PUBLIC_CONTRACT_ADDRESS in .env.local + Vercelnpm run lint # ESLint
npm run typecheck # tsc --noEmit
npm run test # Jest unit tests
npm run test:coverage # Coverage report
npm run ci # Full pipeline| Proof | Link |
|---|---|
| INFT Contract | chainscan-galileo.0g.ai/address/0x9BDA4...8cf |
| Mint Transaction | chainscan-galileo.0g.ai/tx/0x5213...6c77 |
| NFT Metadata | gochi.edycu.dev/api/metadata/1 |
| NFT Image | gochi.edycu.dev/api/metadata/1/image |
MIT Β© 2026 Edy Cu
Built for HackQuest 0G APAC Hackathon 2026
Powered by 0G Network Β· Hosted on Vercel Β· Fallback by Supabase









