Wallet Firewall:EVM 錢包的簽名前安全防護層
Wallet Firewall: A Pre-Signing Security Layer for EVM Wallets
Wallet Firewall 為 EVM 錢包提供簽名前交易安全檢查,會解碼交易、檢查合約並評估風險,給出 SAFE、REVIEW 或 BLOCK 判定及淺白解釋。它以確定性風險引擎作最終判斷,Groq LLM 只負責把分析結果轉成淺白文字,不會覆蓋判定。
What I Built
Wallet Firewall is a pre-signing transaction security layer for EVM wallets.
Every day, people lose funds because they blindly sign transactions they don't understand. A MetaMask popup shows a scary hex string, and the user just clicks "Confirm."
Wallet Firewall solves this, before you sign, it decodes the transaction, checks the contract, and scores the risk. It returns one of three verdicts: SAFE, REVIEW, or BLOCK. Each verdict comes with a plain-language explanation, so you know exactly why a transaction is dangerous before your funds leave your wallet.
Demo
Here is a 60-second walkthrough showing how it analyzes a raw transaction payload and blocks malicious activity:
(Live deployment: wallet-firewall.vercel.app)
Code
🧱 Wallet Firewall
Know what you're signing before you sign it.
A deterministic security layer that analyzes EVM transactions before the user signs them. Decodes, simulates, scores, and explains — with a verdict of SAFE, REVIEW, or BLOCK.
What It Does
| Stage | Description |
|---|---|
| Decode | Extracts function selectors and maps them to signatures |
| Intel | Fetches bytecode, balance, nonce of the target address |
| Simulate | Runs eth_call to catch reverts before signing |
| Score | Deterministic risk engine (0-100) with hard blocks |
| Explain | LLM translates findings to plain English (never overrides verdict) |
| Gate | Disables the sign button when verdict is BLOCK |
Screenshots
Standard ETH transfer — scored SAFE (5/100).
Multicall detected — scored REVIEW (30/100).
Unlimited ERC20 approval — hard blocked (100/100).
ERC20 approval — flagged for review.
Architecture
Wallet -> Transaction -> Decoder -> Contract Intel -> Simulation
-> Asset/Permission Analysis -> Deterministic Risk Engine
-> AI Explanation -> SAFE /…
How I Built It
The stack is Next.js, wagmi, viem, and TypeScript.
The AI Part: Security tools cannot rely on LLMs to make final decisions, because LLMs hallucinate and are non-deterministic. Wallet Firewall uses a deterministic risk engine (hardcoded HARD_BLOCK signals and a 0-100 scoring system) to give the final say.
The Groq LLM is only used for the explanation layer. Once the deterministic engine flags a transaction, the LLM translates the bytecode and state changes into plain English so the user understands the threat. AI explains; the deterministic engine decides.
Why Does Open Innovation Matter?
Open-source AI and open protocols made this possible because EVM (Ethereum) is an open standard, I can use viem and wagmi to decode raw calldata without paying for a closed enterprise API.
For the AI layer, using Groq (which runs open-weight models like gpt-oss-120b) allowed me to build this on a mobile phone in Termux without blowing through a massive API budget. A closed, expensive API would have made a free/indie security tool impossible to build.
My Agent Session
I built this entirely on Android using Termux. I used AI agents heavily as pair programmers. I had the AI act as an auditor to review my Solidity assumptions, debug Webpack vs. Turbopack build errors on ARM64, and help script the 60-second product demo.
Prize Categories
- Side Hustle
來源:DEV Community · dev.to