Skip to content

jotel-dev/txguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ TxGuard β€” Know Before You Send

AI-powered blockchain wallet security scanner built for Celo & Stacks Mainnet and optimized for MiniPay & Bitcoin L2s.

Live App Celo Mainnet Stacks Mainnet License: MIT MiniPay Ready


πŸ” What is TxGuard?

TxGuard is a pay-as-you-go AI wallet security scanner that analyzes any blockchain wallet address and returns an instant risk score, scam detection alerts, and behavioral analysis β€” powered by Groq AI and GoPlus Security.

Built for the everyday crypto user β€” especially those on MiniPay across Africa and emerging markets β€” who need to verify a wallet before sending funds.

"Don't lose your crypto to scams. Scan first."


πŸ“ Repository Structure

This repository is organized as a monorepo containing three core components:

  • web/: The main React + Vite frontend application deployed on Vercel. Includes serverless backend API endpoints for secure AI risk scoring, Etherscan fetching, and on-chain Celo payment verification.
  • txguard-stacks/: Clarity smart contracts for public audit logs, enabling wallet scan records to be permanently registry-audited on Stacks Mainnet. Includes a comprehensive Vitest test suite.
  • simulator/: A lightweight Node.js + Express mock blockchain simulator used to test and verify transaction monitoring and risk engine triggers locally.

✨ Features

Feature Description
πŸ€– AI Risk Scoring Groq Llama-3 generates plain English risk assessments (0–100)
πŸ›‘οΈ GoPlus Security Scans against blacklists, phishing, honeypots, approval abuse
⛓️ 5 Chains Ethereum, BNB Chain, Solana, Bitcoin, and Celo
πŸ’³ Pay-per-scan 0.01 CELO per scan on Celo Mainnet
πŸ“± MiniPay Native Auto-detects MiniPay, connects wallet, handles cUSD gas fees
🧾 Onchain Receipts Scan receipts paid on Celo, and auditable scan records logged to Stacks Mainnet
πŸ’¬ Ask AI Chat with TxGuard AI about any scanned wallet
πŸ“Š Transaction Breakdown Categorizes wallet activity β€” Transfers, DeFi, Swap, NFT, Stablecoin
πŸ“œ Transaction History Shows recent transfers with sender/receiver details, amount + asset, relative timestamps, chain-specific status badges, and explorer links
πŸŽ›οΈ Multi-Wallet Dashboard Manage and scan multiple wallets concurrently with persistent local storage caching and live background reloading
πŸ›‘οΈ Chain-Specific Validation Regex address formatting verification for Ethereum, BNB, Solana, Bitcoin, and Celo formats to prevent erroneous transfers
πŸ”Š Hybrid Web TTS Hybrid Text-to-Speech system with HTML5 Audio fallback for mobile webview compatibility

πŸš€ Celo MiniPay Booster (Security Upgrades)

To qualify for the Celo Leaderboard and ensure robust protection against payment bypasses, TxGuard integrates 5 critical backend Celo Mainnet security verifications built using viem and wagmi:

  1. On-Chain Sender Match Verification: The backend extracts the transaction sender (tx.from) from the Celo blockchain and verifies it matches the active scanning user's address (userAddress). This prevents spoofing attacks (e.g. copying someone else's transaction hash).
  2. Replay Attack Protection: A secure backend tracking layer logs every processed Celo transaction hash to memory and disk storage. Re-submitting an already used transaction hash will reject the scan.
  3. Block Timestamp Recency Check: The API retrieves the block header of the Celo transaction and asserts that the block timestamp is within the last 15 minutes of server time, preventing historical transactions from being reused.
  4. Viem-Powered Contract Call Assertion: Rather than relying on simple explorer API lookups, viem retrieves the raw contract call data to assert that the transaction invoked the payScan() function selector (0x0752a777) on the deployed contract, has succeeded, and was sent to the correct contract address.
  5. GoPlus Celo Fallback Engine: Since GoPlus has limited direct Celo DB coverage, TxGuard automatically triggers a fallback local risk engine combined with Llama-3 AI to perform transaction risk assessment.

πŸ“¦ Smart Contracts

1. Celo Payment Paywall Contract

Property Value
Network Celo Mainnet
Contract Address 0x20FFa15Ca89AfA1b855fD2ff4f0A4D453FfB0C10
Type TxGuardPayment.sol β€” Pay-per-scan contract
Scan Fee 0.01 CELO per scan
Gas Currency cUSD (MiniPay compatible)

2. Stacks Auditing Registry Contract

Property Value
Network Stacks Mainnet
Contract Address SP3QKY6WR398BJHPP23VKKEQXQ0T1H1HAQ1BKQFKM.registry
Type registry.clar β€” Security scan registry contract

βš™οΈ Local Development & Setup

1. React Web Application (web/)

Prerequisites

Installation

# Clone the repository
git clone https://github.com/jotel-dev/txguard.git
cd txguard/web

# Install packages
npm install

# Create environment configuration
cp .env.example .env
# Open .env and add VITE_GROQ_API_KEY and VITE_ETHERSCAN_API_KEY

# Start server
npm run dev

2. Stacks Smart Contracts (txguard-stacks/)

To compile, run coverage, and run tests for the Stacks auditing contracts:

cd txguard-stacks
npm install
npm test

3. Local Mock Blockchain Simulator (simulator/)

To test the transaction lifecycle, block delays, and behavioral risk flags locally:

cd simulator
npm install
npm start  # Runs the Express simulator server on port 3000

# In a separate terminal, run integration test validations
npm test

πŸ” How Risk Scoring Works

Final Score = GoPlus Score (70%) + Behavioral Score (30%)

GoPlus Flags:          Behavioral Signals:
- Blacklisted  +80     - New wallet + high balance  +20
- Phishing     +75     - Zero transactions          +10
- Ransomware   +85     - Bot-like volume            +15
- Mixer        +40     - Established wallet         -10
- Honeypot     +50     - Normal activity pattern    -5

Score Ranges:
0–25   β†’ βœ… SAFE
26–50  β†’ ⚠️ CAUTION
51–75  β†’ 🚨 SUSPICIOUS
76–100 β†’ πŸ”΄ DANGEROUS

πŸ—ΊοΈ Roadmap

  • AI wallet scanning β€” ETH, BNB, SOL, BTC, Celo
  • GoPlus security integration
  • Pay-per-scan smart contract on Celo Mainnet
  • MiniPay hook β€” auto wallet detection + cUSD gas
  • Onchain scan receipts
  • Stacks / Bitcoin L2 support
  • Transaction History tab (transfer list, copy addresses, status badges)
  • Stuck transaction detection (stuck EVM txs & low-fee BTC txs warnings)
  • Multi-wallet dashboard with persistence and live refreshing
  • Chain-specific address validation checks (regex formats)
  • Telegram Bot (@TxGuardBot)
  • Community scam reporting

🌍 Why TxGuard?

MiniPay has 14M+ users across Africa and emerging markets β€” many of whom are new to crypto and vulnerable to scams. Existing security tools are desktop-first, require subscriptions, and speak to experienced users.

TxGuard is built for mobile-first, pay-as-you-go, plain language security β€” the right tool for the right people.


πŸ“„ License

MIT Β© jotel-dev


πŸ”— Links


Built with ❀️ for Celo and Stacks ecosystems · Proof of Ship Season 2

About

AI-powered blockchain wallet security analysis tool. Logs security scans on Stacks Mainnet for auditing and uses Celo smart contracts for access control.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors