ML-backed wallet risk detector for Aptos transactions
AptosAI Guard is a sophisticated wallet risk detection application that leverages machine learning to analyze and assess the risk level of Aptos blockchain transactions. The application consists of a Flask backend API and a React frontend interface, providing real-time risk scoring and transaction analysis.
| Home Page | Risk Score Result |
|---|---|
![]() |
![]() |
- Real-time transaction risk scoring
- Machine learning-powered risk assessment
- User-friendly web interface built with modern React frontend
- Secure and modular Flask REST API
- Integration with Aptos blockchain
- Easily extendable architecture for future use cases
aptos-ai-guard/
├── backend/ # Flask API server
├── frontend/ # React web application
├── model/ # ML model and risk scoring logic
├── model_training/ # Training scripts and data
└── requirements.txt # Python dependencies
- Python 3.8+
- Node.js 14+
- npm or yarn
- Aptos CLI (optional, for development)
- Clone the repository:
git clone https://github.com/nolandruid/aptos-ai-guard.git
cd aptos-ai-guard- Set up the backend: For Windows (CMD or PowerShell):
cd backend
python -m venv venv
source venv/Scripts/activate
pip install --upgrade pip
pip install -r requirements.txt
flask runFor Mac, Ubuntu, WSL:
cd backend
make setup # Set up virtual environment and install dependencies
make start # Run the Flask development server- Set up the frontend:
⚠️ Requires Node.js v18+ and npm v8+
You can download the LTS version from https://nodejs.org/
cd ../frontend
npm install # or yarn install
npm run dev- Start the backend server:
cd backend
flask run- Start the frontend development server:
cd ../frontend
npm start # or yarn startThe application will be available at
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
The backend API provides the following endpoints:
-
POST /risk-score: Calculate the risk score for a given wallet address.
-
Request Body:
{ "wallet_address": "0x49fe344c4e0fcf3f90721b3c4b20c1a599f70348a0a772efe3933ff4d0578b9e" }Response:
{ "confidence": 0.9, "label": "Trusted", "wallet_address": "0x49fe344c4e0fcf3f90721b3c4b20c1a599f70348a0a772efe3933ff4d0578b9e", "wallet_found": true } -
POST /aptos_to_cad: Convert Aptos (APT) amount to CAD using real-time pricing.
-
Request Body:
{ "amount": 4.5 }Response:
{ "amount": 4.5, "cad_value": 33.84 }
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some 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.
- Aptos Blockchain
- Flask Framework
- React
- scikit-learn

