An API that identifies and classifies dusting and address poisoning transactions on Solana. Built to be easily integrated into wallets, explorers, and other Solana-based services.
- TypeScript Express API for handling requests
- Python ML model for advanced transaction classification
- Low false positive rate detection
- RESTful endpoints for easy integration
solana-dusting-poisoning/
├── api/ # TypeScript Express API
│ ├── src/ # Source code
│ │ ├── index.ts # API entry point
│ │ └── routes/ # API routes
│ └── package.json # Node.js dependencies
│
└── model/ # Python ML Model
├── app.py # FastAPI app
├── model.py # ML model implementation
├── utils.py # Feature extraction and utilities
└── requirements.txt # Python dependencies
- Node.js (v16+)
- Python (v3.8+)
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/solana-dusting-poisoning.git cd solana-dusting-poisoning -
Install API dependencies
cd api npm install -
Install model dependencies
cd ../model pip install -r requirements.txt
-
Start the Python ML model (in one terminal)
cd model python -m uvicorn app:app --host 0.0.0.0 --port 8000 -
Start the TypeScript API (in another terminal)
cd api npx ts-node src/index.ts
The API will be running at http://localhost:3000.
Endpoint: POST /detect
Request Body:
{
"transactions": [
{
"lamports": 203928,
"signers": ["address1"],
"recent_blockhash": "abc123",
"slot": 123456,
"fee": 5000,
"num_instructions": 2,
"num_accounts": 3,
"num_pre_token_balances": 1,
"num_post_token_balances": 1,
"num_inner_instructions": 0
}
]
}Response:
{
"results": [
{
"is_dust_or_poison": false,
"confidence": 0.12,
"tx_index": 0
}
]
}Endpoint: GET /health
Response:
{
"status": "ok"
}