jotel-dev/txguard

GitHub: jotel-dev/txguard

TxGuard 是一款基于 AI 的区块链钱包安全分析工具,通过风险评分和诈骗检测帮助加密货币用户在发送资金前验证目标钱包安全性。

Stars: 1 | Forks: 0

# 🛡️ TxGuard — 发送前请先了解 [![在线应用](https://img.shields.io/badge/Live%20App-txguard--gules.vercel.app-orange?style=for-the-badge)](https://txguard-gules.vercel.app) [![Celo Mainnet](https://img.shields.io/badge/Celo-Mainnet-35D07F?style=for-the-badge&logo=celo)](https://celoscan.io/address/0x20FFa15Ca89AfA1b855fD2ff4f0A4D453FfB0C10) [![Stacks Mainnet](https://img.shields.io/badge/Stacks-Mainnet-5546FF?style=for-the-badge&logo=stacks)](https://explorer.hiro.so/txid/SP3QKY6WR398BJHPP23VKKEQXQ0T1H1HAQ1BKQFKM.registry?chain=mainnet) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](LICENSE) [![MiniPay Ready](https://img.shields.io/badge/MiniPay-Ready-blue?style=for-the-badge)](https://txguard-gules.vercel.app) ## 🔍 什么是 TxGuard? TxGuard 是一款**按量付费的 AI 钱包安全扫描器**,可分析任何区块链钱包地址,并返回即时风险评分、诈骗检测警报和行为分析 —— 由 Groq AI 和 GoPlus Security 提供支持。 专为日常加密货币用户打造 —— 特别是非洲和新兴市场 **MiniPay** 上的用户 —— 他们需要在发送资金前验证钱包。 ## ✨ 功能 | 功能 | 描述 | |---|---| | 🤖 **AI 风险评分** | Groq Llama-3 生成通俗易懂的风险评估(0–100) | | 🛡️ **GoPlus Security** | 扫描黑名单、钓鱼、蜜罐和恶意授权 | | ⛓️ **5 条链** | Ethereum、BNB Chain、Solana、Bitcoin 和 Celo | | 💳 **按次扫描付费** | Celo Mainnet 上每次扫描 0.01 CELO | | 📱 **MiniPay 原生** | 自动检测 MiniPay,连接钱包,处理 cUSD gas 费用 | | 🧾 **链上收据** | 在 Celo 上支付扫描收据,并将可审计的扫描记录记录到 Stacks Mainnet | | 💬 **Ask AI** | 与 TxGuard AI 聊天,了解任何已扫描的钱包 | | 📊 **交易明细** | 对钱包活动进行分类 —— Transfers、DeFi、Swap、NFT、Stablecoin | ## 🚀 在线演示 **Web App:** [txguard-gules.vercel.app](https://txguard-gules.vercel.app) **在 MiniPay 中:** 1. 打开 MiniPay 应用 2. 点击浏览器图标 3. 访问 `txguard-gules.vercel.app` 4. TxGuard 会自动检测 MiniPay 并切换至 Celo 模式 ## 📦 智能合约 ### 1. Celo 支付门控合约 | 属性 | 值 | |---|---| | **网络** | Celo Mainnet | | **合约地址** | [`0x20FFa15Ca89AfA1b855fD2ff4f0A4D453FfB0C10`](https://celoscan.io/address/0x20FFa15Ca89AfA1b855fD2ff4f0A4D453FfB0C10) | | **类型** | `TxGuardPayment.sol` — 按次扫描付费合约 | | **扫描费用** | 每次扫描 `0.01 CELO` | | **Gas 货币** | cUSD(兼容 MiniPay) | ### 2. Stacks 审计注册表合约 | 属性 | 值 | |---|---| | **网络** | Stacks Mainnet | | **合约地址** | [`SP3QKY6WR398BJHPP23VKKEQXQ0T1H1HAQ1BKQFKM.registry`](https://explorer.hiro.so/txid/SP3QKY6WR398BJHPP23VKKEQXQ0T1H1HAQ1BKQFKM.registry?chain=mainnet) | | **类型** | `registry.clar` — 安全扫描注册表合约 | | **功能** | 针对目标链、钱包地址和风险评分进行公开审计 | ### 合约函数 ``` payScan() // Pay for a wallet scan (payable) scanFee() // Get current scan fee totalScans() // Total scans processed updateFee() // Update fee (owner only) withdraw() // Withdraw collected fees (owner only) ``` ## 🛠️ 技术栈 | 层级 | 技术 | |---|---| | **前端** | React + Vite | | **样式** | 自定义 CSS —— 毛玻璃效果,深色模式,响应式 | | **AI** | Groq API — Llama-3.1-8b-instant | | **安全数据库** | GoPlus Security API | | **区块链数据** | Etherscan V2 API (ETH, BNB, Celo), Solana RPC, Blockstream (BTC) | | **智能合约** | Solidity 0.8.20 — 部署在 Celo Mainnet | | **Web3** | 注入的 `window.ethereum` — 兼容 MiniPay 和 Valora | | **托管** | Vercel | ## ⚙️ 本地开发 ### 前置条件 - Node.js v18+ - 一个 Groq API 密钥 — [console.groq.com](https://console.groq.com) - 一个 Etherscan API 密钥 — [etherscan.io/apis](https://etherscan.io/apis) ### 设置 ``` # 克隆 repo git clone https://github.com/jotel-dev/txguard.git cd txguard/web # 安装 dependencies npm install # 创建 environment file cp .env.example .env # 将你的 API keys 添加到 .env # 启动 dev server npm run dev ``` ### 环境变量 在 `web/` 目录下创建一个 `.env` 文件: ``` VITE_GROQ_API_KEY=your_groq_api_key VITE_ETHERSCAN_API_KEY=your_etherscan_api_key ``` ## 📱 在 MiniPay 中测试 1. 启动你的本地开发服务器 (`npm run dev`) 2. 使用 ngrok 暴露你的端口: ``` ngrok http 5173 ``` 3. 复制 `https://...ngrok-free.app` URL 4. 在手机上打开 **MiniPay** 5. 启用 **开发者模式** — 在 设置 → 关于 中连续点击版本号 6. 进入 **开发者设置 → 加载测试页面** -> 粘贴 ngrok URL 7. 扫描钱包并批准 Celo 交易! ## 🔐 风险评分的工作原理 ``` 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 ``` ## 🗺️ 路线图 - [x] AI 钱包扫描 — ETH, BNB, SOL, BTC, Celo - [x] 集成 GoPlus Security - [x] 在 Celo Mainnet 上的按次扫描付费智能合约 - [x] MiniPay hook — 自动钱包检测 + cUSD gas 费用 - [x] 链上扫描收据 - [ ] Telegram 机器人 (@TxGuardBot) - [ ] 卡顿交易检测 - [ ] 多钱包仪表板 - [x] Stacks / Bitcoin L2 支持 - [ ] 社区诈骗举报 ## 🌍 为什么选择 TxGuard? MiniPay 在非洲和新兴市场拥有 **1400 万以上用户** —— 其中许多人是加密货币新手,极易受到诈骗攻击。现有的安全工具以桌面端为主,需要订阅,并且是为有经验的用户设计的。 TxGuard 专为**移动优先、按量付费、通俗易懂**的安全需求而构建 —— 为对的人提供对的工具。 ## 📄 许可证 MIT © [jotel-dev](https://github.com/jotel-dev) ## 🔗 链接 - 🌐 **在线应用:** [txguard-gules.vercel.app](https://txguard-gules.vercel.app) - 📜 **合约:** [celoscan.io](https://celoscan.io/address/0x20FFa15Ca89AfA1b855fD2ff4f0A4D453FfB0C10) - 🐦 **Twitter:** [@TxGuardBot](https://twitter.com/TxGuardBot) 即将推出 - 💬 **Telegram 机器人:** [@TxGuardBot](https://t.me/TxGuardBot) 即将推出 *用 ❤️ 为 Celo 和 Stacks 生态系统打造 · Proof of Ship Season 2*
标签:AI风险分析, Web3, 加密钱包, 区块链安全, 反诈骗, 智能合约, 自定义脚本