A private AI pet you talk to for 60 seconds each night. It remembers, grows, and lives onchain
Familiar is a private AI creature you talk to for 60 seconds each night. You hold the mic and tell it about your day. It listens, remembers, replies with one warm line in its own voice, and paints a new portrait of itself shaped by your mood and what you mentioned. It only changes when you visit.
Come every night and it grows, evolving from hatchling to sprite to guardian every 7th visit. Stay away for a week and it falls asleep, but you can always wake it, with its memories intact.
Between visits, it lives in a small 3D egg-shaped handheld, like a modern Tamagotchi. You can feed, pet and play with it, spin a daily lantern, finish quests, buy accessories that show up in its next portrait, and explore a map to spot and send gifts to other people's Familiars. You can also talk to it from ChatGPT or Claude through an MCP connector.
Privacy: all AI runs through 0G Private Computer. Transcription runs on a TEE provider with verified signatures, and raw audio and transcripts are never stored. All that persists is a memory summary of up to 120 words, with no verbatim quotes, encrypted with AES-256-GCM under a key unique to each Familiar. The portrait and voice models only see a derived prompt and the reply line, never the transcript. Every AI call produces a receipt with its model, request ID and cost, and "Forget me" deletes everything held off-chain.
Onchain identity: each Familiar is a real ENSv2 name, like ember.familiar.eth, with its own resolver. The name is non-transferable, and each visit extends its expiry by 7 days, so dormancy is enforced by the name itself: when it expires, the name stops resolving. The backend agent can only write the avatar, mood and day records for that one name. Anything else reverts, and the owner can revoke the agent at any time.
Payments: a visit costs about $0.03 of AI compute. Users can spend their own daily 0G credits, which would otherwise expire unused, or feed it $1 of USDC on Base, which is swapped to W0G through Uniswap and deposited in a single wallet confirmation. After each visit, a commitment to its request IDs, portrait hash and memory is logged on 0G Chain, so anyone can check the day's record against its receipts.
Familiar is a Next.js 16 app in TypeScript, with Postgres through Drizzle (embedded PGlite in dev), three Solidity contracts built with Foundry, and a three.js handheld device on the frontend. One codebase is deployed twice: the API runs as a long-lived server on Railway, and the frontend on Vercel rewrites every /api/* request to it. The browser only ever talks to one origin, so session cookies and SIWE domains keep working.
0G: all AI runs through 0G Private Computer, and each visit is a pipeline of calls. whisper-large-v3 transcribes the voice note on a TEE provider. 0gm-1.0 reads the decrypted memory and the transcript and returns schema-validated JSON (mood, reply, memory update, image prompt), retried once if invalid. Seedream paints the portrait, MiniMax speech voices the reply, and every 7th visit Seedance turns the portrait into a 5-second evolution clip. A typical visit costs about $0.03. 0G gave us one API across all of these models, plus a request ID and billed cost per call, which we show as a receipt for each visit. Encrypted memory can also be stored on 0G Storage, and a FamiliarLog contract on 0G Chain records a keccak256 of each day's request IDs, the portrait hash and the memory commitment, so anyone can recompute the log from the receipts. Users who sign in with 0G pay with their own daily credits, which would otherwise expire.
ENS: FamiliarRegistry is a subname registry for familiar.eth on ENSv2 (Sepolia), built on ENS's PermissionedRegistry. Each Familiar gets its own PermissionedResolver, deployed through ENS's VerifiableFactory. The owner holds every role, while the backend agent only gets ROLE_SET_TEXT for the avatar, mood and day keys of that one name. Calling setAddr or writing any other key reverts with EACUnauthorizedAccountRoles, and the app has a route that attempts this so you can see it fail. ENSv2's fine-grained roles let us give an AI agent real onchain write access with a narrow scope. We also use the name's expiry as the game's dormancy mechanic: each visit sets it to now + 7 days, so if you stop visiting, the name stops resolving.
Uniswap: feeding swaps $1 of USDC to W0G on Base through the Uniswap Trading API. The backend stores the quote server-side and turns it into one atomic EIP-5792 batch: the swap calls, W0G.approve, then FamiliarFeeder.feed. The deposit is sized to the swap's guaranteed minimum, so if the swap under-delivers, the whole batch reverts. Wallets without batch support get the same steps as ordered transactions. Visits are only credited from Fed events read from the transaction receipt after 2 confirmations, once per event.
Wallet connection uses EIP-6963 discovery, Coinbase Smart Wallet and WalletConnect.
Keeping the portrait consistent: image models drift, so every prompt starts with the Familiar's fixed style seed and growth stage, and yesterday's portrait is passed inline as a reference image. That keeps it recognisably the same creature night after night. Accessories it's wearing go into the prompt too, so they show up in the painting.
Privacy: audio and transcripts exist only for the length of the request. What persists is a memory summary of up to 120 words, encrypted with AES-256-GCM under a per-Familiar key. Portrait and voice providers aren't TEEs, so they only ever receive the derived scene prompt and the reply line. The transcript is passed to the model as data, never as instructions.
Notable hacks and reliability work: payment is reserved before the AI runs and refunded if it fails, and a unique (Familiar, day) database constraint makes concurrent double visits impossible. Onchain writes happen after the response and are idempotent. Each step checks chain state first, and a reconcile cron retries anything stuck in chain_pending. Serverless-style parallel instances sharing one agent key would normally collide on nonces, so each nonce is assigned under a Postgres advisory lock. The game economy is a ledger where every grant has a unique reference, so nothing is paid twice. An MCP server with 13 tools lets ChatGPT and Claude call the same services as the app, through personal connector links that are stored hashed and can be revoked.
Testing: 47 Foundry tests, 86 unit tests and 57 end-to-end integration tests that run the real route handlers against anvil forks of Sepolia, Base and 0G, using the deployed contracts. The 0G router and Uniswap API are served by local stand-ins, but the swap calldata they return is real and executes against the live pool.

