A Smart Contract-Based P2P Energy Trading System with Dynamic Pricing on Ethereum Blockchain

Sensors (Basel). 2021 Mar 11;21(6):1985. doi: 10.3390/s21061985.

Abstract

We implement a peer-to-peer (P2P) energy trading system between prosumers and consumers using a smart contract on Ethereum blockchain. The smart contract resides on a blockchain shared by participants and hence guarantees exact execution of trade and keeps immutable transaction records. It removes high cost and overheads needed against hacking or tampering in traditional server-based P2P energy trade systems. The salient features of our implementation include: 1. Dynamic pricing for automatic balancing of total supply and total demand within a microgrid, 2. prevention of double sale, 3. automatic and autonomous operation, 4. experiment on a testbed (Node.js and web3.js API to access Ethereum Virtual Machine on Raspberry Pis with MATLAB interface), and 5. simulation via personas (virtual consumers and prosumers generated from benchmark). Detailed description of our implementation is provided along with state diagrams and core procedures.

Keywords: Ethereum; blockchain; dynamic pricing; microgrids; peer-to-peer energy trading; smart contract.