← Back to home

EnvioScout AI

Ask blockchain questions in plain English. Powered by Envio, Gemini AI & Blockscout API.

Problem Statement

EnvioScout AI is an intelligent blockchain analytics assistant that bridges the gap between complex blockchain data and everyday users through natural language interaction.The project combines three powerful technologies:Envio HyperSync- Ultra-fast blockchain indexing that queries recent blocks across multiple EVM chains (Ethereum, Polygon, Optimism, Base, Arbitrum) in milliseconds instead of minutes. This enables real-time statistics like TPS, gas fees, and transaction counts without the performance bottlenecks of traditional RPC calls.Google Gemini AI- Advanced language model that understands user intent and translates natural language questions into structured blockchain queries. Users can ask "What's the current gas price on Ethereum?" or "Analyze this wallet address" without knowing complex APIs or blockchain terminology.Blockscout API- Comprehensive multi-chain explorer data that provides detailed transaction history, wallet analysis, and token information across all supported networks.The application features a beautiful React-based chat interface with dark/light themes, an interactive multi-chain dashboard showing real-time network statistics, and intelligent AI responses with markdown formatting. Users can seamlessly switch between chains, copy AI responses, and get instant insights into blockchain activity.Key features include:Real-time TPS calculation from actual transaction countsNative token gas fee calculations (ETH, MATIC, etc.)Multi-chain support with instant switchingAI-powered wallet and transaction analysisResponsive design with smooth animationsContext-aware AI responses using function callingThe project solves the problem of blockchain data accessibility by making complex analytics conversational and intuitive, perfect for traders, developers, and blockchain enthusiasts who want quick insights without diving into multiple explorer interfaces or writing complex queries.

Solution

EnvioScout AI is built as a full-stack application with a React frontend and Express backend, architected to handle real-time blockchain data efficiently.Frontend Architecture:Built with Vite + React for lightning-fast development and optimal production buildsTailwind CSS for utility-first styling with custom dark/light theme implementationComponent-based architecture (ChatInterface, MessageBubble, LoadingIndicator)Environment-aware API calls using import.meta.env for seamless local/production switchingMarkdown rendering for beautifully formatted AI responsesResponsive design with CSS animations and hover effectsBackend Architecture:Express.js server with ES modules for modern JavaScript featuresModular route structure (chat.js, dashboard.js) for clean separation of concernsCORS configuration with environment-based allowed originsCentralized error handling middlewareEnvio HyperSync Integration (The Game-Changer):This was the most technically challenging and rewarding part. Traditional blockchain indexing is painfully slow - querying 1000 blocks on Ethereum via standard RPC can take 30+ seconds and often times out.Envio's HyperSync solved this with:Bearer token authentication for authorized accessHeight queries to dynamically fetch the latest block numberOptimized field selection (TransactionField, BlockField) to minimize payloadQuery recent blocks (latest - 1000) instead of historical dataTransaction counting with explicit selection:transactions: [{}]Gas price calculation: averaging transaction gas prices per blockReal-time TPS calculation: totalTransactions / totalTimeInSecondsThe trick was discovering that Envio requires explicit transaction selection - withouttransactions: [{}], the query returns zero transactions. We also had to optimize from querying 74,730 blocks (which timed out) down to just the most recent 1000 blocks, reducing query time from 30+ seconds to under 2 seconds.Google Gemini AI Integration:Function calling (tool use) for structured blockchain queriesPrompt engineering with context about supported chains and capabilitiesIntent detection to route questions to appropriate data sourcesRetry logic for API resilienceTool definitions that map user queries to Blockscout/Envio functionsBlockscout API Integration:Multi-chain REST API client with chain-specific base URLsAddress validation and transaction lookupToken balance queries and transaction historyError handling for network-specific quirksPartner Technologies:Vercelfor serverless deployment (both frontend and backend as serverless functions)dotenvfor secure environment variable managementaxiosfor HTTP requests with proper error handlingNotable Hacks & Challenges:The Light Theme Crisis:Initially, dashboard text was completely invisible in light mode because Tailwind's.text-whiteclass wasn't being overridden. Solution: Added comprehensive light theme selectors that explicitly set dark colors for all text elements.The Ancient Block Problem:Dashboard showed 0 TPS because Envio was returning blocks from 2015 instead of recent ones. Root cause:fromBlock: 0doesn't mean "recent" - it means "genesis block"! Fixed by first querying archive height, then fetching recent blocks:fromBlock: latestBlock - 1000.Gas Fee Mystery:Users were confused seeing "M" units for gas fees. We implemented proper gas calculation:(gasUsed × avgGasPrice) / 1e18to display fees in native tokens (ETH, MATIC) instead of Wei.Vercel Serverless Adaptation:Express servers don't run directly on Vercel. Solution: Conditional server startup withif (process.env.VERCEL !== '1')to prevent listening on ports in serverless environment, while exporting the app for Vercel's serverless runtime.Comment Removal for Professional Look:Used PowerShell regex to strip all single-line and multi-line comments while preserving URLs:(?<!:)//(?!/)[^\r\n]*for single-line,/\*[\s\S]*?\*/for multi-line.The end result is a blazingly fast, production-ready blockchain analytics platform that makes complex data accessible through conversation. The combination of Envio's speed, Gemini's intelligence, and Blockscout's comprehensive data creates a unique user experience that's far superior to traditional blockchain explorers.

Hackathon

ETHOnline 2025

2025

Contributors