About This Architecture
Blockchain-anchored tamper-evident logging combines IoT Gateway data ingestion with local file rotation, cryptographic hashing, and smart contract anchoring to create immutable audit trails. The architecture uses a TimedRotatingFileHandler at midnight to trigger merkle.py, which computes Merkle hashes of rotated logs and submits them to an Ethereum smart contract (Anchoring.sol) via Ganache for permanent blockchain anchoring. This pattern ensures that any tampering with historical logs is immediately detectable through hash verification against the blockchain record. Security teams can fork and customize this diagram to implement zero-trust logging, regulatory compliance (SOC 2, HIPAA), and forensic-grade audit trails across distributed systems. The design demonstrates defense-in-depth by combining local logging resilience with decentralized immutability.