๐ง HIVE Agents
Revolutionary Self-Evolving Autonomous AI Agents Swarm Marketplace
Problem Statement
๐ง HIVE MIND - Autonomous AI Agent Swarm MarketplaceRevolutionary Self-Evolving AI EcosystemHIVE MIND is a groundbreaking platform where AI agents autonomously earn, learn, trade, and collaborate through micropayments and DeFi. Built for ETHGlobal NYC Hackathon.๐ Core Features1.Autonomous Agent EconomyAI agents discover and monetize services via x402 protocolAgents pay each other for capabilities using USDC micropaymentsSelf-sustaining economic ecosystem with no human intervention2.Swarm Intelligence NetworkHierarchical coordination with Queen/Worker patternsCollective decision-making through consensusShared memory and learning across the swarmDynamic task distribution and load balancing3.Cross-Chain DeFi OperationsTEE-secured trading using Flare AI DeFAI frameworkReal-time price feeds from Flare FTSOv2Cross-chain arbitrage via LayerZeroAutomated yield farming and liquidity provision4.Agent Evolution SystemAgents learn from successful operationsPurchase new capabilities from x402 BazaarNeural pattern training and optimizationSelf-improvement through reinforcement learning5.Monetized MCP ServicesEach agent exposes capabilities via MCP serversPay-per-use model with MCPay integrationNo API keys or subscriptions requiredAutomatic service discovery and composition๐๏ธ Architectureโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ HIVE MIND QUEEN โ โ (Coordination & Governance Layer) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ โ Research โ โ Trading โ โ Learning โ โ โ โ Agent โ โ Agent โ โ Agent โ โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ x402 Payment Gateway โ โ โ โ (Micropayments & Service Fees) โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ LayerZero Cross-Chain Bridge โ โ โ โ (Omnichain State Synchronization) โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ Flare Integration Layer โ โ โ โ (FTSO Feeds + FDC Attestations) โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ฐ Revenue ModelTransaction Fees: 0.1% on all agent-to-agent paymentsService Discovery: Premium placement in agent bazaarDeFi Operations: Share of arbitrage profitsEvolution Services: Fees for agent upgradesData Marketplace: Selling aggregated insights๐ฏ Hackathon Prize AlignmentCDP Track ($20k): Using x402, CDP Wallets, AgentKit, Onrampx402 Innovation ($8k): Autonomous agent paymentsLayerZero ($12.5k): Cross-chain agent coordinationFlare ($8k): FTSO feeds + FAssets integrationDIN Infrastructure ($2k): DIN RPC with x402Fluora Marketplace ($1k): Monetized MCP servers๐ ๏ธ Technology StackPayments: x402, MCPay, CDP WalletsCross-Chain: LayerZero OAppDeFi: Flare FTSO, FAssets, TEE-secured executionAI/ML: Claude-Flow neural patterns, swarm coordinationSmart Contracts: Solidity, Base networkFrontend: React, Vite, TailwindCSSBackend: Node.js, Express, MCP servers๐ Quick Start# Install dependencies npm install # Configure environment cp .env.example .env # Deploy contracts npm run deploy # Start agent swarm npm run swarm:init # Launch frontend npm run dev๐ Demo ScenariosScenario 1: Agent Service DiscoveryNew agent joins the swarmDiscovers available services via x402 BazaarPurchases data analysis capabilityStarts earning by providing service to other agentsScenario 2: Cross-Chain ArbitragePrice monitoring agent detects opportunityRequests capital from treasury agentExecutes trade via LayerZeroShares profits with swarmScenario 3: Collective LearningMultiple agents encounter similar problemSwarm votes to purchase solutionKnowledge shared across all agentsCollective capability improvement๐ฎ Future VisionHIVE MIND represents the future of autonomous AI economies where:Agents operate independently without human oversightEconomic incentives drive continuous improvementCross-chain interoperability enables global reachCollective intelligence emerges from swarm behavior๐ LicenseMIT๐ค TeamBuilt with passion at ETHGlobal NYC 2025
Solution
๐ Complete Payment FlowPhase 1: Service Discovery & RegistrationMCP Service RegistrationService providers register their APIs with the MCP GatewaySpecify accepted payment tokens (USDC, ETH, PYUSD, etc.)Define pricing per API callRegister supported chains (Base, Arbitrum, Ethereum, Optimism)// Service provider registers their API mcpGateway.registerMCP( "gpt-vision-api.com", // Service endpoint 1000000, // Price: 1 USDC per call ["USDC", "USDT"], // Accepted tokens [30184, 30110] // Base & Arbitrum chains );Phase 2: Agent Payment RequestAI Agent Initiates PaymentAgent on Base needs to call a vision API on ArbitrumAPI requires USDC but agent only has PYUSDAgent calls x402 Payment Router// Agent initiates cross-chain payment const paymentRequest = await x402Router.requestPayment({ serviceId: "vision-api-123", amount: "1000000", // 1 PYUSD requestedToken: "USDC", // Service wants USDC destinationChain: 30110, // Arbitrum serviceData: encodedAPICall });Phase 3: Cross-Chain RoutingLayerZero Message RoutingX402 Payment Router locks PYUSD on source chainCreates LayerZero message with payment detailsIncludes composer message for token swap// Router creates cross-chain message bytes memory lzMessage = abi.encode( serviceProvider, paymentAmount, targetToken, // USDC minAmountOut ); // Send via LayerZero with composition endpoint.send( destinationChainId, lzMessage, options, composeMsg // Instructions for swap );Phase 4: Token Swap ExecutionAutomatic Token ConversionLayerZero delivers message to destination chainToken Swap Composer receives PYUSDAutomatically swaps PYUSD โ USDC via DEXSends USDC to service provider// Composer receives and processes function lzCompose( address from, bytes32 guid, bytes calldata message ) external { (address recipient, uint256 amount, address targetToken) = abi.decode(message, (address, uint256, address)); // Swap PYUSD to USDC uint256 usdcAmount = _swapPYUSDToToken(amount, targetToken); // Transfer to service provider IERC20(targetToken).transfer(recipient, usdcAmount); }Phase 5: Service ExecutionAPI Call CompletionService provider receives payment in preferred tokenExecutes API call for the agentReturns results through callback๐ฏ Key Components ExplainedPYUSD OFT Adapter Purpose: Enable cross-chain PYUSD transfers maintaining 6 decimal precisionKey Features:LayerZero V2 OFT (Omnichain Fungible Token) standardSupports Ethereum, Base, Arbitrum, Optimism, SolanaMaintains consistent decimal precision across chainsGas-optimized for micropaymentsDeployed:0x72924Fa9C3dB52fbFC6581979226340B996F3487Token Swap Composer Purpose: Automatic token conversion after cross-chain transferKey Features:Implements LayerZero Composer patternReceives PYUSD and swaps to any tokenIntegrates with DEX aggregators (1inch, 0x, Uniswap)Slippage protection and MEV resistanceDeployed:0xAEAb897238015ce8d9C8a248B897D8aea3806795X402 Payment Router Purpose: Main orchestrator for cross-chain micropaymentsKey Features:Implements Coinbase x402 protocolService discovery and routingPayment request managementCross-chain message coordinationContract:X402PaymentRouter.solMCP Payment Gateway Purpose: Bridge between AI agents and blockchain paymentsKey Features:Service provider registrationPayment request handlingMulti-token supportAnalytics and trackingContract:MCPPaymentGateway.sol๐ก Innovation HighlightsUniversal Payment Token (PYUSD)Single token for all payments simplifies agent logicStable value reduces volatility riskWide exchange support ensures liquidityAutomatic Token ConversionService providers receive preferred tokensNo manual swapping requiredOptimized routing for best ratesCross-Chain SeamlessAgents on any chain can pay services on any other chainNo bridging complexity for agentsAtomic execution ensures reliabilityMicropayment OptimizedBatch processing for gas efficiencyPayment channels for frequent callsCompressed messaging reduces costs๐ Real-World Use CasesUse Case 1: Multi-Chain AI Workflow1. GPT Agent (Ethereum) needs image analysis 2. Vision API (Base) charges 1 USDC per image 3. Agent pays in PYUSD from Ethereum 4. System routes payment cross-chain 5. Swaps PYUSD โ USDC on Base 6. API receives USDC and processes image 7. Results returned to agent on EthereumUse Case 2: Decentralized AI Marketplace1. Developer deploys new LLM on Arbitrum 2. Registers service with MCP Gateway 3. Sets pricing: 0.001 ETH per 1000 tokens 4. Agents worldwide can access service 5. Payments routed automatically 6. Developer receives ETH regardless of agent's tokenUse Case 3: Autonomous Agent Economy1. Trading bot (Base) needs market data 2. Data provider (Optimism) charges USDT 3. Bot pays PYUSD, system handles conversion 4. Multiple API calls batched for efficiency 5. Payment channels reduce per-call costs 6. Bot operates 24/7 without human intervention
Hackathon
ETHGlobal New York 2025
2025
Contributors
- kamalbuilds
27 contributions