Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

AptosAI Guard

ML-backed wallet risk detector for Aptos transactions

Python Flask React

Overview

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.

Loom Video Walkthrough

📽️ Click to view walkthrough

UI Screenshots

Home Page Risk Score Result
Home Screenshot Risk Score Screenshot

Features

  • 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

Project Structure

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

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • npm or yarn
  • Aptos CLI (optional, for development)

Installation

  1. Clone the repository:
git clone https://github.com/nolandruid/aptos-ai-guard.git
cd aptos-ai-guard
  1. 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 run

For Mac, Ubuntu, WSL:

cd backend
make setup # Set up virtual environment and install dependencies
make start # Run the Flask development server
  1. 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

Running the Application

  1. Start the backend server:
cd backend
flask run
  1. Start the frontend development server:
cd ../frontend
npm start  # or yarn start

The application will be available at

API Documentation

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
    }

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some 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

  • Aptos Blockchain
  • Flask Framework
  • React
  • scikit-learn

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages