Chain Sentinel is a next-gen AI-powered security framework for Web3 networks. It proactively monitors blockchain activity, detects potential fraud or intrusion using AI models, and uses Reactive Smart Contracts (RSCs) to automatically initiate countermeasures like blacklisting wallets.
Think of it as a smart, real-time cybersecurity agent for the decentralized world.
-
🤖 AI-Powered Threat Detection
Detects suspicious transaction behavior using machine learning. -
⛓️ Reactive Smart Contracts (RSCs)
Automatically responds to high-risk activity on-chain by taking predefined security actions. -
🕵️♂️ Wallet Risk Evaluation
Flags and blacklists malicious wallets based on analysis. -
📡 Blockchain Event Logging
Logs and monitors on-chain security events for traceability. -
🌐 FastAPI + Web3 Integration
Efficient backend system using Python with Web3 support for Ethereum.
- Monitor: Transactions are sent to the backend in real-time.
- Analyze: AI model evaluates risk score based on transaction behavior.
- Trigger: If risk > threshold, a Reactive Smart Contract is called.
- Act: Contract blacklists the wallet or logs the activity securely.
- Log: Event data is stored both on-chain and optionally off-chain.
| Layer | Tech |
|---|---|
| Backend API | FastAPI, Python |
| Blockchain Layer | Ethereum, Solidity, Web3.py |
| AI Engine | Python ML Model / Inference API |
| Storage | Firebase / MongoDB (Optional) |
| Smart Contracts | RSC-based Solidity Contracts |
| DevOps | Docker, GitHub Actions (Optional) |
ChainSentinel/ ├── backend/ │ ├── main.py # FastAPI main server │ ├── routes/ # All API endpoints │ ├── services/ # Blockchain & AI services │ ├── models/ # Pydantic models │ └── utils/ # Utility functions ├── contracts/ │ └── ReactiveSmartContract.sol ├── ai_model/ │ ├── model.pkl # Pretrained AI model │ └── inference.py # Prediction logic ├── tests/ │ └── test_endpoints.py ├── README.md └── requirements.txt
yaml Copy Edit
- Python 3.10+
- Node.js + Hardhat or Truffle (for contract deployment)
- Ganache (for local Ethereum testnet)
- Infura/Alchemy API key (for mainnet/testnet)
- MongoDB Atlas / Firebase setup (optional)
git clone https://github.com/your-username/ChainSentinel.git
cd ChainSentinel/backend
python -m venv venv
source venv/bin/activate # or .\venv\Scripts\activate on Windows
pip install -r requirements.txt
uvicorn main:app --reload