Browser-Based Proof-of-Work Simulation & Validation Lab
Engineering Scope
Interactive blockchain simulation, mining workflow visualization, deterministic validation, benchmark reporting, persistence, and JavaScript/WebAssembly execution paths.
Problem Statement
Blockchain concepts are often explained abstractly, making it difficult to show wallets, pending transactions, mining rewards, Proof-of-Work difficulty, validation, and tamper detection without connecting to real cryptocurrency networks.
Architecture Overview
React and Vite browser application with Zustand state management, localStorage persistence, Recharts benchmark visualization, crypto-js SHA-256 hashing, and an optional C++ WebAssembly mining engine with JavaScript fallback.
Data Flow Explanation
Users create simulated wallets, submit validated transactions into a pending pool, mine pending transactions plus a SYSTEM reward into blocks, and inspect the resulting chain through explorer, validation, benchmark, and tamper-detection flows.
Engineering Decisions
Core blockchain behavior was kept in dedicated modules for blocks, hashes, transactions, wallets, mining, validation, and simulation import/export. Balances are derived from confirmed chain data instead of trusted as mutable wallet fields.
Scale & Reliability Considerations
Mining runs in bounded batches and yields control back to the browser so the interface remains responsive. Difficulty is intentionally capped from 1 to 5, and the WebAssembly miner is optional so the JavaScript fallback keeps the app portable.
Outcome
Produced an interactive engineering lab that makes Proof-of-Work, nonce search, mining rewards, chain validation, tamper detection, and benchmark behavior visible without mining real cryptocurrency.