Skip to content

nezukoagent/blockchain-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– ChainSentinel β€” Autonomous Blockchain Monitoring Agent

Hermes Agent MiMo Blockchain License

An autonomous AI agent that monitors blockchain networks, analyzes smart contract security, detects anomalies, and generates actionable reports β€” all driven by natural language reasoning via Xiaomi MiMo models through Hermes Agent.

🎯 Problem

Blockchain infrastructure requires constant monitoring: validator health, transaction anomalies, smart contract vulnerabilities, and network performance. Manual monitoring is slow, error-prone, and doesn't scale. Existing tools are either too rigid (rule-based alerts) or too expensive (enterprise solutions).

πŸ’‘ Solution

ChainSentinel is an AI-driven autonomous agent that:

  1. Monitors blockchain nodes and validators in real-time
  2. Analyzes smart contracts for security vulnerabilities using LLM reasoning
  3. Detects anomalous transactions and network behavior
  4. Reports findings via Telegram/Discord with actionable insights
  5. Acts autonomously β€” restarts nodes, alerts validators, blocks suspicious contracts

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              ChainSentinel Agent             β”‚
β”‚         (Hermes Agent + MiMo V2.5)          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Monitor    β”‚  Analyzer     β”‚  Reporter     β”‚
β”‚  Module     β”‚  Module       β”‚  Module       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Node Health β”‚ Smart Contractβ”‚ Telegram Bot  β”‚
β”‚ Tx Pool     β”‚ Security Scan β”‚ Discord Webhookβ”‚
β”‚ Block Stats β”‚ Anomaly Det.  β”‚ Email Digest  β”‚
β”‚ Validator   β”‚ Gas Analysis  β”‚ Dashboard     β”‚
β”‚ Status      β”‚ Code Review   β”‚ JSON Export   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚           Blockchain RPC Layer              β”‚
β”‚    (EVM / Cosmos / Substrate / Custom)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • Hermes Agent installed
  • Xiaomi MiMo API key (from MiMo API Platform)
  • RPC endpoint for your target blockchain

Install

git clone https://github.com/nezukoagent/blockchain-agent.git
cd blockchain-agent
pip install -r requirements.txt
cp .env.example .env  # Edit with your config

Configure

# .env
MIMO_API_KEY=your_mimo_api_key
BLOCKCHAIN_RPC=https://rpc.your-chain.com
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
MONITOR_INTERVAL=300  # seconds

Run

# Start full monitoring suite
python -m chainsentinel run

# Run security audit on a contract
python -m chainsentinel audit 0xContractAddress

# Generate network health report
python -m chainsentinel report

# Start Telegram bot interface
python -m chainsentinel bot

πŸ“¦ Modules

1. Node Monitor (chainsentinel/monitor/)

  • Tracks block height, sync status, peer count
  • Alerts on missed blocks, fork detection, high latency
  • Validator uptime and commission tracking

2. Smart Contract Analyzer (chainsentinel/analyzer/)

  • Static analysis for common vulnerabilities (reentrancy, overflow, access control)
  • LLM-powered deep code review via MiMo
  • Gas optimization suggestions
  • Comparison against known exploit patterns

3. Anomaly Detector (chainsentinel/detector/)

  • Unusual transaction volume detection
  • Whale movement tracking
  • Flash loan attack pattern recognition
  • MEV (sandwich/front-running) detection

4. Report Generator (chainsentinel/reporter/)

  • Daily/weekly automated reports
  • Telegram & Discord notifications
  • HTML dashboard with charts
  • Historical trend analysis

5. Autonomous Actions (chainsentinel/actions/)

  • Auto-restart unhealthy nodes
  • Validator jailing alerts
  • Contract blacklisting recommendations
  • Emergency halt triggers

πŸ”§ AI Agent Workflow

ChainSentinel uses a multi-agent architecture powered by Hermes Agent + MiMo:

User Query (natural language)
    β”‚
    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Router Agent    β”‚  β†’ Routes to appropriate specialist
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β–Ό         β–Ό          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Monitor β”‚ β”‚Securityβ”‚ β”‚Report  β”‚
β”‚Agent   β”‚ β”‚Agent   β”‚ β”‚Agent   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚         β”‚          β”‚
    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–Ό
   Action / Response

Each sub-agent has its own prompt, tools, and context window, orchestrated by Hermes Agent's delegation system.

πŸ“Š Example Output

πŸ” ChainSentinel Daily Report β€” 2026-05-16

πŸ“Š Network Health: βœ… GOOD
β”œβ”€ Block Height: 12,847,293 (+14,400 today)
β”œβ”€ Active Validators: 87/100
β”œβ”€ Avg Block Time: 6.2s
└─ Network Uptime: 99.97%

⚠️ Alerts (2):
β”œβ”€ [MEDIUM] Validator "node-42" missed 3 consecutive blocks
└─ [HIGH] Unusual gas spike detected at block 12,847,100

πŸ” Contract Audit (new deployments):
β”œβ”€ 0xabc...def β€” Score: 92/100 βœ… No issues found
└─ 0x789...012 β€” Score: 67/100 ⚠️ 2 issues:
    β”œβ”€ Missing access control on withdraw()
    └─ Potential reentrancy in batchTransfer()

πŸ“ˆ Trends:
β”œβ”€ Tx volume: +23% vs last week
β”œβ”€ Unique wallets: +156 new addresses
└─ Avg gas price: 12.4 gwei (↓8%)

πŸ›‘οΈ Security Focus

ChainSentinel prioritizes security analysis using LLM reasoning:

  • Reentrancy Detection β€” traces external calls and state changes
  • Access Control Audit β€” verifies ownership patterns and permission checks
  • Flash Loan Vectors β€” identifies price oracle dependencies
  • Integer Safety β€” checks for overflow/underflow in Solidity <0.8.0
  • Proxy Pattern Analysis β€” validates upgradeable contract storage layouts

πŸ—ΊοΈ Roadmap

  • Basic node monitoring
  • Smart contract static analysis
  • Telegram alert bot
  • Multi-chain support (EVM, Cosmos, Substrate)
  • Quantum-safe signature verification (QoreChain integration)
  • Agent-to-agent communication protocol
  • Self-healing infrastructure (auto-restart, auto-scale)
  • Web dashboard with real-time charts
  • Natural language query interface ("Why is block time slow?")

🀝 Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

πŸ“„ License

MIT License β€” see LICENSE

πŸ™ Built With


Built with ❀️ by an autonomous agent that believes blockchain infrastructure deserves smarter monitoring.

About

πŸ€– ChainSentinel β€” Autonomous Blockchain Monitoring Agent powered by Hermes Agent + Xiaomi MiMo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages