← Back to home

TonEthBot

Bridging Ukraine & Russia through crypto transfers, wallet connections, and cross-border swaps.

Problem Statement

TonEthBot - Uniting Hearts Through CryptoOur Telegram chatbot bridges divides between people in conflict zones like Russia and Ukraine through the universal language of cryptocurrency. Using both TON and Ethereum blockchains, users can connect their wallets, check balances, and exchange digital assets seamlessly across borders.Built with 1inch API integration for optimal swap rates, TonEthBot facilitates financial interactions when traditional banking systems fail. Beyond transactions, it creates a neutral space where individuals can engage in direct peer-to-peer value exchange regardless of geopolitical barriers.Available in English, Ukrainian, and Russian, this multi-language bot empowers users to maintain financial connections when other communication channels break down, proving that blockchain technology can be a powerful tool for peace.

Solution

Building the TonEthBot: Bridging Conflict Zones Through CryptocurrencyProject OverviewWe built TonEthBot, a Telegram bot designed to facilitate cryptocurrency exchanges between people in conflict zones like Russia and Ukraine. Our core mission was to create a neutral financial bridge when traditional systems fail.Technology StackPython: The entire bot is written in Python, chosen for its robust libraries and ease of development.aiogram: We used this asynchronous framework for Telegram Bot API to handle user interactions efficiently.dotenv: For secure environment variable management, keeping sensitive API keys protected.UUID: Generated unique IDs for each wallet connection request to maintain session integrity.Core FunctionalityMulti-language Support: The bot operates in English, Ukrainian, and Russian, using a custom text management system with language-specific dictionaries.Wallet Integration:Implemented direct connections to both Ethereum (via MetaMask) and TON walletsUsed deep links to navigate users to their respective wallet apps (Tonkeeper for TON and MetaMask for ETH)Created a simple but effective validation system for wallet addressesAdded dedicated/connect_metamaskand/connect_toncommands for direct wallet connections1inch API Integration:Leveraged the 1inch API to provide users with real-time swap rates between different tokensThis allows users to make informed decisions before executing exchangesCommand Structure:/start- Entry point with language selection/connect- Multi-wallet connection system/connect_metamask- Direct connection to MetaMask wallet/connect_ton- Direct connection to TON wallet/wallet- View wallet addresses and balances/receive- Generate address details for receiving funds/send- Sending functionality (in development)/swap- Crypto exchange functionality using 1inch rates/language- Language preferencesTechnical Challenges & SolutionsOne of our hacky but effective solutions was implementing a "pending connections" system using UUID. Rather than maintaining complex state machines, we generate a unique ID for each wallet connection request and store it in a dictionary. This allows multiple users to connect wallets simultaneously without conflicts.For wallet validation, we implemented basic pattern matching that checks address formats (0x... for ETH and EQ/UQ... for TON) without requiring full blockchain validation, making the bot responsive even in areas with poor internet connectivity.Partner Technologies Integration1inch API: Instead of building our own DEX aggregator, we tapped into 1inch's robust API for optimal swap rates. This saved significant development time while providing users with the best possible exchange rates.TON Connect: For TON wallet integration, we implemented a simplified version of the TON Connect protocol with direct links to Tonkeeper through our/connect_toncommand.MetaMask Deep Links: We used MetaMask deep links via our/connect_metamaskcommand to facilitate smooth wallet connections without requiring users to navigate through multiple menus.Our approach prioritized accessibility and simplicity, ensuring that users in conflict zones with potentially limited technical knowledge could easily connect wallets and exchange assets across borders, regardless of geopolitical tensions.

Hackathon

ETHGlobal Unite

2025

Contributors