PureChain web-based energy predictor with federated learning Dirichlet for real-time energy consumption forecasting.
Accurate energy consumption forecasting in smart grids requires privacy-preserving learning mechanisms that remain effective under heterogeneous data distributions and support real-time operation. Existing federated learning approaches remain limited by poor performance under data heterogeneity, unvalidated architectural assumptions, and blockchain consensus mechanisms that are too slow for real-time grid operations. This paper presents PureChain, a blockchain-integrated federated learning framework that combines federated averaging, Dirichlet partitioning, LSTM-based forecasting, and a permissioned blockchain for secure client isolation and model rollback. A partitioning strategy is introduced to improve training stability under extreme non-IID conditions ([Formula: see text]), revealing that the distributional impact of a given Dirichlet parameter is dataset-dependent. To support low-latency smart grid applications, a permissioned blockchain employing proof-of-authority and association (PoA[Formula: see text]) consensus achieves 2.0 s transaction latency and 20.88 TPS, outperforming Hyperledger Fabric and Quorum in the evaluated setting. Experimental results on two energy-consumption datasets show that LSTM consistently outperforms BiLSTM under high data heterogeneity, achieving an average R[Formula: see text] of 0.9184 across clients at [Formula: see text]. Smart contract security assessment further yields a threat score of 98.5/100, demonstrating the framework's suitability for privacy-sensitive smart grid deployments. The contribution lies in the integration and systematic validation of established federated learning, forecasting, and blockchain technologies within a unified smart grid architecture.