Implementation of Smart Contracts for Peer-to-Peer Energy Trading: A Blockchain Based Proof of Concept
Abstract
Blockchain technology is emerging as a key enabler for peer-to-peer (P2P) energy trading by providing a decentralized, transparent, and secure framework for recording and validating transactions. Its distributed nature helps to address challenges related to trust, information security, and the elimination of intermediaries in energy markets. However, due to the relatively recent adoption of Blockchain technology, studies providing practical guidance for its implementation in this type of market remain limited. The objective of this work was to present a technical guideline for the deployment of a Blockchain network capable of supporting the secure recording of transactions in P2P energy trading scenarios. The proposed methodology was based on the analysis and identification of available tools for network development, considering technical factors such as scalability, transaction speed, and network type (public, private, or permissioned). Based on these criteria, the most suitable platform was selected, and a pilot implementation was developed on the Polygon Amoy network. The pilot study enabled an initial assessment of the system’s technical feasibility and was complemented by a practical guide to facilitate the replication and deployment of smart contracts. Furthermore, the verification process of the generated blocks was documented, including critical information such as prices, traded energy quantities, and unexecuted transactions. In conclusion, the results demonstrate the functional feasibility of the proposed approach at a pilot level and provide a methodological foundation for future Blockchain implementations aimed at P2P energy trading in microgrids and active distribution systems.
References
E. A. Soto et al., “Peer-to-peer energy trading: A review of the literature,” Appl. Energy, vol. 283, p. 116268, Feb. 2021. https://doi.org/10.1016/j.apenergy.2020.116268
S. Suthar et al., “Peer-to-peer energy trading in smart grid: Frameworks, implementation methodologies, and demonstration projects,” Electr. Power Syst. Res., vol. 214, no. Part A, p. 108907, Jan. 2023. https://doi.org/10.1016/j.epsr.2022.108907
M. Moniruzzaman et al., “Blockchain and cooperative game theory for peer-to-peer energy trading in smart grids,” Int. J. Electr. Power Energy Syst., vol. 151, p. 109111, Sep. 2023. https://doi.org/10.1016/j.ijepes.2023.109111
Y. Wu et al., “Digitalization and decentralization driving transactive energy internet: Key technologies and infrastructures,” Int. J. Electr. Power Energy Syst., vol. 126, no. Part A, p. 106593, Mar. 2021. https://doi.org/10.1016/j.ijepes.2020.106593
M. Choobineh et al., “Game-theoretic peer-to-peer solar energy trading on Blockchain-based transaction infrastructure,” e-Prime – Adv. Electr. Eng. Electr. Energy, vol. 5, p. 100192, Sep. 2023. https://doi.org/10.1016/j.prime.2023.100192
W. Tushar et al., “Peer-to-peer trading in electricity networks: An overview,” IEEE Trans. Smart Grid, vol. 11, no. 4, pp. 3185-3200, Jul. 2020. https://doi.org/10.1109/TSG.2020.2969657
M. Soori et al., “AI-powered Blockchain technology in industry 4.0, a review,” J. Econ. Technol., vol. 1, pp. 222-241, Nov. 2023. https://doi.org/10.1016/j.ject.2024.01.001
C. Zhang et al., “Peer-to-peer energy trading in a microgrid based on iterative double auction and Blockchain,” Sustain. Energy Grids Netw., vol. 27, p. 100524, Sep. 2021. https://doi.org/10.1016/j.segan.2021.100524
T. Sivaram, and B. Saravanan, “Recent developments and challenges using blockchain techniques for peer-to-peer energy trading: A review,” Results Eng., vol. 24, p. 103666, Dec. 2024. https://doi.org/10.1016/j.rineng.2024.103666
W. Sarapan et al., “Optimal peer-to-peer energy trading by applying Blockchain to islanded microgrid considering V2G,” in 2022 19th Int. Conf. Electr. Engin./Electron. Comput. Telecommun. Inf. Technol. (ECTI-CON), Prachuap Khiri Khan, Thailand, 2022, pp. 1-4. https://doi.org/10.1109/ECTI-CON54298.2022.9795559
M. Casquiço et al., “Blockchain and Internet of Things for Electrical Energy Decentralization: A Review and System Architecture,” Energies, vol. 14, no. 23, p. 8043, Dec. 2021. https://doi.org/10.3390/en14238043
A. Iskakova et al., “Ethereum Blockchain-Based Peer-To-Peer Energy Trading Platform,” in 2020 IEEE Int. Conf. Power Energy (PECon), Penang, Malaysia, 2020, pp. 327-331. https://doi.org/10.1109/PECon48942.2020.9314591
D. D. Kwadzode, “Performance comparison of blockchain platforms for modeling financial transactions: A case study of Ethereum and Hyperledger Fabric,” Int. J. Finance Econ. Bus. (IJFEB), vol. 4, no. 1, pp. 50-58, Mar. 2025. https://doi.org/10.56225/ijfeb.v4i1.423
J. N. Rodríguez Loor, “Estudio comparativo de las plataformas de Blockchain y sus diferentes escenarios de uso,” Tesis de Maestría, Universidad de las Américas, Quito, Ecuador, 2020. https://dspace.udla.edu.ec/handle/33000/13089
O. O. Egunjobi et al., “A systematic review of Blockchain for energy applications,” e-Prime – Adv. Electr. Eng. Electr. Energy, vol. 9, p. 100751, Sep. 2024. https://doi.org/10.1016/j.prime.2024.100751
B. S. Lee et al., “Blockchain architectures for P2P energy trading between neighbors,” in 2019 Int. Conf. Info. Commun. Technol. Convergence (ICTC), Jeju, Korea (South), 2019, pp. 1013-1017. https://doi.org/10.1109/ICTC46691.2019.8939856
M. Zhang et al., “Demand–response games for peer-to-peer energy trading with the Hyperledger Blockchain,” IEEE Trans. Syst. Man Cybern. Syst., vol. 52, no. 1, pp. 19-31, Jan. 2022. https://doi.org/10.1109/TSMC.2021.3111135
N. Saeed et al., “Decentralized peer-to-peer energy trading in microgrids: Leveraging Blockchain technology and smart contracts,” Energy Rep., vol. 12, pp. 1753-1764, Dec. 2024. https://doi.org/10.1016/j.egyr.2024.07.053
T. Alskaif et al., “Blockchain-Based Fully Peer-To-Peer Energy Trading Strategies for Residential Energy Systems,” IEEE Trans. Industr. Informat., vol. 18, pp. 231-241, Jan. 2022. https://doi.org/10.1109/TII.2021.3077008
R. Khalid et al., “A Blockchain-based load balancing in decentralized hybrid P2P energy trading market in smart grid,” IEEE Access, vol. 8, pp. 47047-47062, Mar. 2020. https://doi.org/10.1109/ACCESS.2020.2979051
M. J. Thompson et al., “Blockchain-based peer-to-peer energy trading method,” CSEE J. Power Energy Syst., vol. 8, no. 5, pp. 1318-1326, Sep. 2022. https://doi.org/10.17775/CSEEJPES.2021.00010
S. Cantillo-Luna et al., “Blockchain for distributed energy resources management and integration,” IEEE Access, vol. 10, pp. 68598-68617, Jun. 2022. https://doi.org/10.1109/ACCESS.2022.3184704
Z. Liu et al., “Research on distributed energy network transaction model based on Blockchain,” in 2021 Int. Conf. Comput. Blockchain Financial Develop. (CBFD), Nanjing, China, 2021, pp. 311-314. https://doi.org/10.1109/CBFD52659.2021.00069
M. Kumar et al., “Blockchain based optimized energy trading for e-mobility using quantum reinforcement learning,” IEEE Trans. Veh. Technol., vol. 72, no. 4, pp. 5167-5180, Apr. 2023. https://doi.org/10.1109/TVT.2022.3225524
L. Wang et al., “Adaptive bidding strategy for real-time energy management in multienergy market enhanced by Blockchain,” Appl. Energy, vol. 279, p. 115866, Dec. 2020. https://doi.org/10.1016/j.apenergy.2020.115866
O. Laayati et al., “A game theory approach (VCG-PSO) for optimal P2P energy trading in Blockchain-enabled microgrids,” in IEEE EUROCON 2023 - 20th Int. Conf. Smart Technol., Torino, Italy, 2023, pp. 210-215. https://doi.org/10.1109/EUROCON56442.2023.10198908
J. M. Groza et al., “Using a ledger to facilitate autonomous peer-to-peer virtual net metering of solar photovoltaic distributed generation,” Sol. Energy Adv., vol. 4, p. 100064, 2024. https://doi.org/10.1016/j.seja.2024.100064
N. Ashraf et al., “Making tradable white certificates trustworthy, anonymous, and efficient using Blockchains,” Energy Rep., vol. 10, pp. 4574-4581, Nov. 2023. https://doi.org/10.1016/j.egyr.2023.11.015
Y. Madhwal et al., “Blockchain enhanced hydrogen fuel production and distribution for sustainable energy management,” Blockchain: Res. Appl., vol. 5, no. 4, p. 100229, Dec. 2024. https://doi.org/10.1016/j.bcra.2024.100229
G. Divya, and P. Supraja, “Bids and asks: Blockchain-based peer-to-peer trading platform,” Comput. Electr. Eng., vol. 119, no. Part A, p. 109516, Oct. 2024. https://doi.org/10.1016/j.compeleceng.2024.109516
Polygon Technology, “One open stack to move money globally, in seconds,” Polygon Wiki, 2026. Accessed: Jun. 8, 2026. [Online]. Available: https://wiki.polygon.technology/
Nomic Foundation, “Getting started with Hardhat 3,” Hardhat, 2026. Accessed: Jun. 8, 2026. [Online]. Available: https://hardhat.org/docs.
Web3.js Foundation, “Web3.js - Ethereum JavaScript API,” Web3.js Docs, 2026. Accessed: Jun. 8, 2026. [Online]. Available: https://docs.web3js.org/
PolygonScan, “Polygon PoS Chain Amoy Testnet Explorer,” PolygonScan, 2026. Accessed: Jun. 8, 2026. [Online]. Available: https://amoy.polygonscan.com/
R. Debnath et al., “Dynamical Stability Analysis of Grid-Following and Grid-Forming Inverters with Blockchain Integration for Enhanced Performance in Modernized Nested Microgrids,” IEEE Access, vol. 13, pp. 165769-165794, Sep. 2025. https://doi.org/10.1109/ACCESS.2025.3610430
E. Benavides et al., “Optimal Energy Dispatch Integrating Replicator Dynamics and Blockchain,” in 2025 IEEE 7th Colombian Conference on Automatic Control (CCAC), Pereira, Colombia, 2025, pp. 1-6. https://doi.org/10.1109/CCAC64704.2025.11259352
Downloads
Copyright (c) 2026 TecnoLógicas

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Funding data
-
Ministerio de Ciencia, Tecnología e Innovación
Grant numbers BPIN 2021000100499
| Article metrics | |
|---|---|
| Abstract views | 166 |
| Galley views | 94 |
| PDF Views | 94 |
| HTML views | 0 |
| Other views | 0 |





