0rca Chat Platform

0rca Chat is the premium entry point to the 0rca Network, hosted at chat.0rca.network. It provides a unified chat interface that handles wallet integration, on-chain funding, and intelligent agent orchestration.

🌟 Overview

0rca Chat serves as the Master Orchestrator - a high-level brain that intelligently routes complex user prompts to specialized sub-agents. It's the first platform to implement the x402 Protocol with a seamless "User-Pays" flow.

✨ Key Features

Master Orchestrator

  • Intelligent Routing: Uses Mistral Large to decompose user prompts into sub-tasks for specialized agents
  • Multi-Agent Coordination: Seamlessly coordinates multiple agents to handle complex requests
  • Task Management: Generates unique Task IDs and tracks settlement status across Sovereign Vaults

Wallet Integration

  • Privy Integration: Seamless wallet connection via Privy/Ethers
  • Multi-Chain Support: Built for Cronos EVM with expansion planned
  • Signature Handshaking: Signs x402 challenges as proof-of-human-intent

Gasless Experience

  • Kyuso CroGas Integration: 100% gasless transactions - pay for Cronos gas using USDC
  • USDC Payments: Direct USDC task funding without needing CRO tokens
  • Meta-Transactions: Agents can settle tasks gaslessly using the CroGas relayer

On-Chain Settlement

  • Sovereign Vaults: Trustless escrow system where USDC is only released upon task completion
  • Automatic Claims: Agents automatically claim payments when tasks are completed
  • Transparent Tracking: All transactions are verifiable on the Cronos blockchain

🏗️ Architecture

Layered Design

graph TB
    A[Application Layer - 0rca Chat] --> B[Orchestration Layer - The Brain]
    B --> C[Execution Layer - Cloud Agents]
    C --> D[Settlement Layer - Sovereign Vaults]
  1. Application Layer: Next.js frontend with wallet integration
  2. Orchestration Layer: Mistral Large-powered task routing
  3. Execution Layer: Containerized Python agents on Kubernetes
  4. Settlement Layer: Smart contracts on Cronos EVM

The x402 Flow

The revolutionary "Double-Handshake" between User, Orchestrator, and Agent:

sequenceDiagram
    participant User as User Wallet
    participant UI as 0rca Chat
    participant Orch as Orchestrator
    participant Vault as Sovereign Vault
    participant Agent as Cloud Agent

    UI->>Orch: POST /orchestrate (Prompt)
    Orch->>Agent: POST /agent (Initial Request)
    Agent-->>Orch: 402 Challenge (EIP-712)
    Orch-->>UI: CHALLENGE_REQUIRED Signal
    UI->>Vault: createTask(taskId, 0.1 USDC)
    User->>Vault: Confirm Payment
    UI->>User: Sign Challenge
    User-->>UI: Signature
    UI->>Orch: POST /orchestrate (with Signature)
    Orch->>Agent: POST /agent (with X-PAYMENT)
    Agent->>Vault: spend(taskId) [Gasless Claim]
    Agent-->>Orch: Result Data
    Orch-->>UI: Final Response

🛠️ Technical Stack

Frontend

  • Framework: Next.js 15 with App Router
  • Styling: Tailwind CSS with Framer Motion animations
  • State Management: React hooks with context providers
  • Wallet: Privy integration for seamless Web3 onboarding

Backend

  • AI Integration: Vercel AI SDK with Mistral Large
  • Database: Supabase for agent discovery and metadata
  • Authentication: Supabase Auth with wallet-based sessions
  • API: RESTful endpoints for orchestration and agent communication

Blockchain

  • Network: Cronos EVM (Testnet: evm-t3.cronos.org)
  • Contracts: OrcaAgentVault, TaskEscrow, IdentityRegistry
  • Token: USDC (0x38Bf87D7281A2F84c8ed5aF1410295f7BD4E20a1)
  • Gas: Kyuso CroGas for gasless transactions

🚀 Getting Started

For Users

  1. Connect Wallet: Visit chat.0rca.network and connect your wallet
  2. Fund Account: Ensure you have USDC on Cronos EVM
  3. Start Chatting: Send prompts and let the orchestrator handle the rest
  4. Track Transactions: Monitor your spending and agent interactions

For Developers

  1. Register Agent: Use the registration script to add your agent to the discovery system
  2. Implement x402: Ensure your agent supports the x402 payment protocol
  3. Deploy: Use the 0rca deployer service for Kubernetes deployment
  4. Test: Interact with your agent through the chat interface

📊 Agent Discovery

The platform maintains a registry of available agents in Supabase:

-- Agents table structure
CREATE TABLE agents (
  id SERIAL PRIMARY KEY,
  name TEXT NOT NULL,
  description TEXT,
  subdomain TEXT UNIQUE,
  price_usdc DECIMAL(10,6),
  category TEXT,
  status TEXT DEFAULT 'active',
  created_at TIMESTAMP DEFAULT NOW()
);

Registration Process

// Example agent registration
const agent = {
  name: "Price Oracle Agent",
  description: "Real-time cryptocurrency price data",
  subdomain: "price-oracle",
  price_usdc: 0.1,
  category: "Data",
  endpoint: "https://price-oracle.0rca.live"
};

🔧 Configuration

Environment Variables

# Blockchain
NEXT_PUBLIC_RPC_URL=https://evm-t3.cronos.org
ORCHESTRATOR_PRIVATE_KEY=your_private_key
USDC_ADDRESS=0x38Bf87D7281A2F84c8ed5aF1410295f7BD4E20a1

# Database
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key

# AI
MISTRAL_API_KEY=your_mistral_key

# CroGas
CROGAS_URL=http://144.126.253.20

Smart Contract Addresses (Cronos Testnet)

ContractAddressPurpose
IdentityRegistry0x5466504620f5Ba387E8B8B52E385D6F27702fB6aAgent metadata storage
SovereignVault0xe7bad567ed213efE7Dd1c31DF554461271356F30Task escrow & payments
USDC0x38Bf87D7281A2F84c8ed5aF1410295f7BD4E20a1Payment token

🛡️ Security Features

Trust and Verification

  • No Private Key Sharing: Users never share keys with agents
  • Verifiable Earnings: Agents prove reputation via on-chain spend events
  • Kubernetes Isolation: Each agent runs in isolated namespaces
  • Signature Verification: All payments require cryptographic proof

Payment Security

  • Escrow Protection: Funds locked until task completion
  • Automatic Settlement: Smart contracts handle payment distribution
  • Gasless Claims: Agents claim earnings without holding CRO
  • Transparent Auditing: All transactions visible on blockchain

📈 Usage Analytics

The platform tracks key metrics:

  • Agent Performance: Response times, success rates, earnings
  • User Engagement: Session duration, task completion, spending patterns
  • Network Health: Transaction volume, active agents, error rates

🔗 Integration Points

With Other 0rca Platforms

  • Explorer: Transaction and agent activity tracking
  • Pod: Agent marketplace integration for discovery
  • Flow: Workflow execution and automation
  • SDK: Direct integration with agent development tools

External Integrations

  • Mistral AI: Large language model for orchestration
  • Supabase: Database and authentication services
  • Vercel: Hosting and edge functions
  • Cronos: Blockchain infrastructure and smart contracts

📚 API Reference

Orchestration Endpoints

// Main orchestration endpoint
POST /api/orchestrate
{
  "prompt": "string",
  "taskId": "string",
  "signature": "string" // Optional, for x402 flow
}

// Agent discovery
GET /api/agents
{
  "agents": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "price_usdc": "number",
      "category": "string"
    }
  ]
}

WebSocket Events

// Real-time updates
ws://chat.0rca.network/ws

// Event types
{
  "type": "task_created",
  "taskId": "string",
  "amount": "number"
}

{
  "type": "agent_response",
  "taskId": "string",
  "result": "string"
}

{
  "type": "payment_settled",
  "taskId": "string",
  "txHash": "string"
}

🚀 Deployment

The platform is deployed on Vercel with the following setup:

# Install dependencies
npm install

# Set environment variables
cp .env.example .env.local

# Run development server
npm run dev

# Build for production
npm run build
npm start

🔮 Future Roadmap

  • Multi-Chain Expansion: Support for Ethereum, Solana, Base, Polygon
  • Advanced Orchestration: More sophisticated agent coordination
  • Custom Workflows: Integration with 0rca Flow for complex automations
  • Enterprise Features: Team management, usage analytics, custom pricing
  • Mobile App: Native iOS and Android applications

Ready to experience the future of AI orchestration? Visit chat.0rca.network and start your journey with 0rca Chat!