
CoinBot
Request, Earn and Pay with Crypto.
Demo
About
The problem it solves # 🚀 CoinBot — Secure Web3 Messaging with Onchain Power **CoinBot** transforms how users interact in Web3 — combining encrypted wallet-to-wallet messaging with seamless crypto payments on **Base**. CoinBot is more than just chat agent, it’s a **trustless coordination layer for money and people**, especially in emerging markets where Web3 adoption is surging. ## 🔐 What It Does CoinBot enables users to: - **Chat securely** using wallet-based identity (via XMTP) - **Send or request crypto** directly within conversations — no tab switching - **Confirm payments instantly** with onchain proofs and explorer links - **Get real-time push alerts** for messages and transactions - **Speak your language** with multilingual support for major African dialects (coming soon) All powered by the **Base L2 network** for low fees and fast confirmations. --- ## 💡 Why It Matters Most crypto interactions today are fragmented and risky: - You chat on Telegram, then switch apps to pay - You copy-paste addresses (a recipe for scams) - You can’t verify the other party’s wallet on-chain - You miss time-sensitive messages or payouts **CoinBot solves all this.** It puts everything you need to transact securely in one place — messages, payments, and notifications — with your wallet as your identity. --- ## ✅ Use Cases - **Freelancers & clients** agreeing to terms and paying in crypto - **Merchants and customers** coordinating orders and invoices - **Friends** splitting bills or gifting tokens - **DAOs** coordinating bounties and grants securely --- ## 🔄 How It Makes Life Easier - **Safer**: No copy-pasting of wallet addresses. Everything is verified. - **Faster**: Send tokens while chatting — no tab switching. - **Smarter**: Automatically formats messages like “send 0.01 ETH to…” into real transactions. - **Localized**: Multilingual support makes it inclusive from day one.
How it's made
Challenges we ran into Other than stubborn errors with newer versions of xmtp/browser-sdk, which kept failing with minimal debug procedures, not triggering the signing prompt with connected wallet, below are some of the notable challenges we experienced. ### 🔍 1. **Silent Contract Call Failures** We ran into persistent errors while calling `balanceOf()` on ERC-20 contracts across testnets like Base Sepolia. Despite using valid ABIs and checksummed addresses, the function kept returning empty data (`"0x"`), causing `ContractFunctionExecutionError`. **Solution**: - Verified contract addresses for each network manually (some tokens don’t exist on certain chains). - Added defensive checks to only call contracts that exist on the current network. --- ### 🏗️ 2. **Invalid or Misformatted Addresses** Some wallet addresses were flagged as invalid due to checksum mismatches or incorrect formatting — especially when passed as string literals or unvalidated user input. **Solution**: - Used Viem’s `isAddress()` and `getAddress()` helpers to validate and normalize addresses. - Enforced checksummed formatting across the app, especially in contract call arguments. --- ### 📉 3. **BigNumber Underflow Errors** Passing decimal balances directly into onchain functions led to `NUMERIC_FAULT` underflow errors, especially with tokens like USDC that have 6 decimals. **Solution**: - Switched to using `parseUnits()` from Viem to convert stringified numbers into proper `BigInt` values. - Standardized decimal handling across tokens to avoid mismatches. --- ### 🌐 4. **Reliable Wallet Detection Across Browsers** Supporting multiple wallets (MetaMask, Trust Wallet, Phantom, Coinbase Wallet) proved tricky due to inconsistent injection behavior and window detection quirks. **Solution**: - Switched to **Reown Modal** and **Wagmi** with `WalletClient` to handle wallet onboarding and fallback logic cleanly. - Unified provider handling using a single connection layer to reduce friction for users.