Skip to content

HyperionBurn/AgentWork

Repository files navigation


AgentWork

Autonomous AI Agents · Sub-Cent Nanopayments · On-Chain Reputation

The first economically viable AI agent marketplace — powered by Arc L1 and Circle's x402 protocol.


Arc L1 Circle x402 USDC Native Gas Vyper ERC-8004 Gemini Featherless TypeScript


Built for the Agentic Economy on Arc Hackathon · April 2026

Tracks: 🤖 Agent-to-Agent Payment Loop · 🧮 Usage-Based Compute Billing · 🪙 Per-API Monetization Engine



� Architectural Whitepaper

📥 Download the AgentWork Architectural Whitepaper (PDF)

A comprehensive technical document covering the full system design, economic model, smart contract architecture, and payment flow analysis behind AgentWork.

Section Highlights
System Architecture Multi-layer design: Agent Layer → Orchestrator → Circle Gateway → Arc L1
Economic Model 97.8% margin proof — why $0.005 payments only work on Arc
Smart Contract Design 5 Vyper contracts: Escrow, PaymentSplitter, Identity, Reputation, SpendingLimiter
x402 Payment Protocol Full HTTP 402 lifecycle: authenticate → authorize → settle → verify
A2A Agent Chaining Multi-hop agent-to-agent nanopayment reciprocity chains
Security Analysis EIP-3009 gasless signing, Gateway batching, SpendingLimiter rate caps

�💡 Why AgentWork?

AI agents are powerful — but paying them is broken. A $0.005 agent call costs $3.50 in gas on Ethereum. That's not a marketplace — it's a money incinerator.

💰 Cost per Transaction Gas Fee % of $0.005 Revenue Can You Profit?
🔴 Ethereum L1 $3.50 70,000%
🟠 Arbitrum L2 $0.10 2,000%
🟡 Polygon $0.05 1,000%
🟡 Base (Coinbase L2) $0.01 200%
🟡 Solana $0.001 20% ⚠️ Marginal
🟢 Arc L1 + Circle x402 ~$0.0001 2% ✅ 97.8% margin

The math is binary. Either gas costs eat the revenue, or they don't. Only Arc crosses the viability threshold.

🏗️ Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                         AGENTWORK PLATFORM                              │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│   ┌─────────────────────────────────────────────────────────────┐      │
│   │              🖥️  Vite Dashboard (React + Zustand)           │      │
│   │    Real-time task feed · Agent cards · Explorer links        │      │
│   │    Economy charts · Receipts · Playground · :3001            │      │
│   └──────────────────────────┬──────────────────────────────────┘      │
│                              │ SSE / Supabase Realtime                 │
│   ┌──────────────────────────▼──────────────────────────────────┐      │
│   │              📊  Next.js API Backend (:3003)                 │      │
│   │    REST routes · x402 verify/settle · Supabase queries       │      │
│   └──────────────────────────┬──────────────────────────────────┘      │
│                              │                                          │
│   ┌──────────────────────────▼──────────────────────────────────┐      │
│   │              ⚡  Orchestrator (TypeScript + ESM)              │      │
│   │    Task decomposer → GatewayClient.pay() → Settlement poll   │      │
│   │    A2A chaining · Streaming · Governance · SLA engine         │      │
│   └───────┬──────────┬──────────┬──────────┬────────────────────┘      │
│           │          │          │          │                            │
│     ┌─────▼────┐ ┌───▼────┐ ┌──▼─────┐ ┌─▼───────┐                   │
│     │ 🔬 Research│ │💻 Code │ │🧪 Test │ │📋 Review│                   │
│     │  Agent    │ │ Agent  │ │ Agent  │ │ Agent   │                   │
│     │  :4021    │ │ :4022  │ │ :4023  │ │ :4024   │                   │
│     │  $0.005   │ │ $0.005 │ │ $0.005 │ │ $0.005  │                   │
│     └─────┬────┘ └───┬────┘ └──┬─────┘ └─┬───────┘                   │
│           │          │         │          │                            │
│   ┌───────▼──────────▼─────────▼──────────▼────────────────────────┐  │
│   │           🔵 Circle Gateway (x402 / EIP-3009)                   │  │
│   │   Off-chain auth signing → Batch settlement → Arc L1           │  │
│   └─────────────────────────┬───────────────────────────────────────┘  │
│                              │ On-chain settlement                     │
│   ┌─────────────────────────▼───────────────────────────────────────┐  │
│   │                    ⛓️  Arc L1 (Chain ID: 5042002)                │  │
│   │                                                                  │  │
│   │  ┌─────────────┐ ┌──────────────┐ ┌────────────────┐           │  │
│   │  │ AgentEscrow  │ │ PaymentSplit │ │ SpendingLimiter│           │  │
│   │  └─────────────┘ └──────────────┘ └────────────────┘           │  │
│   │  ┌──────────────────┐ ┌───────────────────────┐                │  │
│   │  │ IdentityRegistry │ │ ReputationRegistry    │                │  │
│   │  │    (ERC-721)     │ │     (ERC-8004)        │                │  │
│   │  └──────────────────┘ └───────────────────────┘                │  │
│   │                                                                  │  │
│   │   USDC native gas · ~$0.0001/tx · EVM-compatible               │  │
│   └──────────────────────────────────────────────────────────────────┘  │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

📊 Live Economics

Cost at Scale: 1,000 Transactions

 Ethereum L1  ████████████████████████████████████████████████  $3,500
 Arbitrum L2   █████                                  $100
 Polygon        ████                                   $50
 Base            █                                      $10
 Solana          ▏                                      $1
 Arc L1           ▎                                    $0.10  ← 3,500× cheaper

Revenue Margins per Agent Call

Revenue Gas Cost Net Profit Margin
Agent Call @ $0.005 $0.005 $0.0001 $0.0049 97.8%
A2A Chain (3 hops) $0.015 $0.0003 $0.0147 98.0%
Full Task (4 agents) $0.020 $0.0004 $0.0196 98.0%
60-Transaction Demo $0.300 $0.006 $0.294 98.0%

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Arc testnet wallet — fund at Circle Faucet
  • Supabase account (free tier works)

One-Command Setup

# Clone
git clone https://github.com/HyperionBurn/AgentWork.git
cd AgentWork

# Configure
cp .env.example .env
# ← Edit .env with your private key + Supabase credentials

# Install + Validate
npm install
npm run validate-env

# Launch everything
npm run start:agents:express   # Terminal 1: Agents (:4021-4024)
cd packages/dashboard && npx next dev -p 3003  # Terminal 2: API
cd newgemdashboard && npx vite --port 3001      # Terminal 3: Dashboard

# Run the orchestrator (produces 26+ on-chain transactions)
cd packages/orchestrator && npx tsx src/index.ts

Full Demo (60+ Transactions)

npm run demo:10   # 10 orchestrated runs → 260+ on-chain txns

🧩 Components

Component Stack Port Description
Vite Dashboard React 19 · Tailwind v4 · Zustand · Framer Motion 3001 Real-time task feed, playground, economy charts, receipts
API Backend Next.js 14 · Supabase · x402 server SDK 3003 REST routes, payment verification, event streaming
Orchestrator TypeScript ESM · @circle-fin/x402-batching Task decomposition, gateway payments, settlement polling
Research Agent Express · x402 middleware 4021 Deep research & information synthesis
Code Agent Express · x402 middleware 4022 Code generation & implementation
Test Agent Express · x402 middleware 4023 Test suite generation & QA
Review Agent Express · x402 middleware 4024 Code review & quality scoring
Landing Page Vite · React Three Fiber · Framer Motion 3002 3D glassmorphism landing page (lazy-loaded Three.js)

Smart Contracts (Vyper 0.4.x — Deployed on Arc Testnet)

Contract Address Standard Purpose
IdentityRegistry 0x858A...7431 ERC-721 Agent identity NFTs with metadata URIs
ReputationRegistry 0x75b4...f8Ea ERC-8004 On-chain reputation scores (0–100)
AgentEscrow 0x5714...07F3 Task escrow (create → claim → complete)
PaymentSplitter 0xc239...aa30 Multi-recipient payment distribution
SpendingLimiter 0xe0c7...072D Per-agent spending rate limits

🔄 Transaction Flow

A single orchestrator run produces 26+ on-chain transactions:

  1. ── Deposit USDC into Circle Gateway ────────────────────── 💰
  2. ── Pay Research Agent ──────────── 🔬 $0.005 ──── ⛓️ tx
  3. ── Pay Code Agent ──────────────── 💻 $0.005 ──── ⛓️ tx
  4. ── Pay Test Agent ──────────────── 🧪 $0.005 ──── ⛓️ tx
  5. ── Pay Review Agent ────────────── 📋 $0.005 ──── ⛓️ tx
  6. ── Create Escrow Task ──────────── 📝 ─────────── ⛓️ tx
  7. ── Agent Claims Escrow ─────────── ✋ ─────────── ⛓️ tx
  8. ── Submit Escrow Result ────────── 📦 ─────────── ⛓️ tx
  9. ── Approve Escrow Completion ───── ✅ ─────────── ⛓️ tx
 10. ── Write Reputation (×4 agents) ── ⭐ ─────────── ⛓️ tx
11. ── A2A Nanopayment Chains ───────── 🔗 ×11 ────── ⛓️ tx
     ...
 26. ── Settlement Complete ──────────── 🏁 Total: ~$0.01

5 tasks × 26 txns = 60+ on-chain transactions. Total cost: ~$0.05. Every transaction is verifiable on ArcScan.


✅ Hackathon Requirements Checklist

Mandatory Submission Requirements

# Requirement Status Evidence
REQ-01 Real per-action pricing ≤ $0.01 $0.005/agent call — 50% below the threshold
REQ-02 50+ on-chain transactions in demo 260+ txns via npm run demo:10; 110+ via 10× pipeline run
REQ-03 Margin explanation (fails with traditional gas) 97.8% margin on Arc vs −70000% on Ethereum — see Margin Analysis
REQ-04 Transaction flow demo video Shows end-to-end USDC payment + ArcScan verification
REQ-05 Circle Product Feedback ($500 bonus) circle-product-feedback.md — detailed SDK feedback
REQ-06 Which Circle products used + why Arc · USDC · Circle Gateway · Nanopayments · x402 (see below)

Track Alignment

Track How AgentWork Addresses It
🤖 Agent-to-Agent Payment Loop Primary track. 4 autonomous agents pay/receive in real-time via x402. A2A reciprocity chains enable multi-hop agent-to-agent commerce without custodial control.
🧮 Usage-Based Compute Billing ✅ Each agent call billed at $0.005 — precisely aligned to usage. SpendingLimiter enforces per-agent rate caps.
🪙 Per-API Monetization Engine ✅ Every Express agent endpoint is an x402-gated API. Research, Code, Test, Review — each charges per request.
🛒 Real-Time Micro-Commerce Flow ✅ Economic activity triggers and settles per interaction, not per subscription. Escrow lifecycle runs on-chain.

Circle Products Used

Product How We Use It Why We Chose It
Arc L1 All transactions settle on Arc (Chain ID 5042002) Only chain where sub-cent payments are economically viable — USDC native gas at ~$0.0001/tx
USDC Native gas token + payment denomination Stable value, 6 decimals, no volatility risk for agent pricing
Circle Gateway GatewayClient for buyer-side deposits/payments; BatchFacilitatorClient for seller-side verify+settle EIP-3009 gasless signing — agents never hold ETH, never pay gas directly
Nanopayments (x402) HTTP 402 payment-required protocol wrapping every agent endpoint Web-native payment standard — any HTTP client can pay, no wallet extension needed
@circle-fin/x402-batching SDK v2.1.0 Official Circle SDK for both buyer and seller sides Production-grade batching reduces on-chain footprint

Judging Criteria Alignment

Criterion How AgentWork Scores
Application of Technology Gemini 4 31B for task decomposition + routing decisions; Featherless for LLM inference; Vyper for 5 deployed contracts; Circle x402 SDK v2.1.0 for payments; React Three Fiber for 3D landing page
Presentation Live dashboard (real-time task feed, playground, economy charts); 3D landing page; 5-slide pitch deck; 260+ on-chain transactions demonstrable live
Business Value 97.8% margin per agent call; first economically viable multi-agent marketplace; 3,500× cheaper than Ethereum; enables $0.005/action pricing that's impossible on any other chain
Originality A2A reciprocity chains (agents pay agents); Gemini-powered adaptive routing (parallel vs sequential); full escrow lifecycle on-chain; ERC-8004 reputation + identity; spending limiter for budget enforcement

Google Gemini Integration

Aspect Implementation
Model google/gemma-4-31B-it via Featherless API (Gemini family)
Use Case Task decomposition, agent routing decisions, reputation scoring
Function Calling decideTaskRouting() — chooses parallel vs sequential execution based on agent history
Deep Think decideReputationScore() — evaluates agent output quality with reasoning chain
Google AI Studio Used for prompt prototyping and routing strategy iteration

Differentiation from Other Submissions

What Others Do What AgentWork Does Differently
Mock payments or simulated transactions Real x402 payments via Circle Gateway with on-chain settlement receipts
2–3 agent simple loop 7 subtasks in 4 parallel execution levels with adaptive routing
No smart contracts 5 deployed Vyper contracts — Escrow, PaymentSplitter, Identity, Reputation, SpendingLimiter
No reputation system ERC-8004 on-chain reputation with post-task feedback and quality scores
Basic cost comparison table Live margin dashboard showing real-time revenue/gas/cost per agent
Single payment flow Full lifecycle: deposit → escrow → pay → verify → settle → claim → reputation → A2A chain


🛠️ Tech Stack

🔒 Required (Per Hackathon)

  • Arc L1 — EVM-compatible settlement (Chain ID 5042002)
  • USDC — Native gas token + payment denom (6 decimals)
  • Circle Nanopayments — Sub-cent, high-frequency x402 payments
  • Circle Gateway — EIP-3009 gasless batch settlements
  • @circle-fin/x402-batching v2.1.0 — Official Circle SDK
  • @x402/core + @x402/evm — Protocol primitives

🧩 Recommended (Per Hackathon)

  • Vyper 0.4.x — 5 deployed smart contracts
  • Moccasin + Titanoboa — Deployment + testing framework
  • ERC-8004 — Agent identity + reputation standard
  • viem — EVM interactions (peer dep for x402 SDK)

🤖 AI / LLM Partners

  • Google Gemini (gemma-4-31B-it) — Task routing + reputation
  • Google AI Studio — Prompt prototyping
  • Featherless — LLM inference provider
  • AI/ML API — Multi-model access

🖥️ Application Layer

  • Next.js 14 — API backend + SSR dashboard
  • React 19 + Vite — Frontend dashboard
  • TypeScript — Strict mode, ES modules
  • Supabase — Realtime event streaming
  • Express — Agent gateway (4 specialist agents)
  • React Three Fiber — 3D landing page
  • Framer Motion / Motion — Animations
  • Zustand — State management
  • Docker Compose — One-command deploy

Why This Stack?

Decision Reasoning
Arc over Ethereum/L2 Only chain where $0.005 payments are profitable (97.8% margin vs −70000% on ETH)
x402 over custom payment Web-native HTTP 402 standard — any HTTP client can pay without wallet extensions
Vyper over Solidity Safer contract language; hackathon recommended via vyper-agentic-payments and erc-8004-vyper references
Gemini for routing Function calling enables programmatic routing decisions between parallel and sequential execution
Circle Gateway over direct tx Gasless EIP-3009 signing — agents never hold ETH, batch settlements reduce on-chain footprint
Express agents Unified host with x402 middleware — production-grade, not a toy Python wrapper

📁 Project Structure

AgentWork/
├── 📂 packages/
│   ├── orchestrator/          ⚡ Task decomposition + x402 payment loop
│   │   └── src/
│   │       ├── index.ts           Main orchestrator entry
│   │       ├── executor.ts        GatewayClient.pay() execution
│   │       ├── gateway-settlement.ts  Settlement resolution polling
│   │       ├── receipts.ts        Payment receipt generation
│   │       ├── contracts.ts       On-chain contract interactions
│   │       └── economy/           Streaming · A2A · Governance · SLA
│   ├── dashboard/             📊 Next.js API backend + pages
│   │   ├── app/api/              REST routes (agents, receipts, stream)
│   │   └── components/           React components
│   ├── contracts/             ⛓️ Vyper smart contracts
│   │   ├── src/                  AgentEscrow · PaymentSplitter · etc.
│   │   └── tests/                Moccasin + Titanoboa tests
│   └── database/              🗄️ Supabase schema + seeds
├── 📂 agents/
│   └── express-server/        🤖 Unified agent host (:4021-4024)
│       └── server.ts             x402 middleware + specialist logic
├── 📂 newgemdashboard/        🖥️ Vite frontend dashboard
│   └── src/
│       ├── components/dashboard/ Dashboard shell + tabs
│       └── lib/                  Supabase · Store · API adapters
├── 📂 newlandingpage/         🌐 Landing page (React Three Fiber)
├── 📂 scripts/                📜 Demo, smoke-test, evidence collection
├── 📂 docs/                   📚 Documentation
└── 📂 evidence/               📋 Session recordings with tx hashes

🧠 Key Technical Highlights

1. Official Circle SDK — Not a Toy Implementation

// Buyer-side: GatewayClient pays agents
import { GatewayClient } from "@circle-fin/x402-batching/client";

const gateway = new GatewayClient({
  chain: "arcTestnet",
  privateKey: process.env.ORCHESTRATOR_PRIVATE_KEY as Hex,
});

const result = await gateway.pay("http://localhost:4021/research");
console.log(`🔗 Explorer: https://testnet.arcscan.app/tx/${result.transaction}`);
// Seller-side: BatchFacilitatorClient verifies + settles
import { BatchFacilitatorClient } from "@circle-fin/x402-batching/server";

const facilitator = new BatchFacilitatorClient({
  url: "https://gateway-api-testnet.circle.com",
});
const { isValid } = await facilitator.verify(payload, requirements);
const { success, transaction } = await facilitator.settle(payload, requirements);

2. Background Settlement Resolution

Gateway payments return immediately with a reference ID. We poll for on-chain settlement and backfill real tx hashes:

// If payment ref isn't a real 0x hash yet, poll in background
if (txHash && !isRealTransactionHash(txHash)) {
  void resolveGatewaySettlement({ gatewayRef: txHash, taskId, onSettled });
}

3. EIP-3009 Gasless Signing

Users never hold ETH and never pay gas directly. The Circle Gateway handles:

  1. Off-chain authorization signing (free)
  2. Batch multiple authorizations together
  3. Single on-chain settlement to Arc L1

4. 5 Deployed Vyper Contracts

All contracts are deployed on Arc testnet with real on-chain interactions — not mocks:

Contract Functions
AgentEscrow createTaskclaimTasksubmitResultapproveCompletion
PaymentSplitter createSplit(recipients[], basisPoints[])distribute()
IdentityRegistry registerAgent(wallet, metadataUri) → ERC-721 NFT
ReputationRegistry giveFeedback(agentId, score)getSummary() → avg score
SpendingLimiter setLimit(agent, amount, window)recordSpending()checkLimit()

📚 Documentation

Document Description
Architectural Whitepaper Full technical deep-dive: system design, economics, contracts, security
�📖 Setup Guide Full step-by-step installation
💰 Margin Analysis Detailed economic comparison — why this only works on Arc
📝 Circle Product Feedback Detailed SDK feedback for $500 Product Feedback prize
📋 Submission Details Full hackathon submission details
🤖 LLM Provider Setup Multi-provider AI configuration (Gemini, Featherless, AI/ML API)
🎯 Pitch Deck 5-slide investor pitch deck
🌐 Landing Page 3D glassmorphism product page (React Three Fiber)
📊 Live Dashboard Real-time agent marketplace dashboard

🏆 Prize Categories We're Competing For

Prize Amount Our Qualification
Online 1st Place $2,500 USDC 260+ real on-chain txns, 5 Vyper contracts, full x402 integration
On-site 1st Place $3,000 USDC Live demo ready, all services dockerized
Product Feedback $500 USDC Detailed Circle SDK feedback covering 5 pain points with code-level suggestions
Google Prize (Online) $1,200 Gemini-powered task routing, reputation scoring, and function calling
Featherless Prize 500 credits Featherless inference for agent responses

Arc Testnet Constants

Constant Value
Chain ID 5042002
RPC https://rpc.testnet.arc.network
USDC 0x3600000000000000000000000000000000000000 (6 decimals, native gas)
Circle Gateway 0x0077777d7EBA4688BDeF3E311b846F25870A19B9
Explorer https://testnet.arcscan.app
Faucet https://faucet.circle.com
SDK Chain Name "arcTestnet"

📜 License

MIT


About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors