How yamanop/sih_26 works
ChainSentry is a command-line blockchain wallet-risk pipeline. Day 1 creates or accepts Elliptic++ inputs, simulates network observations, unifies transactions, engineers wallet features, and builds a wallet/transaction/IP graph. Day 2 combines anomaly, supervised, graph-cluster, and network-red-flag scores, then generates SHAP-backed explanations for top-ranked wallets. The README documents optional real-data subsampling and real GeoIP replacement; sampled code confirms the synthetic path and graph/model flow, but not every feature or model implementation detail.
Main entry points: run_day1.py Day 1 runner · explain.py SHAP explanations · train_models.py Risk ensemble · config.py Raw CSV inputs
Components 19
Data inputs
- Synthetic chain data
src/synthetic_elliptic_data.py - Real-data subsampler
src/subsample_real_data.py - Raw CSV inputs
src/config.py - Network simulator
src/ip_generator.py - Network observations
src/config.py
Day 1 enrichment
- Day 1 runner
src/run_day1.py - Ingestion and validation
src/ingest.py - Unified transactions
src/config.py - Wallet features
src/features.py - Feature table
src/config.py - Graph construction
src/graph_build.py - Wallet transaction IP graph
src/config.py
Day 2 risk analysis
- Day 2 runner
src/run_day2.py - Risk ensemble
src/train_models.py - SHAP explanations
src/explain.py
Risk outputs
- Ranked risk scores
src/config.py - Wallet explanations
src/config.py
Other components
- Analyst
- Elliptic++ data
Connections 32
- Analyst → Day 1 runner: starts pipeline
- Analyst → Day 2 runner: starts scoring
- Day 1 runner → Synthetic chain data: runs when needed
- Day 1 runner → Network simulator: runs
- Day 1 runner → Ingestion and validation: runs
- Day 1 runner → Wallet features: runs
- Day 1 runner → Graph construction: runs
- Synthetic chain data → Raw CSV inputs: writes
- Elliptic++ data → Raw CSV inputs: supplies
- Elliptic++ data → Real-data subsampler: may be reduced by
- Real-data subsampler → Raw CSV inputs: filters
- Network simulator → Raw CSV inputs: reads chain inputs
- Network simulator → Network observations: writes simulated layer
- Ingestion and validation → Raw CSV inputs: reads
- Ingestion and validation → Network observations: reads
- Ingestion and validation → Unified transactions: writes
- Wallet features → Unified transactions: reads
- Wallet features → Feature table: writes
- Graph construction → Unified transactions: reads
- Graph construction → Feature table: reads for check
- Graph construction → Wallet transaction IP graph: writes
- Day 2 runner → Risk ensemble: runs
- Day 2 runner → SHAP explanations: runs after scoring
- Risk ensemble → Feature table: reads
- Risk ensemble → Wallet transaction IP graph: reads
- Risk ensemble → Ranked risk scores: writes
- SHAP explanations → Feature table: reads
- SHAP explanations → Ranked risk scores: reads
- SHAP explanations → Risk ensemble: loads trained model
- SHAP explanations → Wallet explanations: writes
- Analyst → Ranked risk scores: reviews
- Analyst → Wallet explanations: reviews