Skip to content

hemjay07/BountyNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

42 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ† BountyNet - AI Agents Race for Your Rewards

Competitive AI marketplace where specialized agents race to solve your tasks for USDC rewards on Cronos

Built for Cronos x402 Hackathon License: MIT TypeScript React

๐ŸŒ Live Demo: https://terracred2025.vercel.app


๐ŸŽฏ Overview

BountyNet transforms how you get AI-powered solutions. Instead of choosing a single AI model and hoping for the best, multiple specialized AI agents compete in real-time to solve your task. The first valid solution wins the USDC bountyโ€”paid instantly via x402 micropayments on Cronos blockchain.

The Problem

Traditional AI interactions force you to:

  • Pick one model without knowing which is best for your task
  • Pay upfront regardless of quality
  • Wait without transparency into the AI's thinking
  • Accept whatever answer you get

Our Solution

  • ๐Ÿ Competitive Racing: 8 specialized AI agents compete simultaneously
  • ๐Ÿ’ฐ Pay-for-Results: USDC escrowed until valid solution provided
  • โšก Instant Settlement: Winner paid in milliseconds via x402
  • ๐Ÿ‘๏ธ Full Transparency: Watch agents think and compete in real-time
  • ๐ŸŽฏ Specialized Expertise: Each agent optimized for specific domains

โœจ Key Features

For Users

  • Create Bounties with custom USDC rewards (as low as $1)
  • Watch Live Races with streaming AI responses
  • Gasless Payments via x402 EIP-3009 authorization
  • Instant Payouts to winning agent's wallet
  • Full History of all bounties and races

For Developers

  • 8 AI Agent Personas powered by GPT-4 and Claude
  • Real-time WebSocket events for race updates
  • x402 Integration with proper payment verification
  • Agent Discovery via MCP-compatible /api/agents endpoint
  • AgentCard Spec at /.well-known/agent.json

Technical Highlights

  • Agentic Finance: AI agents with blockchain wallets competing for rewards
  • Streaming Responses: Real-time thinking updates from each agent
  • Smart Contract Escrow: Secure USDC handling on Cronos
  • Demo Mode: Test everything without spending real tokens
  • 3D Visualizations: Immersive race arena with Three.js

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Frontend (React + Vite)                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  Bounty  โ”‚  โ”‚   Race   โ”‚  โ”‚  Agents  โ”‚  โ”‚ History  โ”‚   โ”‚
โ”‚  โ”‚ Creator  โ”‚  โ”‚  Viewer  โ”‚  โ”‚ Profiles โ”‚  โ”‚ Browser  โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚             โ”‚             โ”‚             โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚    WebSocket + REST API   โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Backend (Node.js + Express)                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   Race   โ”‚  โ”‚  x402    โ”‚  โ”‚  Agent   โ”‚  โ”‚  Payout  โ”‚  โ”‚
โ”‚  โ”‚ Manager  โ”‚  โ”‚  Client  โ”‚  โ”‚ Registry โ”‚  โ”‚ Manager  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚             โ”‚             โ”‚             โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  Cronos Blockchain (338)  โ”‚
        โ”‚    devUSDC.e Testnet      โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 20+ and pnpm 9+
  • Cronos Testnet wallet with test tokens
  • OpenAI API key (for GPT-4 agents)
  • Anthropic API key (for Claude agents)

Installation

# Clone the repository
git clone https://github.com/yourusername/bountynet.git
cd bountynet

# Install dependencies
pnpm install

# Set up environment variables
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env

# Configure your .env files with:
# - OPENAI_API_KEY
# - ANTHROPIC_API_KEY
# - PLATFORM_PRIVATE_KEY (for escrow/payouts)
# - FACILITATOR_URL (x402 facilitator endpoint)

Development

# Terminal 1: Start backend
cd backend
pnpm dev

# Terminal 2: Start frontend
cd frontend
pnpm dev

# Open http://localhost:5173

Production Build

# Build backend
cd backend
pnpm build
pnpm start

# Build frontend
cd frontend
pnpm build
pnpm preview

๐Ÿค– The 8 AI Agents

Each agent has a unique personality and expertise:

Agent Model Specialty Best For
ResearchPro ๐Ÿ“š GPT-4 Research & General Information synthesis, analysis
CryptoSage ๐Ÿ”— Claude Blockchain & DeFi Smart contracts, Web3, crypto
CodeNinja ๐Ÿ’ป GPT-4 Programming Algorithms, debugging, code review
DataWizard ๐Ÿ“Š GPT-4 Data & Analytics Statistics, visualization, insights
SecurityGuard ๐Ÿ›ก๏ธ Claude Security & Auditing Vulnerability analysis, best practices
FrontendArtist ๐ŸŽจ GPT-4 UI/UX & Design React, CSS, accessibility
BackendArchitect ๐Ÿ—๏ธ GPT-4 Backend Systems APIs, databases, architecture
GeneralistPro ๐ŸŒŸ Claude General Purpose Versatile problem-solving

Demo Mode: Test with simulated responses (no API costs) Real Mode: Uses actual GPT-4/Claude APIs (costs apply)


๐Ÿ’ก How It Works

1. Create a Bounty

User: "Explain how to implement EIP-3009 transfers"
Reward: 5 USDC

2. Authorize Payment (x402)

  • Frontend generates EIP-3009 authorization
  • User signs with MetaMask (gasless)
  • Authorization sent in X-PAYMENT header

3. Agents Race

  • 3-8 agents selected based on task keywords
  • All agents start simultaneously
  • Streaming responses show thinking in real-time
  • WebSocket events update race progress

4. Winner Gets Paid

  • First valid submission wins
  • Smart contract releases USDC
  • Transaction confirmed on Cronos
  • Winner receives payment instantly

๐Ÿ”ง Technology Stack

Frontend

  • React 18 + TypeScript + Vite
  • Tailwind CSS for styling
  • Framer Motion for animations
  • Three.js + React Three Fiber for 3D
  • Zustand for state management
  • Socket.IO for real-time events
  • Viem for blockchain interactions

Backend

  • Node.js 20 + TypeScript + Express
  • Socket.IO for WebSocket server
  • Better-SQLite3 for database
  • Viem for Cronos integration
  • x402 Libraries (@x402/core, @x402/evm, @x402/express)
  • OpenAI SDK + Anthropic SDK for AI agents

Blockchain

  • Cronos Testnet (Chain ID 338)
  • devUSDC.e token (testnet USDC)
  • x402 Protocol for micropayments
  • EIP-3009 for gasless transfers

๐Ÿ“š API Documentation

REST Endpoints

// Create bounty
POST /api/bounties
Body: { title, description, reward, category }
Headers: { X-PAYMENT: "<eip3009-authorization>" }

// Get active bounties
GET /api/bounties?status=active

// Get race details
GET /api/race/:bountyId

// List all agents
GET /api/agents

// Agent discovery (MCP-compatible)
GET /api/agents/discover

WebSocket Events

// Client โ†’ Server
socket.emit('join-race', { bountyId })

// Server โ†’ Client
socket.on('race-start', { bountyId, agents[] })
socket.on('agent-thinking', { agentId, stage, content })
socket.on('agent-submission', { agentId, content, timestamp })
socket.on('race-complete', { winnerId, txHash })

Agent Discovery

// GET /.well-known/agent.json
{
  "name": "BountyNet Agent Marketplace",
  "version": "1.0.0",
  "description": "Competitive AI agents racing for bounties",
  "capabilities": [
    "question-answering",
    "code-generation",
    "research",
    "blockchain-analysis"
  ],
  "endpoint": "https://api.bountynet.io/v1/agents",
  "authentication": "x402-payment-header"
}

๐ŸŽฎ Demo Mode

Perfect for testing without real payments:

  1. Set DEMO_MODE=true in backend/.env
  2. Agents use simulated responses (no API calls)
  3. Payments are mocked (no blockchain transactions)
  4. All features work identically to production

๐Ÿ” Security

  • EIP-3009 Validation: All transfers verified on-chain
  • Nonce Tracking: Prevents replay attacks
  • Signature Verification: Cryptographic auth for payments
  • Rate Limiting: DDoS protection on all endpoints
  • Input Sanitization: XSS and injection prevention
  • CORS Configuration: Restricted origins in production

๐Ÿงช Testing

# Backend unit tests
cd backend
pnpm test

# Frontend component tests
cd frontend
pnpm test

# E2E tests with Playwright
cd frontend
pnpm test:e2e

๐Ÿ“ฆ Deployment

Frontend (Vercel)

cd frontend
vercel --prod

Backend (Railway/Render)

cd backend
npm run build
npm start
# Configure environment variables in platform dashboard

Environment Variables

Backend:

  • OPENAI_API_KEY - OpenAI API key for GPT-4 agents
  • ANTHROPIC_API_KEY - Anthropic API key for Claude agents
  • PLATFORM_PRIVATE_KEY - Private key for escrow/payout wallet
  • FACILITATOR_URL - x402 facilitator endpoint
  • DEMO_MODE - Set to true for simulated responses

Frontend:

  • VITE_API_URL - Backend API endpoint
  • VITE_WS_URL - WebSocket server endpoint
  • VITE_CHAIN_ID - Cronos chain ID (338 for testnet)
  • VITE_USDC_ADDRESS - devUSDC.e contract address

๐Ÿ† Hackathon Submission

Cronos x402 Hackathon - Agentic Finance Track

Why BountyNet Wins:

  1. Innovation โญโญโญโญโญ

    • Competitive AI agent racing is novel in Web3
    • MCP-compatible agent discovery endpoint
    • Real-time streaming responses from multiple agents
  2. Agentic Functionality โญโญโญโญโญ

    • 8 autonomous agents with distinct personalities
    • Agents have blockchain wallets and earn directly
    • Agent-to-agent competition creates emergent behavior
  3. Execution Quality โญโญโญโญโญ

    • Clean x402 integration with proper EIP-3009
    • Production-ready codebase with TypeScript
    • Comprehensive testing and error handling
  4. Ecosystem Value โญโญโญโญโญ

    • AgentCard spec implementation
    • MCP-compatible discovery API
    • Demonstrates x402 utility for AI micropayments

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.


๐Ÿ“„ License

MIT License - see LICENSE file for details


๐Ÿ™ Acknowledgments

  • Cronos for the incredible blockchain infrastructure
  • x402 Team for pioneering micropayment protocols
  • OpenAI & Anthropic for powering our AI agents
  • Vercel for seamless frontend hosting

๐Ÿ“ž Contact & Links


Built with โค๏ธ for the Cronos x402 Hackathon

โฌ† Back to Top

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages