How I Built a 100% Client-Side Web3 Security Tool with $0 Server Cost
I've always been uneasy about connecting my wallet to random dApps. Even legitimate tools often log your wallet address, IP, and transaction patterns on their backend servers. For a simple operation like checking ERC-20
I've always been uneasy about connecting my wallet to random dApps. Even legitimate tools often log your wallet address, IP, and transaction patterns on their backend servers.
For a simple operation like checking ERC-20 token approvals, why does it need a server at all? The blockchain is the backend.
So, I decided to build an experiment: BaseGuard, a token approval revoker for the Base Network that runs entirely in the browser.
The Problem I Wanted to Solve
Most token revocation tools work great, but they all require you to connect to their backend. This means:
- Your wallet address is logged
- Your IP address is tracked
- Your transaction history can be profiled
For privacy-conscious users, this felt like a tradeoff we shouldn't have to make.
The Architecture (Stupidly Simple)
I wanted to see if I could build a functional Web3 security tool without any backend infrastructure. Here's what I used:
-
Frontend: Single
index.htmlfile with Tailwind CSS (via CDN) - Logic: Vanilla JavaScript + Ethers.js v6
- Backend: None. Zero. Nada.
- Hosting: Netlify Free Tier ($0/month)
- Total monthly cost: $0
The tool interacts directly with the Base Network RPC provided by the user's own wallet (MetaMask, Rabby, Coinbase Wallet, etc.).
Here's the flow:
User Browser → window.ethereum → Ethers.js → Base Network RPC → USDC Smart Contract
That's it. No server in the middle.
The Interesting Part: Payment Flow
Instead of using a centralized payment gateway (Stripe, PayPal) or requiring users to sign up for an account, I implemented a direct smart contract payment.
When a user wants to unlock the "batch revoke" feature, the frontend triggers a USDC transfer on Base Network directly to my wallet. The user approves it in their wallet (MetaMask shows exactly what they're signing), and the funds go straight to me.
No middlemen. No KYC. No server-side verification.
The frontend simply listens for the transaction success event and unlocks the UI locally using localStorage.
The Code (Simplified)
javascript
const USDC_CONTRACT_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
const RECIPIENT_ADDRESS = '0xYOUR_WALLET_ADDRESS'; // Replace with actual address
async function processPayment() {
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();
const contract = new ethers.Contract(USDC_CONTRACT_BASE, ERC20_ABI, signer);
const amount = ethers.parseUnits('1.0', 6);
const tx = await contract.transfer(RECIPIENT_ADDRESS, amount);
const receipt = await tx.wait();
if (receipt.status === 1) {
localStorage.setItem('premium_unlocked', 'true');
}
}
## Try It Out
I'd love to get feedback from the community. You can try the live demo here:
**[BaseGuard Live Demo](https://melodious-bublanina-d5aaca.netlify.app/)**
The basic scan is completely free. If you find it useful and want to test the batch revoke feature, it's a one-time 1 USDC payment on Base Network.
## Open Source
The entire codebase is just one HTML file. You can audit it yourself:
**[GitHub Repository](https://github.com/omsadis66/baseguard)**
I welcome pull requests, issues, or just general feedback.
## Questions for the Community
1. Is privacy actually a concern for you when using Web3 tools?
2. Would you trust a browser-only tool more than one with a backend?
3. What other Web3 utilities could be rebuilt as purely client-side?
---
*Disclaimer: I am the developer of BaseGuard. This article is not financial advice. Always verify smart contract interactions in your wallet before signing. Use any tool at your own risk. DYOR.*
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.