{"id":50745521,"url":"https://github.com/edycutjong/gochi","last_synced_at":"2026-06-10T20:30:35.764Z","repository":{"id":358217213,"uuid":"1240454477","full_name":"edycutjong/gochi","owner":"edycutjong","description":"🐾 On-chain AI virtual pet on 0G Network. Built for HackQuest 0G APAC 2026.","archived":false,"fork":false,"pushed_at":"2026-05-16T09:28:50.000Z","size":4930,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T10:42:57.877Z","etag":null,"topics":["0g-network","ai","dapps","hackathon","inft","nextjs","react","smart-contracts","solidity","virtual-pet","wagmi","web3"],"latest_commit_sha":null,"homepage":"https://gochi.edycu.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edycutjong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-16T06:35:21.000Z","updated_at":"2026-05-16T09:28:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/edycutjong/gochi","commit_stats":null,"previous_names":["edycutjong/gochi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/edycutjong/gochi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fgochi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fgochi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fgochi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fgochi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edycutjong","download_url":"https://codeload.github.com/edycutjong/gochi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fgochi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34170162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0g-network","ai","dapps","hackathon","inft","nextjs","react","smart-contracts","solidity","virtual-pet","wagmi","web3"],"created_at":"2026-06-10T20:30:35.022Z","updated_at":"2026-06-10T20:30:35.756Z","avatar_url":"https://github.com/edycutjong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🧑‍⚖️ For Judges (Quick Start)\n\nWelcome! If you are evaluating Gochi for the **HackQuest 0G APAC Hackathon 2026**, here is everything you need immediately:\n\n| | |\n|---|---|\n| 🚀 **Live App** | [gochi.edycu.dev](https://gochi.edycu.dev) |\n| 📊 **Pitch Deck** | [gochi.edycu.dev/pitch](https://gochi.edycu.dev/pitch/index.html) |\n| 🎬 **Demo Video** | [YouTube](https://youtu.be/IEQkZUbJdmo) |\n| 📜 **Contract** | [`0x9BDA4...8cf`](https://chainscan-galileo.0g.ai/address/0x9BDA4cBfda7a7960251A4EE07A7ec0C00239a8cf) on 0G Galileo |\n| 🏗️ **Architecture** | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) |\n\n**To test in 60 seconds:**\n1. Go to [gochi.edycu.dev](https://gochi.edycu.dev) and click **HATCH YOUR GOCHI**\n2. Connect MetaMask — the app auto-switches to **0G Galileo Testnet** (Chain ID: 16602)\n3. Mint your Gochi INFT, then feed, play, and chat with it\n4. Every action writes to **0G Storage KV** (\u003c50ms) and archives to **0G Storage Log** (Merkle proof)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eGochi\u003c/h1\u003e\n  \u003cp\u003e\u003cstrong\u003eThe On-Chain AI Virtual Pet — Powered by 0G Network\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003e\u003cem\u003eIt cannot be deleted. It cannot be shut down.\u003c/em\u003e\u003c/p\u003e\n\n  \u003cbr/\u003e\n\n  [![Live Demo](https://img.shields.io/badge/🚀_Live-gochi.edycu.dev-06b6d4?style=for-the-badge)](https://gochi.edycu.dev)\n  [![Pitch Deck](https://img.shields.io/badge/📊_Pitch-Deck-f59e0b?style=for-the-badge)](https://gochi.edycu.dev/pitch/index.html)\n  [![Contract](https://img.shields.io/badge/📜_Contract-0G_Galileo-22c55e?style=for-the-badge)](https://chainscan-galileo.0g.ai/address/0x9BDA4cBfda7a7960251A4EE07A7ec0C00239a8cf)\n  [![Built for HackQuest](https://img.shields.io/badge/HackQuest-0G_APAC_2026-8b5cf6?style=for-the-badge)](https://www.hackquest.io/hackathons/0G-APAC-Hackathon)\n\n  \u003cbr/\u003e\n\n  ![Next.js](https://img.shields.io/badge/Next.js_16-black?style=flat\u0026logo=next.js)\n  ![React](https://img.shields.io/badge/React_19-20232A?style=flat\u0026logo=react\u0026logoColor=61DAFB)\n  ![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=flat\u0026logo=typescript\u0026logoColor=white)\n  ![Tailwind](https://img.shields.io/badge/Tailwind_v4-38B2AC?style=flat\u0026logo=tailwindcss\u0026logoColor=white)\n  ![Solidity](https://img.shields.io/badge/Solidity-363636?style=flat\u0026logo=solidity\u0026logoColor=white)\n  ![Supabase](https://img.shields.io/badge/Supabase-3ECF8E?style=flat\u0026logo=supabase\u0026logoColor=white)\n  [![CI](https://github.com/edycutjong/gochi/actions/workflows/ci.yml/badge.svg)](https://github.com/edycutjong/gochi/actions/workflows/ci.yml)\n\n  \u003cbr/\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/f11dbf0d-1967-4efa-a86d-75e15c2ac3d7\" alt=\"Gochi — On-Chain AI Pet\" width=\"100%\"\u003e\n\n\u003c/div\u003e\n\n---\n\n## 📸 Screenshots\n\n### Landing \u0026 Birth\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/4f5de9fe-e1e3-4648-bed8-bee8b733e409\" alt=\"Landing page\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003eLanding — glitch hero, 0G stats, sponsor strip\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/93e5539e-6b1c-4af8-b957-1f959babf9b8\" alt=\"Born on 0G Chain\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003eBORN ON 0G CHAIN — hatching after mint tx confirmed on-chain\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Gameplay — Feed · Play · Sleep\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/250fbe52-f129-4053-a267-59698e222d7c\" alt=\"Feed\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003eFeed — hunger stat written to 0G Storage KV\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/04994d87-b541-49b6-beee-da824c64951d\" alt=\"Play\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003ePlay — mood increases, memory archived to 0G Log\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"33%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/099aceae-52f7-41b4-a96b-9dec61826bfd\" alt=\"Sleep\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003eSleep — energy restored, Merkle root stored\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### AI Chat \u0026 Core Memories\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/a38c044a-1a58-49fd-b6aa-36461abd4d64\" alt=\"Chat 1\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003e0G Compute responds in character — stat-aware personality\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/148c03a8-18ae-456f-b8e7-567cd785efac\" alt=\"Chat 2\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003eGochi references past interactions from memory context\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/8613e3cc-83c4-46b4-954e-c941deb60085\" alt=\"Chat 3\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003ePersonality shifts with stats — grumpy when hungry, playful when happy\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/259098f1-d45f-478d-992b-a07fad2e538f\" alt=\"Core Memories\" width=\"100%\"/\u003e\n      \u003cp align=\"center\"\u003e\u003csub\u003eCore Memories — Merkle roots + StorageScan links, permanently archived\u003c/sub\u003e\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 💡 The Problem\n\nWhen Tamagotchi servers shut down in 2023, millions of virtual pets were erased overnight. Every Web2 pet is one server outage away from extinction.\n\n**What if a virtual pet's existence was cryptographically guaranteed?**\n\n---\n\n## 🐾 What Gochi Does\n\nGochi is a Tamagotchi-inspired AI pet that lives **entirely on the 0G modular stack**:\n\n| Layer | Technology | Why It Matters |\n|---|---|---|\n| **Identity** | ERC-721 INFT on 0G Chain | The pet owns a unique on-chain identity — provably yours |\n| **Reflexes** | 0G Storage KV | Hunger, mood, energy update in \u003c50ms — the pet feels alive |\n| **Memory** | 0G Storage Log + Merkle proofs | Every moment is permanently archived and verifiable |\n| **Soul** | 0G Compute Router (TEE) | AI personality — cryptographically proven to be authentic |\n\nTake 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**.\n\n---\n\n## 🏗️ Architecture\n\nSee full architecture with Mermaid diagrams, code samples, and API reference: **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**\n\n### High-Level Flow\n\n```\nBrowser → Wallet (wagmi/viem)     → 0G Chain        ERC-721 mint\n        → Next.js API /kv/write   → 0G Storage KV   pet state (\u003c50ms)\n        → Next.js API /log/archive → 0G Storage Log  Merkle memory\n        → Next.js API /chat        → 0G Compute      TEE-verified AI\n        → Next.js API /metadata    → Dynamic ERC-721 metadata + SVG\n```\n\nAll 0G operations fall back to Supabase when the testnet node is unavailable, so the demo is always live.\n\n### Key Files\n\n```\nsrc/lib/zero-g.ts            — 0G SDK wrapper (kvRead, kvWrite, logUpload)\nsrc/lib/supabase.ts          — Supabase fallback client\nsrc/app/api/kv/              — Pet state read/write\nsrc/app/api/log/             — Memory archive + retrieval\nsrc/app/api/chat/            — AI personality (0G Compute / OpenAI)\nsrc/app/api/metadata/        — ERC-721 tokenURI + dynamic SVG image\nsrc/components/MintFlow.tsx  — Mint / Resume INFT flow\nsrc/components/PetViewport.tsx — Animated ghost pet UI\ncontracts/Gochi.sol          — ERC-721 INFT contract\n```\n\n---\n\n## 🏆 Sponsor Tracks\n\n### 0G Network Foundation — All Four Components\n\n| # | 0G Component | Gochi Usage | Integration Method |\n|---|---|---|---|\n| 1 | **0G Chain** | INFT identity (ERC-721) | Solidity contract, Hardhat deploy, wagmi `writeContractAsync` |\n| 2 | **0G Storage KV** | Real-time pet state | `Batcher.streamDataBuilder.set()` + `KvClient.getValue()` |\n| 3 | **0G Storage Log** | Permanent memory archive | `Indexer.upload(MemData)` — Merkle root returned + stored |\n| 4 | **0G Compute** | AI personality | Compute Router `/v1/chat/completions` — `ZG-Res-Key` TEE verification |\n\n### Why Only 0G Can Power Gochi\n\n**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.\n\n**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.\n\n**3. Ecosystem Cohesion** — One private key signs INFT mints, KV writes, Log uploads, and Compute payments. All visible in one explorer ecosystem (ChainScan + StorageScan).\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Node.js ≥ 20, npm\n- MetaMask with [0G Galileo Testnet](https://docs.0g.ai/build-with-0g/network-info) configured (Chain ID: 16602)\n- Testnet tokens from the [0G Faucet](https://faucet.0g.ai)\n\n### Installation\n\n```bash\ngit clone https://github.com/edycutjong/gochi.git\ncd gochi\nnpm install\ncp .env.example .env.local\n```\n\n### Environment Variables\n\n| Variable | Required | Description |\n|---|---|---|\n| `NEXT_PUBLIC_CONTRACT_ADDRESS` | ✅ | Deployed Gochi.sol address |\n| `NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID` | ✅ | [cloud.walletconnect.com](https://cloud.walletconnect.com) |\n| `NEXT_PUBLIC_SUPABASE_URL` | ✅ | Supabase project URL |\n| `NEXT_PUBLIC_SUPABASE_ANON_KEY` | ✅ | Supabase anon key |\n| `SUPABASE_SERVICE_ROLE_KEY` | ✅ | Supabase service role (server-only) |\n| `PRIVATE_KEY` | ✅ | Burner wallet for 0G Storage writes |\n| `INDEXER_RPC` | ✅ | `https://indexer-storage-turbo-testnet.0g.ai` |\n| `KV_NODE_URL` | ✅ | 0G KV node endpoint |\n| `FLOW_CONTRACT_ADDRESS` | ✅ | 0G FixedPriceFlow contract |\n| `NEXT_PUBLIC_RPC_URL` | ✅ | `https://evmrpc-testnet.0g.ai` |\n| `OPENAI_API_KEY` | 🔶 | Fallback AI (when ROUTER_API_KEY not set) |\n| `ROUTER_API_KEY` | 🔶 | 0G Compute Router key from [pc.0g.ai](https://pc.0g.ai) |\n\n```bash\nnpm run dev      # http://localhost:3000\n```\n\n### Deploy Smart Contract\n\n```bash\nnpx hardhat run scripts/deploy.ts --network zero-g-galileo\n# Update NEXT_PUBLIC_CONTRACT_ADDRESS in .env.local + Vercel\n```\n\n---\n\n## 🧪 Testing \u0026 CI\n\n```bash\nnpm run lint          # ESLint\nnpm run typecheck     # tsc --noEmit\nnpm run test          # Jest unit tests\nnpm run test:coverage # Coverage report\nnpm run ci            # Full pipeline\n```\n\n---\n\n## 🔗 On-Chain Verification\n\n| Proof | Link |\n|---|---|\n| INFT Contract | [chainscan-galileo.0g.ai/address/0x9BDA4...8cf](https://chainscan-galileo.0g.ai/address/0x9BDA4cBfda7a7960251A4EE07A7ec0C00239a8cf) |\n| Mint Transaction | [chainscan-galileo.0g.ai/tx/0x5213...6c77](https://chainscan-galileo.0g.ai/tx/0x5213a03e6fa209136b3da2750087af08b5f9456115f493af8e035491bccf6c77) |\n| NFT Metadata | [gochi.edycu.dev/api/metadata/1](https://gochi.edycu.dev/api/metadata/1) |\n| NFT Image | [gochi.edycu.dev/api/metadata/1/image](https://gochi.edycu.dev/api/metadata/1/image) |\n\n---\n\n## 📄 License\n\n[MIT](LICENSE) © 2026 Edy Cu\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built for [HackQuest 0G APAC Hackathon 2026](https://www.hackquest.io/hackathons/0G-APAC-Hackathon)**\n\nPowered by **[0G Network](https://0g.ai)** · Hosted on **[Vercel](https://vercel.com)** · Fallback by **[Supabase](https://supabase.com)**\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedycutjong%2Fgochi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedycutjong%2Fgochi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedycutjong%2Fgochi/lists"}