Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Smart Wallet Logo

πŸ€– AI Smart Wallet

Intent-Centric Autonomous Wallet with ZK Privacy & Social Recovery

CI Status License Solidity Next.js Circom

πŸ‡¨πŸ‡³ δΈ­ζ–‡ζ–‡ζ‘£ β€’ Features β€’ Quick Start β€’ Architecture β€’ Documentation


πŸ“– Introduction

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

✨ Features

πŸ€– AI Intent Parser

Transform natural language into blockchain transactions:

"Send 0.5 ETH to alice.eth"
"Transfer 100 USDC to 0xabcd..."

πŸ”’ ZK Privacy Strategy

  • Circom Circuits for strategy verification
  • Poseidon Hash for commitment generation
  • Groth16 Proofs for privacy-preserving execution

πŸ‘₯ Social Recovery

  • Add trusted guardians
  • Configurable recovery threshold
  • Time-locked recovery process
  • Cancel/expire mechanisms

πŸ—οΈ Modular Architecture

  • ERC-7579 compatible modules
  • Pluggable strategy modules
  • Upgradeable via proxy pattern

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18
  • pnpm or npm
  • Git

Installation

# 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 ..

Run Tests

# Smart contract tests
npm test

# Frontend tests
cd frontend && npm test

# Build ZK circuits
cd circuits && npm run build

Start Development Server

cd frontend
npm run dev

Open http://localhost:3000 in your browser.

πŸ›οΈ Architecture

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]
Loading

πŸ“ Project Structure

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

πŸ§ͺ Testing

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 βœ…

πŸ› οΈ Tech Stack

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

πŸ“š Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Made with ❀️ by aimerfeng

⭐ Star this repo if you find it useful!

About

AI Smart Wallet

Resources

Contributing

Stars

16 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages