Skip to content

Latest commit

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🔗 Blockchain Fraud Analyzer Pro

VersionStreamlitPythonLicense

Intelligence Artificielle pour la Sécurité On-Chain
L'équilibre parfait entre détection et sérénité

InstallationUtilisationConfigurationAPIDéploiement


🎯 Vision

Blockchain Fraud Analyzer Pro est une plateforme d'investigation on-chain qui combine des méthodes traditionnelles de détection de fraude avec des techniques ultra-scientifiques (MF-DFA, Transfer Entropy, RMT, ESN) pour identifier les comportements frauduleux les plus subtils.

"Dans le chaos de la blockchain, notre outil trouve l'harmonie."


✨ Fonctionnalités

🔍 Détection Spécifique

Type de FraudeMéthodeScore de Confiance
🌀 Mixers (Tornado Cash)Pattern matching + Graph analysis0-100%
🔄 Wash TradingCycle detection + Transfer Entropy0-100%
🧨 Rug PullGini concentration + BOCD0-100%
🥪 Sandwich AttacksMEV pattern detection0-100%
Flash LoansAnomaly detection + RMT0-100%

🧪 Méthodes Ultra-Scientifiques

MéthodeApplicationDétecte
MF-DFAMultifractal analysisPatterns artificiels, lissage
Transfer EntropyCausal information flowLiens anormaux entre variables
BOCDBayesian changepointChangements de régime soudains
RMTRandom Matrix TheoryCorrélations non-naturelles
ESNEcho State NetworkDynamique non-linéaire cachée
SSASingular Spectrum AnalysisPersistance spectrale anormale
RQARecurrence AnalysisComportements trop réguliers

📊 Interface Feng Shui

  • 5 Éléments : Navigation inspirée des principes du Feng Shui
  • Jauges énergétiques : Visualisation intuitive des risques
  • Thème sombre apaisant : Réduction de la fatigue visuelle
  • Animations fluides : Feedback utilisateur en temps réel

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│ Streamlit Frontend │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Dashboard │ │Investigation│ │Historique│ │Paramètres│ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────┬───────────────────────────────────┘
│
┌─────────────────────────▼───────────────────────────────────┐
│ FraudAnalyzerWrapper │
│ • Orchestration des analyses │
│ • Gestion des erreurs │
│ • Cache des résultats │
└─────────────────────────┬───────────────────────────────────┘
│
┌─────────────────────────▼───────────────────────────────────┐
│ BlockchainFraudAnalyzer (Core) │
│ • detect_mixer_patterns() • detect_wash_trading() │
│ • detect_rug_pull_signals() • ultra_scientific_detection() │
└─────────────────────────┬───────────────────────────────────┘
│
┌─────────────────────────▼───────────────────────────────────┐
│ BlockchainConnector │
│ Covalent │ Etherscan │ Polygonscan │ BSCScan │
└─────────────────────────────────────────────────────────────┘

📦 Installation

Prérequis

Python 3.9+
pip 21.0+
Git

Installation Locale

# 1. Cloner le dépôt
git clone https://github.com/votre-compte/blockchain-fraud-analyzer.git
cd blockchain-fraud-analyzer
# 2. Créer un environnement virtuel
python -m venv venv
source venv/bin/activate # Linux/Mac# ou
venv\Scripts\activate # Windows# 3. Installer les dépendances
pip install -r requirements.txt
# 4. Configurer les clés API (optionnel)
mkdir .streamlit
cp .streamlit/secrets.toml.example .streamlit/secrets.toml
# Éditer .streamlit/secrets.toml avec vos clés# 5. Lancer l'application
streamlit run app.py

Dépendances

streamlit>=1.28.0
pandas>=2.0.0
numpy>=1.24.0
plotly>=5.17.0
requests>=2.31.0
scipy>=1.10.0
scikit-learn>=1.3.0
statsmodels>=0.14.0
matplotlib>=3.7.0
networkx>=3.0
openpyxl>=3.1.0
python-dotenv>=1.0.0

🔑 API Keys

Services Supportés

ServiceUtilitéObtention
CovalentDonnées multi-chaincovalenthq.com
EtherscanTransactions Ethereumetherscan.io
PolygonscanTransactions Polygonpolygonscan.com
BSCScanTransactions BSCbscscan.com

Configuration des Secrets

Créez .streamlit/secrets.toml :

[api_keys]
covalent = "ckey_votre_cle_ici"etherscan = "votre_api_key_etherscan"polygonscan = "votre_api_key_polygonscan"bscscan = "votre_api_key_bscscan"
[blockchain]
default_network = "ethereum"max_blocks_back = 50000rate_limit_delay = 0.1
[analysis]
default_sensitivity = 0.5enable_ultra_scientific = truemax_transactions = 10000

🚀 Utilisation

1. Lancement de l'application

streamlit run app.py

L'application sera accessible à : http://localhost:8501

2. Investigation d'une adresse

# Exemple d'adresse à analyseraddress="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"# vitalik.ethnetwork="ethereum"# Paramètres recommandésblocks_back=50000# Derniers 50,000 blocsdetection_level="Ultra"# Analyse complètemethods= [
"Mixer Detection",
"Wash Trading",
"Rug Pull",
"Sandwich Attacks",
"Ultra-Scientific"
]

3. Interprétation des Résultats

ScoreNiveauInterprétationAction
0-20%🟢 LOWComportement normalAucune action
20-40%🟡 MEDIUMActivité inhabituelleSurveillance
40-70%🟠 HIGHActivité suspecteInvestigation
70-100%🔴 CRITICALFraude probableAction immédiate

📊 Exemples d'Analyse

Cas 1: Détection de Mixer

# Adresse ayant interagi avec Tornado Cashaddress="0x47ce0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936"# Résultats attendusmixer_score: 0.78 (HIGH)
suspicious_wallets: ["0x...", "0x..."]
patterns: ["round_values", "hub_and_spokes"]

Cas 2: Analyse Ultra-Scientifique

# Détection de manipulation subtileultra_results= {
'multifractal_width': 0.42, # >0.3 = anomalie'transfer_entropy_mean': 0.35, # >0.3 = causalité anormale'rmt_pvalue': 0.003, # <0.05 = corrélations non-aléatoires'global_ultra_anomaly_score': 0.68
}

🧪 Mode DEBUG (Forensique)

Pour les investigations approfondies avec logs détaillés :

streamlit run app.py -- --debug

Ou dans le code :

analyzer=BlockchainFraudAnalyzer(debug=True)

Les logs sont sauvegardés dans logs/blockchain_fraud_forensic_YYYYMMDD_HHMMSS.log


📁 Structure du Projet

blockchain_fraud_app/
├── app.py # Application Streamlit principale
├── blockchain_fraud_analyzer.py # Core de détection (à copier)
├── requirements.txt # Dépendances
├── README.md # Ce fichier
├── .streamlit/
│ ├── secrets.toml # Clés API (ignoré par git)
│ ├── config.toml # Configuration Streamlit
│ └── secrets.toml.example # Template des secrets
├── utils/
│ ├── __init__.py
│ ├── blockchain_connector.py # Connexion aux APIs
│ └── fraud_analyzer_wrapper.py # Wrapper d'intégration
├── logs/ # Logs forensiques
└── reports/ # Rapports générés

🚢 Déploiement

Streamlit Cloud (Recommandé)

  1. Pousser le code sur GitHub
git add .
git commit -m "Initial commit"
git push origin main
  1. Connecter sur Streamlit Cloud

    • Aller sur share.streamlit.io
    • Cliquer "New app"
    • Sélectionner votre dépôt GitHub
    • Branche: main
    • Fichier principal: app.py
  2. Configurer les Secrets

    • Aller dans Settings → Secrets
    • Ajouter le contenu de .streamlit/secrets.toml
  3. Déployer 🚀

Docker

FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
docker build -t blockchain-fraud-analyzer .
docker run -p 8501:8501 blockchain-fraud-analyzer

Heroku

# Procfile
web: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0
# Déploiement
heroku create blockchain-fraud-analyzer
git push heroku main
heroku config:set STREAMLIT_SERVER_MAX_UPLOAD_SIZE=10

🔧 Configuration Avancée

Ajustement des Seuils

# Dans l'interface Paramètresmixer_threshold: 0.3# Seuil de suspicion mixerwash_threshold: 0.4# Seuil wash tradingrug_threshold: 0.5# Seuil rug pullultra_threshold: 0.6# Seuil ultra-scientific

Optimisation des Performances

# Pour les analyses de masseuse_sampling=Truemax_transactions=5000blocks_back=10000# Pour les analyses forensiquesuse_sampling=Falsemax_transactions=50000blocks_back=500000

📈 Roadmap

  • Support Solana et autres blockchains
  • Analyse en temps réel (WebSocket)
  • Modèle ML personnalisable
  • API REST pour intégration externe
  • Dashboard d'alertes push
  • Export PDF des rapports
  • Mode batch pour analyse de masse

🤝 Contribution

Les contributions sont les bienvenues !

# Fork le projet# Créer une branche
git checkout -b feature/amazing-feature
# Commit les changements
git commit -m 'Add amazing feature'# Push
git push origin feature/amazing-feature
# Ouvrir une Pull Request

📄 License

Distribué sous licence MIT. Voir LICENSE pour plus d'informations.


🙏 Remerciements

  • Streamlit - Framework frontend exceptionnel
  • Covalent - API blockchain de qualité
  • Etherscan - Données on-chain fiables
  • Communauté - Tests et retours précieux

📞 Support

CanalLien
Issues GitHubgithub.com/.../issues
Documentationdocs.blockchain-fraud-analyzer.io
Emailsupport@blockchain-fraud-analyzer.io

⚖️ Avertissement Légal

Cet outil est fourni à des fins éducatives et d'investigation légitime. L'utilisateur est seul responsable de l'utilisation conforme aux lois applicables (AML, KYC, RGPD). L'outil ne constitue pas un avis juridique.


🍚 Blockchain Fraud Analyzer Pro — L'équilibre entre sécurité et sérénité 🍚

Développé avec 🧠 et 🧘 | Inspiré par le Feng Shui | Propulsé par l'IA

⬆ Retour en haut


📄 Fichier supplémentaire : .streamlit/secrets.toml.example

# ====================================================================# BLOCKCHAIN FRAUD ANALYZER PRO - SECRETS TEMPLATE# ====================================================================# Copiez ce fichier vers .streamlit/secrets.toml et ajoutez vos clés# NE JAMAIS COMMIT secrets.toml !
[api_keys]
# Covalent API (https://www.covalenthq.com/)covalent = "ckey_votre_cle_covalent"# Etherscan API (https://etherscan.io/)etherscan = "votre_api_key_etherscan"# Polygonscan API (https://polygonscan.com/)polygonscan = "votre_api_key_polygonscan"# BSCScan API (https://bscscan.com/)bscscan = "votre_api_key_bscscan"# Blockaid API (optionnel - https://www.blockaid.io/)blockaid = "votre_cle_blockaid"# The Graph API (optionnel - https://thegraph.com/)thegraph = "votre_cle_thegraph"
[blockchain]
default_network = "ethereum"max_blocks_back = 50000rate_limit_delay = 0.1
[analysis]
default_sensitivity = 0.5enable_ultra_scientific = truemax_transactions = 10000# Seuils de détectionmixer_threshold = 0.3wash_threshold = 0.4rug_threshold = 0.5sandwich_threshold = 0.5ultra_threshold = 0.6# Paramètres de coût (en USD)cost_fn = 5000# Coût d'une fraude manquéecost_fp = 100# Coût d'une fausse alerte

About

Blockchain Fraud Analyzer Pro est une plateforme d'investigation on-chain qui combine des méthodes traditionnelles de détection de fraude avec des techniques ultra-scientifiques (MF-DFA, Transfer Entropy, RMT, ESN) pour identifier les comportements frauduleux les plus subtils.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages