SmartMarket
A decentralized carbon credit marketplace on Ethereum for transparent, efficient trading of offsets
Problem Statement
๐ฑ A2A Carbon Credit Marketplace - Complete Project DescriptionWhat This Project Is The A2A Carbon Credit Marketplace is a comprehensive, AI-powered carbon credit trading platform that bridges the physical world of carbon sequestration with the digital economy of blockchain payments. It's essentially a "smart marketplace" where companies can sell carbon credits generated from real environmental projects, and buyers can purchase them using cryptocurrency, all orchestrated by intelligent AI agents.๐ฏ Core Concept Imagine a marketplace where:IoT sensors in forests, farms, or carbon capture facilities monitor real-time carbon sequestrationAI agents analyze this data and predict how many carbon credits will be generatedCompanies can pre-sell these future carbon credits at discounted ratesBuyers can purchase credits using cryptocurrency (HBAR, ETH, MATIC)Everything is automated through AI agents that understand natural language๐๏ธ System ArchitectureThe Three-Layer Systemโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ WEB INTERFACE โ โ (Next.js 15 + React 19 + Tailwind CSS) โ โ โข Real-time chat with AI agents โ โ โข Live agent status monitoring โ โ โข Payment interface for blockchain transactions โ โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ AI AGENT ECOSYSTEM โ โ (8 Specialized Agents powered by Google ADK + Gemini) โ โ โข OrchestratorAgent: Central routing hub โ โ โข PaymentAgent: Multi-network blockchain payments โ โ โข IoTCarbonAgent: Real-time sensor data processing โ โ โข CarbonCreditAgent: Marketplace management โ โ โข PrebookingAgent: Future credit prebooking โ โ โข WalletBalanceAgent: Multi-network balance checking โ โ โข HederaPaymentAgent: Autonomous HBAR transfers โ โ โข TellTimeAgent & GreetingAgent: Utility services โ โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ PHYSICAL WORLD INTEGRATION โ โ โข ESP32 IoT devices with CO2/humidity sensors โ โ โข MQTT broker for real-time data transmission โ โ โข PostgreSQL database for marketplace data โ โ โข Redis for caching and session management โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ค The AI Agent System How the AI Agents Work The system uses 8 specialized AI agents, each with a specific role, all coordinated by a central OrchestratorAgent that uses Google's Gemini LLM to understand user requests and route them to the appropriate specialist.OrchestratorAgent (The Brain) Port: 10002 Role: Central routing hub that understands user intent Technology: Google ADK + Gemini 2.5 Flash How it works: Listens to user requests like "Buy 100 carbon credits" Uses LLM to understand the intent Automatically routes to the right specialist agent Coordinates multi-agent workflowsPaymentAgent (The Bank) Port: 10005 Role: Executes real blockchain transactions Supported Networks: Hedera (HBAR), Ethereum (ETH), Polygon (MATIC) Real Transactions: Not simulations - actual cryptocurrency transfers Features: Address validation, transaction tracking, multi-network supportIoTCarbonAgent (The Environmental Monitor) Port: 10006 Role: Processes real-time sensor data from IoT devices Data Sources: MQTT messages from ESP32 devices Capabilities: Real-time carbon sequestration monitoring Carbon credit predictions based on sensor data Company-based data segregation Critical alert processing 4. CarbonCreditAgent (The Marketplace) Port: 10003 Role: Manages the carbon credit marketplace Database: PostgreSQL with company and credit data Features: Price analysis, negotiation, offer management AI Negotiation: Uses Gemini to find the best deals 5. PrebookingAgent (The Future Sales) Port: 10007 Role: Handles pre-sales of future carbon credits IoT Integration: Uses predictions from IoTCarbonAgent Discount System: 5% discount for early booking Confidence-Based: Only creates prebookings when prediction confidence > 70% HederaPaymentAgent (The Autonomous Bank) Port: 10009 Role: Autonomous HBAR transfers using natural language Technology: TypeScript + Hedera Agent Kit + LangChain Features: Natural language payment processing, autonomous execution WalletBalanceAgent (The Accountant) Port: 10004 Role: Multi-network balance checking Supported Networks: Hedera, Ethereum, Polygon Features: Real-time balance queries, transaction history๐ฐ Blockchain Payment SystemMulti-Network Support The system supports three major blockchain networks:Hedera Network (Primary) Currency: HBAR Address Format: 0.0.123456 Benefits: Low fees, fast transactions (3-5 seconds) Real Transactions: Actual HBAR transfers with transaction IDsEthereum Network Currency: ETH + ERC20 tokens (USDC, USDT) Address Format: 0x... (40 hex characters) Features: Gas optimization, token support๐ข Company Onboarding & MarketplaceBusiness ModelFor Carbon Credit Companies Registration: KYC/AML verification process IoT Integration: Connect their carbon sequestration devices Credit Inventory: Real-time tracking of available credits Pricing Tools: Dynamic pricing based on market conditions Direct Sales: B2B interface for corporate buyersFor Buyers Credit Categories: Forestry, renewable energy, energy efficiency, waste management Quality Ratings: AI-powered assessment of carbon credit quality Bulk Trading: Large-scale corporate purchases Payment Options: Multiple cryptocurrency payment methodsRevenue Streams Transaction Fees: 2-5% commission on carbon credit sales Subscription Plans: Premium features for enterprise clients API Licensing: Usage-based pricing for API access Consulting Services: Implementation and integration support๐ Data Flow ArchitectureComplete User Journey User Request: "I want to buy 100 carbon credits" Web Interface: Sends request to OrchestratorAgent Orchestration: Gemini LLM routes to CarbonCreditAgent Marketplace: Searches database for available credits Payment: Routes to PaymentAgent for blockchain transaction Execution: Real HBAR/ETH/MATIC transfer executed Confirmation: Transaction ID returned to user IoT Monitoring: Concurrent real-time carbon sequestration trackingIoT Data Pipeline ESP32 Sensors: Monitor CO2, humidity, carbon sequestration MQTT Transmission: Real-time data sent to broker IoTCarbonAgent: Processes data and makes predictions CarbonCreditAgent: Updates marketplace with new credits PrebookingAgent: Creates future sales based on predictions๐ ๏ธ Technical ImplementationBackend Technologies Python 3.11+: Core agent system Google ADK: Agent Development Kit for LLM integration Gemini 2.5 Flash: Large Language Model for natural language processing FastAPI/Starlette: Web framework for JSON-RPC endpoints PostgreSQL: Database for marketplace data Redis: Caching and session management MQTT: Real-time IoT communicationBlockchain Integration Hedera SDK: Python SDK for HBAR transactions Web3.py: Ethereum and Polygon integration Hedera Agent Kit: TypeScript-based autonomous payments Multi-network Support: Unified interface for different blockchainsIoT Hardware ESP32: Microcontroller with WiFi and sensors PlatformIO: Development environment MQTT Client: Real-time data transmission OLED Display: Local monitoring interface๐ Key InnovationsAI-Powered Agent Orchestration Natural Language Understanding: Users can interact in plain English Intelligent Routing: LLM automatically chooses the right agent Context Awareness: Maintains conversation history across agents Multi-Agent Coordination: Complex workflows across multiple agentsReal-Time IoT Integration Live Carbon Monitoring: Real-time sensor data from physical devices Predictive Analytics: AI-powered carbon credit forecasting. Company Segregation: Multi-tenant data processing Critical Alerts: Immediate notification of environmental issuesMulti-Network Blockchain Support Unified Interface: Single system supporting multiple blockchains Real Transactions: Actual cryptocurrency transfers, not simulations Autonomous Execution: Natural language to blockchain execution Transaction Tracking: Complete audit trail๐ฏ Use Cases & ApplicationsFor Environmental Companies Carbon Credit Sales: Monetize environmental projects IoT Integration: Connect physical carbon sequestration devices Marketplace Access: Reach global buyers Real-time Monitoring: Track carbon credit generationFor Corporate Buyers Carbon Offsetting: Purchase credits to offset emissions Bulk Trading: Large-scale corporate purchases Quality Assurance: AI-verified carbon credit quality Payment Flexibility: Multiple cryptocurrency optionsFor Developers API Access: Developer-friendly APIs for integration White-label Solutions: Customizable platform for partners Agent Development: Extend the system with new agents Blockchain Integration: Add support for new networks๐ฎ Future PotentialThis system demonstrates the future of AI-powered environmental markets where: Physical environmental projects are directly connected to digital marketplaces AI agents handle complex business logic automatically Blockchain technology ensures transparent and secure transactions IoT devices provide real-time environmental data Natural language interfaces make complex systems accessibleThe A2A Carbon Credit Marketplace represents a paradigm shift in how environmental assets are traded, moving from manual, paper-based systems to intelligent, automated, blockchain-powered marketplaces that can scale globally while maintaining transparency and accountability.
Solution
Core Architecture & Technologies This is a sophisticated Agent-to-Agent (A2A) Carbon Credit Marketplace built using Google's Agent Development Kit (ADK) with Gemini LLM for intelligent orchestration. The system combines multiple cutting-edge technologies:๐ค Multi-Agent AI System (Python Backend)8 Specialized AI Agents powered by Google ADK and Gemini 2.5 FlashOrchestratorAgent (Port 10002): Central LLM-based routing hub that intelligently delegates tasksJSON-RPC 2.0 Protocol: Standardized agent-to-agent communicationSession Management: Context-aware conversations across agents๐ Modern Web Frontend (Next.js 15)React 19 with TypeScript for type safetyTailwind CSS 4 for modern, responsive designReal-time WebSocket communication with A2A backendAgent status monitoring with live indicatorsโ๏ธ Multi-Network Blockchain IntegrationHedera HBAR: Real transaction execution using Hedera SDKEthereum & Polygon: Web3.py integration for ETH/MATIC transfersERC20 Token Support: USDC, USDT compatibilityAutonomous Payment Agent: TypeScript-based using Hedera Agent Kit๐ฑ Real-Time IoT IntegrationESP32 Hardware: PlatformIO-based carbon sequestration monitoring MQTT Broker: Mosquitto for real-time sensor data transmission Company-Based Data Segregation: Multi-tenant IoT data processing Carbon Credit Predictions: AI-powered forecasting from sensor data๐ Key Technical InnovationsLLM-Powered Agent Discovery The orchestrator automatically discovers child agents at startup and builds dynamic routing rules based on their capabilities.Real-Time IoT Integration ESP32 devices publish company-specific carbon sequestration data via MQTT, which the IoT Carbon Agent processes for predictions.Autonomous Blockchain Payments The Hedera Payment Agent uses natural language processing to execute real HBAR transfers without manual intervention.Multi-Network Wallet Support Single interface supporting Hedera, Ethereum, and Polygon networks with automatic address validation.Company-Based Carbon Credit System IoT data is segregated by company, enabling targeted carbon credit predictions and prebooking systems.๐ ๏ธ Partner Technologies & Benefits Google ADK & Gemini Intelligent Task Routing: LLM automatically delegates to appropriate agents Natural Language Processing: Users can interact in plain English Context Awareness: Maintains conversation history across agents Hedera Network Low-Cost Transactions: HBAR transfers with minimal fees Fast Settlement: 3-5 second transaction confirmation Real Transaction Execution: Not simulations - actual blockchain transactionsMQTT & IoT Integration Real-Time Data: Live carbon sequestration monitoring Scalable Architecture: Supports multiple companies and devices Predictive Analytics: AI-powered carbon credit forecasting๐ฏ Notable Technical Achievements Real Blockchain Integration: Successfully executes actual HBAR, ETH, and MATIC transfers Multi-Agent Orchestration: 8 specialized agents working together seamlessly IoT-to-Blockchain Pipeline: From sensor data to carbon credit transactions Company Onboarding System: Complete B2B marketplace with KYC/AML features Autonomous Payment Processing: Natural language to blockchain execution ๐ Performance Metrics Agent Response Time: <2 seconds Blockchain Transactions: 3-5 seconds (Hedera) MQTT Data Processing: Real-time Web Interface: <1 second load time This project showcases a sophisticated integration of AI agents, blockchain technology, IoT hardware, and modern web development to create a comprehensive carbon credit marketplace that bridges the physical world (utilizing IoT sensors) with the digital economy (enabling blockchain payments) through intelligent AI orchestration.
Hackathon
ETHOnline 2025
2025
Prizes
- ๐
Best Use of Hedera Agent Kit & Google A2A2nd place
Hedera
Contributors
- NirajBhattarai
25 contributions