Soklin
Soklin is an advanced blockchain monitoring and security platform that leverages Somnia Data Streams to provide real-time wallet reputation analysis, transaction monitoring, and fraud detection. Built for the Somnia Data Stream hackathon, it combines machine learning algorithms with live blockchain data to identify suspicious activities and protect the blockchain ecosystem.
- Real-time Monitoring: Continuous wallet surveillance with instant alerts for suspicious activities
- AI-Powered Scoring: Machine learning algorithms for accurate risk assessment and reputation scoring
- Transaction Analysis: Deep analysis of transaction patterns and behavioral anomalies
- Community Collaboration: Real-time chat system for sharing insights between security professionals
- Automated Flagging: Blockchain-based flagging of high-risk wallets using smart contracts
- Cross-Platform Support: Works seamlessly across all modern browsers (Chrome, Edge, Firefox, Brave)
graph TB
A[Wallet Addresses] --> B[Somnia Data Streams SDK]
B --> C[Real-time Transaction Streaming]
C --> D[Transaction Processing Engine]
D --> E[ML Risk Scoring]
D --> F[Pattern Recognition]
E --> G[Reputation Score]
F --> H[Fraud Detection]
G --> I[Smart Contract Flagging]
H --> I
I --> J[Blockchain Verification]
D --> K[WebSocket Broadcast]
K --> L[Frontend Dashboard]
L --> M[Real-time Charts]
L --> N[Community Chat]
L --> O[Transaction Feed]
subgraph "Frontend"
L
M
N
O
end
subgraph "Backend Services"
D
E
F
G
H
I
K
end
subgraph "Blockchain Layer"
A
B
C
J
end
- React 18 - Component-based UI architecture
- Vite - Fast development and build tool
- Tailwind CSS - Utility-first styling framework
- Socket.IO Client - Real-time WebSocket communication
- Recharts - Data visualization library
- Lucide React - Beautiful icon library
- React Router DOM - Cross-browser routing solution
- Node.js & Express - Server runtime and framework
- Socket.IO - Real-time bidirectional communication
- @somnia-chain/streams - Somnia Data Streams SDK
- ethers - Ethereum blockchain interaction
- ONNX Runtime Node - ML model inference
- TypeScript - Type-safe development
- Solidity - Smart contract development
- Hardhat - Development environment
- WalletFlagger Contract - Automated flagging mechanism
- Python/Scikit-learn - Model training
- ONNX Format - Model export format
- Ethereum Fraud Detection Dataset - Training data source
| Metric | Score |
|---|---|
| Accuracy | 85% |
| ROC AUC | 92% |
| Precision | 88% |
| Recall | 82% |
Training metrics showing model performance over epochs
Key features used for wallet reputation scoring
- Node.js 18+
- npm or yarn
- Somnia Testnet account with tokens
- Git
# Clone the repository
git clone <repository-url>
cd soklin
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install
# Install smart contract dependencies
cd ../smart-contract
npm installCreate .env files in both backend and frontend directories:
Backend (.env):
SOMNIA_RPC_URL=https://dream-rpc.somnia.network
SOMNIA_CHAIN_ID=50312
PRIVATE_KEY=your_private_key_here
CONTRACT_ADDRESS=your_deployed_contract_address
MODEL_PATH=../ml-models/wallet_fraud_model.onnx
SCALER_PATH=../ml-models/scaler.pkl
FEATURES_PATH=../ml-models/model_features.json
BLACKLIST_PATH=../ml-models/blacklist.json
PORT=8000Frontend (.env):
VITE_API_BASE=http://localhost:8000/api
VITE_WS_URL=ws://localhost:8000
VITE_WS_RECONNECT_ATTEMPTS=10
VITE_WS_RECONNECT_DELAY=2000
VITE_WS_RECONNECT_DELAY_MAX=15000
VITE_WS_TIMEOUT=30000# Start the backend
cd backend
npm run dev
# Start the frontend
cd frontend
npm run dev
# Deploy smart contracts
cd smart-contract
npx hardhat run scripts/deploy.js --network somnia-testnetSoklin is designed for cloud deployment with the frontend and backend deployed separately:
- Deploy the
frontenddirectory to Vercel - Set environment variables:
VITE_API_BASE(your backend URL),VITE_WS_URL(your backend WebSocket URL) - See DEPLOYMENT.md for detailed instructions
- Deploy the
backenddirectory to Railway - Set environment variables:
SOMNIA_RPC_URL,PRIVATE_KEY,CONTRACT_ADDRESS, etc. - See DEPLOYMENT.md for detailed instructions
Detailed deployment instructions for both platforms can be found in DEPLOYMENT.md. This includes:
- Step-by-step deployment processes
- Environment variable configuration
- Troubleshooting tips
- Production best practices
Monitor any wallet address and get live reputation updates as transactions occur on the blockchain.
Interactive charts showing wallet risk trends and transaction patterns over time.
Real-time discussion platform for security professionals to share insights about suspicious activities.
Smart contracts automatically flag high-risk wallets based on ML predictions and threshold settings.
Detailed breakdown of transaction history with risk indicators and pattern analysis.
POST /api/wallets/subscribe- Subscribe to wallet monitoringDELETE /api/wallets/unsubscribe- Stop monitoring walletGET /api/wallets/:address/score- Get wallet reputation scorePOST /api/wallets/batch-score- Score multiple walletsGET /api/wallets/active- Get active monitored walletsGET /api/wallets/:address/flag-status- Get wallet flag statusPOST /api/wallets/:address/flag- Manually flag wallet
GET /api/system/health- Health check
Soklin addresses critical security challenges in the blockchain ecosystem by providing:
- Real-time threat detection using Somnia Data Streams
- AI-powered risk assessment with 92% ROC AUC accuracy
- Community-driven security through collaborative monitoring
- Automated response to suspicious activities via smart contracts
- First implementation combining Somnia Data Streams with ML for wallet security
- Real-time community collaboration for threat intelligence
- On-chain reputation system for transparent risk scoring
- Cross-browser compatibility ensuring maximum accessibility
We welcome contributions to improve Soklin! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, questions, or to learn more about the project:
- Open an issue on GitHub
- Check the documentation files
Soklin was created specifically for the Somnia Data Streams Mini Hackathon with the following goals:
- Demonstrate real-time blockchain data streaming capabilities
- Integrate ML models for fraud detection
- Provide a user-friendly interface with live dashboard
- Showcase smart contract interaction for on-chain reputation system
- Technical Excellence β - Full integration with Somnia Data Streams SDK
- Real-Time UX β - Live monitoring with WebSocket updates
- Somnia Integration β - Deployed on Somnia Testnet
- Potential Impact β - Addresses critical blockchain security needs
- Somnia Network for the Data Streams SDK and testnet support
- Ethereum Fraud Detection Dataset for training data
- Open source community for the amazing tools and libraries used in this project


