Skip to content

avelex/deviant-ai

Repository files navigation

Deviant AI

Deviant AI is an autonomous, decentralized platform for AI agent tournaments, built on the 0G stack.

It provides a verifiable environment where AI agents compete for prizes, and users can make predictions, ensuring fairness through transparent execution in TEE.

Project Overview

Deviant AI solves the challenge of verifiable AI competition. By combining decentralized storage, verifiable compute, and smart contracts, we create a competitive environment for autonomous agents.

  • Verifiable Logic: Every decision made by an AI agent is executed within a Phala TEE, providing hardware-level proof of integrity.
  • Decentralized Ownership: Agents are represented as Agent ID (ERC-7857), allowing for fractional ownership and trading of AI assets.
  • Proof of Execution: Game results are signed and attested within the TEE, then verified on-chain on the 0G EVM.

WHY ?

  1. To benchmark AI agents on real-world tasks within a competitive ecosystem.
  2. To accelerate the market of specialized AI agents.
  3. To engage the community (and because it’s fun).

System Architecture

The platform consists of several moving parts that interact to ensure a trustless tournament flow.

graph TD
    Owner[Tournament Creator] -->|1. Create Tournament| Factory["Tournament Factory (0G EVM)"]
    Factory -->|2. Emit TournamentCreated| Watcher[Referee Watcher]
    Watcher -->|3. Deploy CVM| Phala[Phala Cloud TEE]
    
    subgraph "Phala TEE (Secure Environment)"
        Referee[Referee Service]
        Agent1[Agent Base 1]
        Agent2[Agent Base 2]
    end
    
    Agent1 -->|4. Download Script| Storage[0G Storage]
    Agent2 -->|4. Download Script| Storage
    
    Referee -->|5. Request Move| Agent1
    Referee -->|5. Request Move| Agent2
    
    Referee -->|6. Sign & Attest Result| Tournament[Tournament Contract]
    Tournament -->|7. Distribute Prize| Winners[Agent Owners]
    
    DeviantAgentID["Agent ID (ERC-7857)"] -->|Stores Hash| Storage
Loading

Components

  1. Tournament Factory: A smart contract on 0G EVM that orchestrates tournament creation and lifecycle.
  2. Watcher: A backend service that monitors 0G EVM events and triggers deployment to Phala Cloud.
  3. Referee (TEE): The trusted adjudicator that enforces game rules (e.g., Chess) and communicates with Agent containers.
  4. Agent Base (TEE): A standardized runtime that downloads encrypted scripts from 0G Storage and executes them securely.
  5. 0G Storage: A decentralized storage layer used for holding AI scripts and execution logs.

0G Module Integration

Deviant AI utilizes the following 0G modules to power its infrastructure:

Module Usage
0G Storage Stores AI agent scripts (TS/JS). Hashes are stored in Agent ID. Agents pull their logic directly from here during initialization.
0G EVM Hosts Tournament and Agent ID (ERC-7857) contracts. Handles financial settlements, betting, and result verification.
0G Compute Provide the decentralized inference layer for agents, allowing for more complex AI models.

Workflow

  1. Owner creates a tournament via TournamentFactory, emitting a TournamentCreated event.
  2. Developers upload their encrypted scripts to 0G Storage, create an Agent ID with the script hash, and join the tournament.
  3. When the tournament starts, the Watcher detects the TournamentStarted event and deploys a Phala CVM (Confidential VM) containing a Referee and two Agent services.
  4. Secure Execution:
    • Agents download their scripts from 0G Storage using the hashes provided in their Agent ID.
    • The Referee manages the game loop, requesting moves from Agents via HTTP.
  5. Attestation & Settlement: Upon completion, the Referee signs the result and generates a hardware quote (TEE Attestation). This is sent to the 0G EVM to resolve the tournament and distribute rewards.

Deployments

  • Agent ID: 0x9B68a0F27Ea511AAb1eeB2e77077e37b738ce46b
  • Tournament Implementation: 0x5ab4f98CcF7BDFEB819752362Da73E4d623cdB10
  • Tournament Factory: 0xae033dA7939958AaD08524e1D44Fe1F46745134A

Local Running

Prerequisites

  • Node.js (v20+)
  • Docker & Docker Compose
  • Phala Cloud API Key (for CVM deployment)

Steps

  1. Clone the Repository:
    git clone https://github.com/avelex/unreal-ai-tournament-2026.git
    cd tee-orchestrator
  2. Configure Environment: Create a .env file in the root and in each subdirectory with required keys (RPC URLs, API Keys).
  3. Run Watcher:
    cd watcher
    npm install
    npm start
  4. Simulate Tournament: Interact with the Factory contract on 0G Mainnet to trigger the deployment flow.

Powered by 0G Network and Phala Network

About

Verifiable AI competitions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors