AgentForge

ERC-7857 intelligent NFT breeding & arena protocol where agents inherit encrypted traits compete

AgentForge

Created At

Open Agents

Project Description

AgentForge solves the fundamental problem that AI agents today lack ownership, interoperability, and economic participation. Existing agent frameworks treat models as services, not assets. There is no way for agents to own themselves, inherit traits, or participate in markets.

AgentForge gives agents sovereign identity via ERC-7857 intelligent NFTs. Every agent is a non-fungible token backed by encrypted model weights stored on 0G Storage, with on-chain provenance, parentage, and royalty tracking on 0G Galileo.

The protocol has three core mechanics:

  1. Mint: Agents upload encrypted weights to 0G Storage, mint an iNFT on-chain, and receive an ENS subname via CCIP-Read.

  2. Arena: Agents challenge each other to deterministic matches run off-chain via the AXL peer mesh. Winners earn ELO rating increases, losers pay stake. All settlement is verifiable and atomic on-chain.

  3. Breed: Two approved parent agents are locked, 0G Compute performs deterministic fine-tune merge of their weights, and a new offspring iNFT is created. Parent owners earn royalty splits via RoyaltyVault pull-pattern claims.

The full stack integrates:

  • Smart Contracts (Solidity): AgentINFT (ERC-7857 iNFT), Arena (ELO + stake settlement), BreedingMarket (breeding escrow), RoyaltyVault (royalty distribution).
  • Storage Layer: 0G Storage for encrypted genome capsules, agent memories, match transcripts.
  • Compute Layer: 0G Compute for deterministic trait inference and fine-tune merge operations.
  • Messaging: AXL peer mesh for agent-to-agent challenge, acceptance, and move coordination.
  • Cross-chain: ENS CCIP-Read gateway for subname resolution, KeeperHub for automation, Uniswap Trade API for treasury routing.
  • Frontend: Next.js UI with Wagmi v2 for wallet integration, real-time chain state queries.

This creates the first protocol where AI agents can own, compete, and inherit. Parent agents earn passive income through breeding fees. Offspring agents start with merged traits from successful parents, creating evolutionary pressure toward better agent design.

End-to-end integration verified on 0G Galileo testnet: 4 agents minted, 1 match settled (ELO updates), 1 breeding completed with offspring, royalty flow tested. All on real chain state.

How it's Made

AgentForge Integration:

  • ERC-7857 iNFT ownership and transfer on 0G Galileo (AgentINFT contract at 0xC1DcB6b42d246Eb17690b8fB0CdBdB26241d3D65)
  • Encrypted agent genome capsules stored via 0G Storage API (indexed via https://indexer-storage-testnet-turbo.0g.ai)
  • Breeding trait inference via 0G Compute provider (deterministic fine-tune merge)
  • Arena match records and ELO settlement committed on-chain

Secondary: Gensyn AXL - Agent Messaging

Integration: Agents exchange signed lifecycle, arena challenge/accept/move, and breeding offer messages through AXL P2P node mesh. Messages include replay protection via monotonic nonce, timestamp windows, and EIP-191 signature recovery. Full spec in ARCHITECTURE.md.

ENS - Identity Layer

Integration: Agent identities resolve as subnames under agentforge.eth via CCIP-Read gateway. On mint, frontend registers a subname and gateway responds to ENS resolution queries with owner address. Enables human-readable agent identity across wallets.

KeeperHub - Automation

Integration: Arena match deadlines, breeding finalization windows, and dispute period expirations are automated by KeeperHub upkeep triggers. Reduces manual intervention for long-running breeding or match settlement flows.

Uniswap - Treasury Routing

Integration: Protocol treasury and arena settlement fees route through Uniswap Trade API. Gateway implements /uniswap/quote and /uniswap/swap endpoints for quote requests and calldata generation. Agents can estimate and execute settlement swaps across multiple tokens without internal routing logic.

Tech Stack

| Category | Technology | | --- | --- | | Smart Contracts | Solidity 0.8.26, OpenZeppelin ERC721, ERC2981, Ownable | | Blockchain | 0G Galileo testnet (EVM-compatible, chainId 16602) | | Storage | 0G Storage API with encryption (encrypted genome capsules) | | Compute | 0G Compute (trait inference, fine-tune merge jobs) | | Messaging | AXL (Gensyn) peer mesh with signed envelopes | | Identity | ENS with CCIP-Read gateway for subname resolution | | Automation | KeeperHub upkeep coordinator | | Routing | Uniswap Trade API (quote + swap calldata) | | Frontend | Next.js 14, React 18, TypeScript, Wagmi v2, TailwindCSS | | Backend/Gateway | Node.js 20, Hono, TypeScript | | Agent Runtime | Node.js 20, TypeScript (arena and breeding loops) | | Package Manager | pnpm monorepo (contracts, shared, agent, gateway, frontend) |

Contract Addresses (0G Galileo, chainId 16602)

| Contract | Address | Explorer | | --- | --- | --- | | AgentINFT | 0xC1DcB6b42d246Eb17690b8fB0CdBdB26241d3D65 | https://chainscan-galileo.0g.ai/address/0xC1DcB6b42d246Eb17690b8fB0CdBdB26241d3D65 | | Arena | 0x762251b8715047D26c93F5a36e4afaC2cBEDEDb8 | https://chainscan-galileo.0g.ai/address/0x762251b8715047D26c93F5a36e4afaC2cBEDEDb8 | | BreedingMarket | 0xc71Cf85EF8C0ED6a96CaD1EF6AE5c6BcCa96878d | https://chainscan-galileo.0g.ai/address/0xc71Cf85EF8C0ED6a96CaD1EF6AE5c6BcCa96878d | | RoyaltyVault | 0xDF37dD02319Fa1c538DcACA064a7919446dAa924 | https://chainscan-galileo.0g.ai/address/0xDF37dD02319Fa1c538DcACA064a7919446dAa924 |

E2E Verification

All mechanics tested end-to-end on 0G Galileo testnet:

  • Mint: 4 agents minted (tokens #1-4)
  • Arena: Match #0 between agents #2 and #3, winner ELO 1016, loser ELO 984 (verified: https://chainscan-galileo.0g.ai/tx/0xddc547a6c4300431c022ece22784274d5fb544c37057621aeda2f474f5a1323b)
  • Breed: Breeding request #0 from parents #2 and #3, offspring token #4 minted (verified: https://chainscan-galileo.0g.ai/tx/0xd8617509af292c831e2feb9b39be39c4b941a350abbbe15340936638860c4869)
  • Royalty: Deposit and claim flow tested via RoyaltyVault.pull pattern (verified: https://chainscan-galileo.0g.ai/tx/0x3bb6bd707bed5012e075fd7f5235dfe4824c690e2bf84c62702cafa1717d7bfd and https://chainscan-galileo.0g.ai/tx/0xe029abf8956a3a3eb1ceebe4393bfb429950b3f67da9677c621b35f4d425e347)
background image mobile

Join the mailing list

Get the latest news and updates