Peer-to-Peer EnergyTrade: A Distributed Private Energy Trading Platform

Ali Dorri, Ambrose Hill, Salil S Kanhere, Raja Jurdak, Fengji Luo, Zhao Yang Dong

TL;DR

This paper presents a proof-of-concept implementation of a Secure Private Blockchain (SPB) framework designed for peer-to-peer energy trading. By utilizing off-chain atomic meta-transactions, the system successfully eliminates the need for trusted third-party brokers, protects user privacy, and reduces blockchain storage footprint by 40% while speeding up end-to-end processing times by 35%.

What Problem Does This Paper Address?

As residential and commercial buildings adopt solar panels, local storage, and smart meters, traditional energy consumers are transforming into "prosumers"—entities that both consume and produce energy. Peer-to-peer (P2P) energy trading allows these prosumers to buy and sell excess power locally.

While blockchain is an ideal candidate to underpin these trustless, decentralized energy markets, existing solutions suffer from three major bottlenecks:

  1. Reliance on Trusted Third Parties (TTPs): Most frameworks still require a central broker, bank, or utility company to ensure that both sides fulfill their commitments (i.e., energy is delivered and payment is made).
  2. Privacy Vulnerabilities: Publicly broadcasting energy transactions allows adversaries to link public keys, deanonymize users, and map out sensitive household energy consumption patterns.
  3. High Overheads: Broadcasting every single price negotiation and trade agreement across the entire network creates massive traffic congestion and processing delays, especially under heavy consensus mechanisms like Proof of Work (PoW).

Methods

The authors implemented their previously proposed Secure Private Blockchain (SPB) framework on a private Ethereum network. To solve the TTP and overhead problems, SPB introduces atomic meta-transactions split into two sequential steps:

  • Commit To Pay (CTP): Generated by the consumer to put the required funds on hold (similar to a credit card hold). Crucially, to minimize blockchain bloat, CTPs are stored off-chain in a separate "CTP database" maintained by miners rather than being written directly to the ledger.
  • Energy Receipt Confirmation (ERC): Generated by the consumer's smart meter once the physical energy is received.

When an ERC is submitted, an Ethereum smart contract verifies the matching CTP in the off-chain database. If verified, the transaction is finalized on-chain, triggering the payout to the producer.

To safeguard privacy, the system uses a Certificate of Existence (CoE)—a Merkle tree root hash of changeable public keys signed by a peer meter. This allows users to frequently rotate their public keys to prevent pattern tracking while still proving to the network that they are an authorized smart meter. Furthermore, instead of broadcasting negotiations to all nodes, a custom routing algorithm routes messages directly through high-resource "backbone nodes" based on public key prefixes.

Fig. 1. An example of routing packets using backbone nodes [11].

The physical proof-of-concept testbed consists of two Raspberry Pi 3 devices acting as the consumer smart meter and the producer solar panel, communicating via a Python extension with a MacBook Pro acting as the blockchain miner.

Fig. 3. The implementation setting.

Datasets

Not discussed in the paper. The authors evaluated their system using simulated transactions generated across 100 experimental runs on their custom hardware testbed rather than using an external dataset.

Key Insights and Ideas

  • Off-Chain Staging Prevents Ledger Bloat: By keeping the initial commitment (CTP) off the main blockchain ledger until the energy is actually delivered, the system avoids putting unfulfilled or pending trade negotiations through the expensive global consensus process.
  • True Trustless Atomicity: Making a transaction valid if and only if the CTP and ERC are sequentially paired completely bypasses the need for an escrow broker or central arbitrator.
  • Anonymity via Key Rotation: The CoE mechanism elegantly decouples a smart meter's physical identity from its transactions, allowing prosumers to change identities per transaction without losing their verified status in the network.

Key Results

The SPB framework was benchmarked against a conventional smart-contract-based baseline solution over 100 runs:

  • Reduced Latency: SPB reduced end-to-end delay by 35% because only one transaction (the final settlement) is ultimately written to the blockchain, compared to three transactions in the baseline method.
Fig. 6. Evaluation of end-to-end delay.
  • Lower Monetary Costs: Transaction fees for end-users dropped by 66% (from 60 Ethers to 20 Ethers) due to the reduction of on-chain writes.
  • Higher Throughput: Processing 100 energy trades took 16.6 minutes under SPB, compared to 32 minutes for the baseline—effectively a 48% improvement in transaction processing capacity.
  • Smaller Footprint: The blockchain memory footprint was reduced by roughly 40% (520 KB vs. 860 KB for 100 trades), significantly lowering the storage overhead for network miners.

Limitations and Future Work

While the proof-of-concept successfully demonstrates the framework's benefits, the current implementation relies on an external Python extension to manage the off-chain CTP database alongside Ethereum.

The authors note several critical areas for future work:

  • Modifying the Ethereum network behavior natively to support SPB's off-chain database features without external wrappers.
  • Developing a dedicated, energy-oriented virtual currency and a novel consensus algorithm tied directly to prosumer demand-response efforts.
  • Integrating the platform with automated building energy management systems (BEMS).
  • Scaling up the testbed to evaluate performance and routing efficiency under a much larger network of concurrent buyers and sellers.

Summary updated

Abstract

Blockchain is increasingly being used as a distributed, anonymous, trustless framework for energy trading in smart grids. However, most of the existing solutions suffer from reliance on Trusted Third Parties (TTP), lack of privacy, and traffic and processing overheads. In our previous work, we have proposed a Secure Private Blockchain-based framework (SPB) for energy trading to address the aforementioned challenges. In this paper, we present a proof-on-concept implementation of SPB on the Ethereum private network to demonstrates SPB's applicability for energy trading. We benchmark SPB's performance against the relevant state-of-the-art. The implementation results demonstrate that SPB incurs lower overheads and monetary cost for end users to trade energy compared to existing solutions.
BibTeX
@inproceedings{dorri2019peer,
  author = {Ali Dorri and Ambrose Hill and Salil S Kanhere and Raja Jurdak and Fengji Luo and Zhao Yang Dong},
  title = {{Peer-to-Peer EnergyTrade: A Distributed Private Energy Trading Platform}},
  booktitle = {IEEE ICBC},
  year = {2019},
  doi = {10.1109/bloc.2019.8751268},
}
Figure