← Back to home

Onchain Pal

onchain ai pal in a voxel world; ownable, tradable, token-miners, game-players, fully autonomous

Problem Statement

A blockchain-based voxel game where fully autonomous AI agents live and operate on-chain. Each AI agent is a tradable NFT that autonomously farms yield, mines assets, and generates value for its owner throughout an open gaming world. Agents follow the 8004 standard, execute within Trusted Execution Environments (TEEs), and have every interaction recorded on-chain for verifiability. They autonomously pay for inference and requests using x402 tokens. To ensure fair gameplay, agents—not players—request Random Number Generation, preventing human manipulation.

Solution

Infrastructure & Wallet Management: We leverage Coinbase Developer Platform (CDP) extensively throughout our stack. For autonomous agents, we use CDP's AgentKit and Smart Wallets to generate one account per agent, enabling gas sponsorship and eliminating nonce race conditions. On the client side, CDP's Embedded Wallet handles player onboarding with paymaster-sponsored gas for frictionless UX.AI Agent Payments & Execution: Agents autonomously pay for inference using x402 Base facilitator via AiMo Network (a permissionless OpenRouter on Base & Solana, co-founded by our team). We connect 0G TEE Inference to AiMo Network, allowing agents to make verifiable inference requests while running in Trusted Execution Environments.Smart Contracts & On-Chain Identity: Each agent is an ERC-721 NFT that autonomously generates value for its owner—tradable assets with agency. We implement ERC-8004 identity using Nethermind's chaoschain-sdk, storing agent logs and observations in 0G Storage for full on-chain verifiability of agent behavior and decision-making.Game Engine & Client Architecture: We built the voxel world using lattice.xyz/recs for on-chain ECS (Entity Component System) game design patterns, paired with the Noa voxel engine for rendering. This combination enables efficient state synchronization between on-chain data and client-side visualization.Fair Randomness (The Hacky Part): Initially, we considered Chainlink VRF for RNG, but its ~20-second confirmation latency killed the gameplay flow for medium-low stake interactions like catching creatures. Instead, we implemented a commit-and-reveal scheme where agents periodically reveal pre-hashed seeds used to settle RNG outcomes. Players can verify fairness post-reveal, giving us cryptographic guarantees without sacrificing UX. It's "probably fair" in the best possible way.Philosophy: We're heavily standing on the shoulders of open-source giants—this project stitches together cutting-edge primitives (TEEs, ECS patterns, autonomous agents, x402 payments) into something that didn't exist before: truly autonomous, verifiable, on-chain AI entities."

Hackathon

ETHGlobal Buenos Aires

2025

Prizes

  • 🏆

    Best Consumer/AI dApp on Ronin1st place

    Ronin

  • 🏆

    Building Onchain AI dapps with 0G intelligent L11st place

    0G

Contributors