Intent-Centric Autonomous Wallet with ZK Privacy & Social Recovery
π¨π³ δΈζζζ‘£ β’ Features β’ Quick Start β’ Architecture β’ Documentation
AI Smart Wallet is a next-generation smart contract wallet that combines:
- π§ AI-Powered Intent Parsing - Natural language transaction commands
- π Zero-Knowledge Privacy - Hide strategy details with ZK proofs
- π₯ Social Recovery - Guardian-based wallet recovery mechanism
- π ERC-7579 Compatible - Modular smart account architecture
"Transfer 0.1 ETH to 0x1234..." β AI parses intent β Execute transaction
Transform natural language into blockchain transactions:
"Send 0.5 ETH to alice.eth"
"Transfer 100 USDC to 0xabcd..."
- Circom Circuits for strategy verification
- Poseidon Hash for commitment generation
- Groth16 Proofs for privacy-preserving execution
- Add trusted guardians
- Configurable recovery threshold
- Time-locked recovery process
- Cancel/expire mechanisms
- ERC-7579 compatible modules
- Pluggable strategy modules
- Upgradeable via proxy pattern
- Node.js >= 18
- pnpm or npm
- Git
# Clone the repository
git clone https://github.com/aimerfeng/AI-Smart-Wallet.git
cd AI-Smart-Wallet
# Install dependencies
npm install
# Install frontend dependencies
cd frontend && npm install && cd ..
# Install circuit dependencies
cd circuits && npm install && cd ..# Smart contract tests
npm test
# Frontend tests
cd frontend && npm test
# Build ZK circuits
cd circuits && npm run buildcd frontend
npm run devOpen http://localhost:3000 in your browser.
graph TB
subgraph Frontend["Frontend (Next.js 15)"]
UI[React Components]
Hooks[Custom Hooks]
Parser[Intent Parser]
ZKLib[ZK Proof Library]
end
subgraph Contracts["Smart Contracts (Solidity)"]
SW[SmartWallet]
SWV2[SmartWalletV2]
ZKM[ZKStrategyModule]
end
subgraph ZK["ZK System (Circom)"]
Circuit[strategy.circom]
Prover[snarkjs Prover]
end
UI --> Hooks
Hooks --> Parser
Hooks --> ZKLib
ZKLib --> Prover
Prover --> Circuit
Hooks --> SW
Hooks --> SWV2
Hooks --> ZKM
SWV2 --> |Social Recovery| Guardians[(Guardians)]
ZKM --> |Verify Proof| Verifier[ZK Verifier]
AI-Smart-Wallet/
βββ contracts/ # Solidity smart contracts
β βββ SmartWallet.sol # Base wallet contract
β βββ SmartWalletV2.sol # Enhanced with social recovery
β βββ ZKStrategyModule.sol # ZK privacy module
β βββ interfaces/ # Contract interfaces
βββ circuits/ # Circom ZK circuits
β βββ strategy.circom # Strategy verification circuit
β βββ scripts/ # Build & prove scripts
βββ frontend/ # Next.js frontend
β βββ app/ # App router pages
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries
βββ test/ # Property-based tests
βββ docs/ # Documentation
βββ scripts/ # Deployment scripts
This project uses Property-Based Testing with fast-check for comprehensive test coverage.
| Test Suite | Tests | Status |
|---|---|---|
| SmartWallet | 23 | β |
| SmartWalletV2 | 30 | β |
| ZKStrategyModule | 18 | β |
| Frontend | 30 | β |
| Total | 101 | β |
| Category | Technology |
|---|---|
| Smart Contracts | Solidity 0.8.19, Hardhat |
| ZK Proofs | Circom 2.0, snarkjs, Poseidon |
| Frontend | Next.js 15, React 19, TypeScript |
| Styling | Tailwind CSS, Framer Motion |
| Web3 | wagmi, viem |
| Testing | Vitest, fast-check |
- Technical Guide - Deep dive into implementation
- Code Analysis - Core code walkthrough
- Troubleshooting - Common issues & solutions
- δΈζζζ―ζε - Chinese documentation
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin - Smart contract libraries
- circomlib - Circom component library
- snarkjs - zkSNARK implementation
- wagmi - React hooks for Ethereum
Made with β€οΈ by aimerfeng
β Star this repo if you find it useful!
