loading page

Machine Learning for Alternative Mining in PoW-based Blockchains: Theory, Implications and Applications
  • Hamza Baniata ,
  • Radu Prodan ,
  • Attila Kertesz
Hamza Baniata
University of Szeged

Corresponding Author:[email protected]

Author Profile
Radu Prodan
Author Profile
Attila Kertesz
Author Profile


Blockchain (BC) technology provides a secure distributed transactional database, that can enhance the security and privacy of decentralized systems and applications, e.g. distributed identity, supply chain and Internet of Things (IoT). The most known secure consensus mechanism for permissionless BCs is the Proof-of-Wok (PoW) algorithm. Many argue that the fastest approach to mine new blocks in PoW-based BC networks (although too energy consuming) is Brute-forcing the nonce. In this paper, we demonstrate how a well-trained Machine Learning (ML) model can find more accurate initial nonce values for this problem aiming to decrease the total energy consumption. We attempt to identify linear relationships between inputs and outputs of the classical mining processes, which typically use pure Brute-force techniques to solve the problem. Then, we integrate two ML models, namely SGDRegressor and LinearRegressor with PolynomialFeatures, into a classical mining method to predict the solution. For this, we use more than 780k+ real Bitcoin blocks for training and testing. We mathematically formalize our analysis and propose equations to predict and score the total enhancement, for any ML model deployment, compared to classical mining. We experimentally prove that our method can mine faster than the classical method. Furthermore, we discuss the implications on the node level and the network level, including the allowance for taking over the system by controlling a portion of only 35.5% out of the total computational power of the network. Finally, we apply our method in an integrated IoT-Fog-Blockchain system to enhance the fairness among participating miners.