## 3 Blockchain-Based P2P Energy Trading Model
However, the third and fourth points require a data management platform capable of offering transparency, auditability, anonymity, and immutability as well as security. These characteristics can be found in blockchain platforms. Blockchain technology is pivotal in P2P energy trading by providing a decentralized, autonomous, transparent, and secure platform for facilitating energy transactions between producers and consumers. Blockchain technology has the potential to further P2P energy trading mechanisms by offering the following features:  
* Decentralization and distributed ledger technology: blockchain eliminates the need for centralized authorities, creating a distributed ledger across a network of computers. This ensures transactions are recorded transparently and immutably, enhancing trust among participants;
* Transparency: blockchain's distributed ledger technology maintains a transparent and immutable record of all energy transactions. Every transaction is cryptographically verified and recorded on the blockchain, providing transparency and auditability. This transparency helps build trust among participants and ensures the integrity of the energy trading process;
* Smart contracts: these are self-executing contracts with the terms of the agreement directly written into lines of code. They automate the energy trading process, executing transactions when predefined conditions are met, thus reducing the need for intermediaries, and streamlining processes;
* Real-time settlements: blockchain enables real-time settlement of energy transactions, allowing producers to receive payment immediately upon energy delivery to consumers. This instantaneous settlement process eliminates delays and reduces counterparty risk, enabling more efficient energy trading and cash flow management;
* Integration with IoT Devices: blockchain can be integrated with Internet of Things (IoT) devices to facilitate automated energy trading at a large scale. This allows real-time consumption data to be used in transactions, making the process more efficient and responsive to energy needs. Furthermore, blockchain's ability to ensure security through robust encryption techniques and provide real-time prices to consumers makes it an ideal solution for P2P energy trading. This not only empowers prosumers by enabling them to trade surplus energy directly but also promotes the use of renewable energy sources by ensuring the traceability and authenticity of the energy traded. The blockchain-based P2P energy trading model offers prosumers, with excess generated energy, the opportunity to sell it to other interested consumers at a negotiated price. Ethereum and Hyperledger are common platforms used for such an application due to their smart contract capabilities that allow the automatic execution of transactions when predefined conditions are met. Prosumers list their excess energy for sale on the blockchain platform along with their desired price. Consumers browse available energy offers on the platform and select the ones that meet their price, quantity, and source requirements. Once a consumer selects an offer, the smart contract automatically executes the transaction, transferring the agreed-upon amount of energy from the producer to the consumer. Payment for the energy is transferred directly to the producer's digital wallet upon completion of the transaction. Two layers are required to achieve a P2P energy exchange: a money exchange layer and an energy exchange layer. The concepts of money exchange and energy exchange layers refer to the distinct functionalities and processes involved in facilitating transactions between energy prosumers and consumers. The money exchange layer handles the financial aspect of P2P energy trading, including pricing, payment, and settlement. It involves the exchange of cryptocurrency or fiat currency in return for the energy consumed or produced. Smart contracts within the blockchain platform automatically execute payment transactions once energy transactions are completed.