Inspiration
I wanted to solve a simple but important problem: How can people track their expenses and understand their financial habits without giving their private data to cloud servers?
Most finance apps require accounts, cloud storage, third-party analytics, or backend servers. I wanted to build something opposite:
- fully local
- privacy-first
- wallet-secured
- beginner-friendly
- running simple ML models directly on the device
This is where the idea for SafePay AI came from — a decentralized financial tool where your data never leaves your device, and your wallet is your identity.
What it does
SafePay AI is a decentralized, privacy-first financial management tool that runs entirely in the browser.
No backend, no cloud, no data leaks.
It provides:
- Wallet-based authentication
- Local-only encrypted expense storage
- Automatic expense categorization
- Budget recommendations
- Fraud/anomaly detection
- Spending pattern recognition
- Visual dashboards and analytics
- Optional AES-256 encryption using wallet signature
Everything is processed on-device using lightweight ML models.
How we built it
SafePay AI is built as a 100% client-side web application.
Technology Used
- React + TypeScript for UI
- IndexedDB for local storage
- ethers.js for wallet connection
- AES-256 encryption, with keys derived from wallet signatures
- Recharts for charts and analytics
- Lightweight on-device ML models (no servers, no cloud)
- Webpack/Vite for bundling and performance optimization
AI Components (Non-LLM, Local Models)
1. Expense Categorizer
Simple ML classifier predicting categories from text/tags.
2. Budget Recommendation Engine
Statistical and rule-based system for monthly budget suggestions.
3. Anomaly Detection
Detects risky or unusual transactions using:
[
z = \frac{x - \mu}{\sigma}
]
4. Pattern Recognition
Learns repeated spending habits like subscriptions.
5. Trend Analysis
Shows spending evolution over time.
All models run entirely in the browser.
Challenges we ran into
No backend = everything must run locally
ML, encryption, storage, and analytics all needed heavy optimization.UI/UX complexity with sensitive actions
Wallet connection, encryption choices, and logging expenses must be smooth and intuitive.Balancing ML accuracy with browser performance
Large models were slow, so we built optimized lightweight ones.Secure encryption without a server
Deriving secure keys from wallet signatures was challenging.Guaranteeing zero data leaves the device
Every interaction had to be audited for privacy.
Accomplishments that we're proud of
- Built a fully serverless financial app powered entirely on-device
- Implemented working ML models in the browser without cloud compute
- Achieved AES-256 encryption with wallet-derived keys
- Designed a simple UX despite complex encryption and wallet logic
- Created a secure, open-source template for future privacy-first apps
What we learned
- Running ML in the browser is absolutely possible with careful optimization.
- Wallet signatures can be used for real cryptographic key generation.
- Privacy-first UX requires simplicity, transparency, and no hidden processes.
- Web3 authentication introduces new ways to think about identity.
- Performance matters a lot when everything is local—
learned code-splitting, lazy loading, and tree-shaking to keep it fast.
What's next for SafePay AI — Decentralized, Privacy-First Financial Management
- Add OCR for receipt scanning (on-device only)
- Introduce WebGPU-accelerated ML for faster processing
- Add multi-wallet profile support
- Build a plugin system for community-driven extensions
- Release a PWA version for offline mobile use
- Explore optional zero-knowledge proofs for transaction validation
SafePay AI will continue to grow while maintaining its core values:
privacy, decentralization, and full user control.
Built With
- ai
- express.js
- github
- javascript
- mongodb
- netlify/vercel-(deployment)
- node.js
- on-device
- react.js
- rest-apis
- typescript
- web-platform
- web3.js/ethers.js-(wallet-login)
Log in or sign up for Devpost to join the conversation.