EnvioScout AI

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

EnvioScout AI

Created At

ETHOnline 2025

Project Description

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:

  1. 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.

  2. 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.

  3. 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 counts
  • Native token gas fee calculations (ETH, MATIC, etc.)
  • Multi-chain support with instant switching
  • AI-powered wallet and transaction analysis
  • Responsive design with smooth animations
  • Context-aware AI responses using function calling

The 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.

How it's Made

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 builds
  • Tailwind CSS for utility-first styling with custom dark/light theme implementation
  • Component-based architecture (ChatInterface, MessageBubble, LoadingIndicator)
  • Environment-aware API calls using import.meta.env for seamless local/production switching
  • Markdown rendering for beautifully formatted AI responses
  • Responsive design with CSS animations and hover effects

Backend Architecture:

  • Express.js server with ES modules for modern JavaScript features
  • Modular route structure (chat.js, dashboard.js) for clean separation of concerns
  • CORS configuration with environment-based allowed origins
  • Centralized error handling middleware

Envio 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 access
  • Height queries to dynamically fetch the latest block number
  • Optimized field selection (TransactionField, BlockField) to minimize payload
  • Query recent blocks (latest - 1000) instead of historical data
  • Transaction counting with explicit selection: transactions: [{}]
  • Gas price calculation: averaging transaction gas prices per block
  • Real-time TPS calculation: totalTransactions / totalTimeInSeconds

The trick was discovering that Envio requires explicit transaction selection - without transactions: [{}], 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 queries
  • Prompt engineering with context about supported chains and capabilities
  • Intent detection to route questions to appropriate data sources
  • Retry logic for API resilience
  • Tool definitions that map user queries to Blockscout/Envio functions

Blockscout API Integration:

  • Multi-chain REST API client with chain-specific base URLs
  • Address validation and transaction lookup
  • Token balance queries and transaction history
  • Error handling for network-specific quirks

Partner Technologies:

  • Vercel for serverless deployment (both frontend and backend as serverless functions)
  • dotenv for secure environment variable management
  • axios for HTTP requests with proper error handling

Notable Hacks & Challenges:

  1. The Light Theme Crisis: Initially, dashboard text was completely invisible in light mode because Tailwind's .text-white class wasn't being overridden. Solution: Added comprehensive light theme selectors that explicitly set dark colors for all text elements.

  2. The Ancient Block Problem: Dashboard showed 0 TPS because Envio was returning blocks from 2015 instead of recent ones. Root cause: fromBlock: 0 doesn't mean "recent" - it means "genesis block"! Fixed by first querying archive height, then fetching recent blocks: fromBlock: latestBlock - 1000.

  3. Gas Fee Mystery: Users were confused seeing "M" units for gas fees. We implemented proper gas calculation: (gasUsed × avgGasPrice) / 1e18 to display fees in native tokens (ETH, MATIC) instead of Wei.

  4. Vercel Serverless Adaptation: Express servers don't run directly on Vercel. Solution: Conditional server startup with if (process.env.VERCEL !== '1') to prevent listening on ports in serverless environment, while exporting the app for Vercel's serverless runtime.

  5. 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.

background image mobile

Join the mailing list

Get the latest news and updates