0% found this document useful (0 votes)
63 views5 pages

Smart Grid Energy Trading Using Peer-To-Peer Blockchain Technology

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views5 pages

Smart Grid Energy Trading Using Peer-To-Peer Blockchain Technology

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/372182330

Smart Grid Energy Trading using Peer-to-Peer Blockchain Technology.

Conference Paper · June 2023


DOI: 10.1109/icSmartGrid58556.2023.10171083

CITATIONS READS

0 193

2 authors:

Nasim Ahmed Md. Ziaur Rahman Khan


Bangladesh University of Engineering and Technology Bangladesh University of Engineering and Technology
6 PUBLICATIONS 23 CITATIONS 121 PUBLICATIONS 989 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Nasim Ahmed on 14 July 2023.

The user has requested enhancement of the downloaded file.


11th IEEE INTERNATIONAL CONFERENCE ON SMART GRID June 04-07, Paris, FRANCE

Smart Grid Energy Trading using Peer-to-Peer


Blockchain Technology.

Nasim Ahmed Md. Ziaur Rahman Khan


Institute of Information & Communication Technology Electrical and Electronic Engineering
Bangladesh University of Engineering and Technology Bangladesh University of Engineering and Technology
Dhaka-1000, Bangladesh Dhaka 1000, Bangladesh.
[email protected] [email protected]

Abstract— The convergence of blockchain, distributed Confidentiality, transaction tracking, smart contract, and other
renewable energy, and IoT has given rise to the possibility of a components of blockchain systems satisfy the requirements of
decentralized energy trading market. This presents a trustworthy technology that supports data authentication,
opportunities for prosumers and consumers to engage in peer- authorization, and in-transit data security in distributed energy
to-peer energy exchange. In this paper, we propose a design for platforms. Based on cryptographic concepts, blockchain
blockchain-based P2P energy trading in a smart grid. Our ensures the entire transaction process is explicit, secured, fully
system is centered around a single-phase grid-connected automated, and avoids several problems of centralized
inverter-based smart grid that delivers 220V and 50Hz output. marketing, such as ineffectiveness, excessive costs, and lack
We utilize IoT and blockchain technologies to facilitate energy
trading. The inverter is designed using the sinusoidal pulse
of clarity [5].
width modulation (SPWM) technique, and grid connectivity is II. RELATED WORK
established through the phase control technique. The inverter
section is implemented in MATLAB, while the IoT and Many works have been reported on blockchain-based P2P
blockchain sections are developed using the python energy trading. Though P2P energy trading has been
programming language. implemented by IoT and blockchain in [6], it is developed by
using the internet and a basic electrical circuit without a
Keywords—blockchain, peer-to-peer (P2P), energy trading, considering community microgrid-based trading system.
inverter, internet of things (IoT), smart grid. While IoT and blockchain have been used to establish P2P
energy trading in [7], it also has been designed by a
I. INTRODUCTION rudimentary electrical circuit without taking into account
The use of distributed generation (DG) in electric power microgrid architecture and lacks the details of PKI, hashing,
systems has proliferated in recent years due to a variety of and PoW algorithms. Through detailed analysis of smart
technical, ecological, and economic benefits. Renewable contract of blockchain-based power trading has been done [8]
sources will account for roughly 30% of global power for a smart grid environment via Southern California Edison's
generation by 2022 [1]. Low-cost renewable energy sources (SCE) 56-bus test feeder deploying wireless networks, the
such as solar and wind harvesting devices, as well as demand authors have not mentioned the registration process of
for electronic smart appliances, are on the rise. Electric vehicle wireless nodes, wireless security analysis, the PKI, hashing,
adoption is also increasing, resulting in a higher standard of and PoW algorithms of this work. Through meticulous
living. In traditional power grids, energy is produced by investigation of market mechanism and microgrid system has
massive energy plants with megawatt output located in distant been done in [9-10], the core components of blockchain such
regions and delivered to end-user customers via the utility as PoW, consensus algorithms, the number of participating
network over a long distance. Electricity flows from suppliers nodes and their registration process, security experiment, grid
to customers, while revenues in the opposite direction. In the constraint, and optimization are not covered.
traditional energy supply and marketing system, both energy
The paper proposed blockchain-based P2P energy trading
and cash move in one way. In recent years, the energy business
implementation in a desired truly private P2P network,
has shifted to a decentralized paradigm as a result of
implementing POW, consensus, registration of participating
information technology advancements, and distributed
IoT nodes in a microgrid architecture with inter-community
renewable technologies have progressed [2]. The number of
and intra-community energy trading using grid-connected
prosumers and consumers in the distributed energy trading
market is enormous in a free energy trading environment, inverters.
where each prosumer has complete control over the power- III. SYSTEM DESIGN
producing equipment. Both prosumers and consumers look
for greater equality, security, and the absence of A. Grid Connected Inverter
discrimination. A large number of conventional centralized To eliminate the transformer and achieve high efficiency
trades face immense challenges in fulfilling the requirements (90%) in the circuit, the input voltage has been selected to
of energy trading fairness and data safety [3]. 400V. To get the angle of grid voltage, a phase-locked loop
Blockchain technology utilizes asymmetric cryptography (PLL) has been employed. Since one input of PLL has been
like public-private key (PKI) infrastructure, merkel tree, proof zero voltage, the output of PLL has been taken as the angle of
of work (PoW), consensus algorithm, hash function, and other grid voltage. H-bridge topology has been chosen for this
technologies to allow trade data in a distributed system to be inverter circuit. To drive the MOSFET switches of this
verified, identifiable, and spoofing proof stored. It is topology, a controller has been designed to produce a dynamic
effectively a succession of block lists, with each block SPWM signal according to PLL output. To synchronize the
containing all transaction details for a specified time [4]. inverter output voltage, the modulation index is multiplied
with dynamically developed SPWM parameters to obtain the

icSmartGrid 2023
11th IEEE INTERNATIONAL CONFERENCE ON SMART GRID June 04-07, Paris, FRANCE

precise magnitude of the output voltage. Finally, in this B. Grid Connectivity


design, a low pass filter such as an LC filter has been used The suggested system uses the phase control technique for
[11]. Fig. 1 illustrates the block diagram of the proposed grid connectivity with islanding detection facility. The method
inverter and Table 1 represents the various parameters used to can be shown in equations 1 and 2, where Vg and Vinv are
build this inverter in this experiment. shown as grid and inverter voltage and difference of phase
angle is shown by delta.
𝑉𝑖𝑛𝑣 𝑉𝑔
𝑃= sin 𝛿 ()
𝜔𝐿

( Vinv − Vg ) Vg
𝑄= ()
ωL

To provide active current to the grid, the inverter must provide


an output voltage that is equal to the grid voltage but at a little
angle difference. This active current can be multiplied or
reduced by altering this angle. The inverter must induce a
greater voltage than that of the grid voltage to feed the lagging
current to the grid, but both phase angles must be matched.
The inverter must create a smaller voltage than that of the grid
voltage to feed the leading current to the grid, but both phase
angles must be synced [12].
C. System Diagram
The grid-tied inverter based power network and
blockchain network of this work have been depicted in Fig. 3.
Every islanded microgrid has four components. They are
inverter based distributed power generation, local load smart
meter and circuit breaker. The distributed generation (DG) and
local loads are represented by renewable energies like wind or
solar energy and household load. Smart meters have the ability
to run blockchain-based programs. Finally the microgrid has
been connected by Circuit breaker.

Fig. 1. Block diagram of Grid Connected Inverter.

Fig. 2. Inverter output voltage.

TABLE I. TABLE OF PARAMETERS OF GRID-TIE INVERTER


Parameter Name Value
1. Input Voltage 400V Fig. 3. System Architecture.
2. Modulation Index 80%
3. Efficiency 90%
4. Power rating 1KVA
D. IoT Section
5. Total Harmonics distortion (Voltage) 2.80% Both the IoT and blockchain system of the proposed
6. Total Harmonics distortion (Current) 2.40% architecture has been implemented in python language. Since
7. SPWM Frequency 3KHz the code is composed in Python, it is compatible with a wide
8. PLL Frequency 10KHz range of operating systems, including Windows, Linux, and
9. Output Voltage 220V
10. Output Frequency 50Hz
Mac. The program codes are also tested in raspberry pi, which
11. Filter Inductor 177mH is popularly known as a single-board microcomputer. This
12. Filter Capacitor 10uF raspberry pi eventually has been chosen as a smart meter. The
microcontroller-based inverter has been connected by
raspberry pi through USB to TTL converter. The IP address
of the raspberry pi is used to view the inverter output voltage,

icSmartGrid 2023
11th IEEE INTERNATIONAL CONFERENCE ON SMART GRID June 04-07, Paris, FRANCE

current, and other parameters. The suggested solution has common purpose is to double-check private data content..
been verified respectively private and public networks [13]. Hashes are used to validate digital signatures similarly.
E. Blockchain 2) Consensus Algorithm: It is otherwise known as the
A blockchain is a continuous set of data, referred to as resolving conflicts method of blockchain. It denotes the rules
blocks, that are cryptographically linked all together. A and regulations of the blockchain. The price of per unit
cryptographic hash of the preceding block, as well as a energy, transportation loss, transformer core loss, copper
timestamp and transaction data, are included in each block. loss, and demand charge has been discussed and coded
Since each block includes data about the one before it, they previously among nodes.
form a network, with each new block reinforcing the 3) Genesis Block: The first block of the blockchain is
preceding ones. As an outcome, blockchains are immune to called the genesis block. It is a special block because there is
data manipulation since, once logged, the data in any one no previous block, or previous block hash and PoW values.
block cannot be modified later without impacting all So, it is created by a consensus algorithm, where the previous
following blocks. Fig. 4 shows the block creation process of block hash and PoW have been taken as some random values.
the proposed blockchain.
4) Nodes: The participating parties are called nodes. The
1) Blocks: Every block of this blockchain has been communication between nodes are done by asymmetric
comprised of five elements. They are index, timestamp, encryption method. Every node use its own private key to
transactions list, proof of work, and previous block hash. digital signed in block, so it ensure transit layer security. RSA
a) Index: Though it is not mandatory, it is very helpful algorithm, presently one of the most popular encryption
to track the block having a sequence number or an index of a method, has been chosen in this experiment. Its base is the
block. Prime Factorization method. RSA requires large keys to
b) Timestamp: The timestamp ensures that the achieve a secure level of encryption security. Like
transaction data was present when the block was created, blockchain, SSL/TLS certificates, cryptocurrencies, email
enabling it to be encrypted. To track a block, the timestamp encryption, and a variety of other applications are also
of the block creation is a mandatory element. The proposed employ this algorithm. Because RSA is an asymmetric
system uses the time module of the python library. cryptography technique, it has two separate keys: the public
c) Transaction: Transactions or data of blockchain key and the private key. The public key is distributed to
consist of the following key terms sender, receiver, energy- everyone, but the private key is kept secret. The public and
consumption, unit-price, credit, event, sell, buy, time- private keys are both created by multiplying two huge prime
duration, etc. This transaction list has been implemented in numbers. The encryption strength will be exponentially
python by using a popular data type called a dictionary. boosted if the key size is doubled or tripled. The length of an
d) Proof of Work (POW): To protect the system from RSA key is typically 1024 or 2048 bits.
being compromised, POW is a decentralized consensus
approach that involves network participants to bother
completing an unpredictable mathematical puzzle. Proof of
work is often used in bitcoin mining to inspect, validate, and
create new coins. Because of proof of work, Bitcoin and other
cryptocurrency transactions can be analyzed securely peer-
to-peer, eliminating the need for a trusted third party. The
puzzle must be feasible but relatively complex on the prover
or requester side but simple to verify on the verifier or service
provider side. To solve this puzzle, prover needs a significate
amount of CPU power. A simple POW has been implemented
in this project. To make a block, a node must try to solve the
mystery of the first four digits of the hashing result of string
catenation of previous proof, predicted proof, and previous
hash which must all be zero.
e) Previous Block Hash: The last and final element of
the block is the previous block hash. In this section, a function
takes a previous element block, cryptographic hashes it, and
is added to the block as a dictionary element of python.
Sha256 hashing algorithm has been used in the proposed
system. The SHA-256 method is a variant of the SHA-2
(Secure Hash Algorithm 2) algorithm, that was developed by
the National Security Agency in 2001 as a replacement for
SHA-1. The SHA-256 encryption technique is a proprietary
method that produces a result of 256 bits. Encryption puts
data into a secure format that can only be viewed by someone
who has the key. Data of any size is mapped to data of a fixed
size in hashing. Cryptographic hashing alters encoded data in
a format that it is no longer understandable. The most Fig. 4. Block creation process.

icSmartGrid 2023
11th IEEE INTERNATIONAL CONFERENCE ON SMART GRID June 04-07, Paris, FRANCE

IV. RESULT stable and trustworthy system for financial activities. The
In the genesis block, the PoW and the previous hash value inverter based grid architecture is simulated in a MATLAB
are taken as 100 and 1. The next two blocks are created by environment and the IoT and blockchain parts are developed
node1 after solving the PoW values. The third block is created by python language. A self-designed blockchain network has
by Grid-node by getting the next PoW value. The third block been investigated rather than using a framework. The
confirms the node1’s money transfer from Grid to node1 designed system offers a complete open-source approach for
wallet. Table 2 shows the first four blocks’ details of this P2P energy trading, including energy transmission, metering,
blockchain including transactions and Table 3. shows the and payment transfer.
PoW values of the top six blocks in three iterations, which REFERENCES
ensures the randomization nature of the proposed puzzle. This
[1] “IEA – International Energy Agency,” IEA. [Online]. Available:
mystery remains unpredictable even if the system has been https://www.iea.org/. [Accessed: 19-Apr-2022].
hacked. [2] J. Ferreira and A. Martins, “Building a Community of Users for Open
Market Energy,” Energies, vol. 11, no. 9, p. 2330, Sep. 2018, doi:
TABLE II. BLOCK DETAILS 10.3390/en11092330.
Genesis Block 2 Block 3 Block 4 [3] J. Conti, P. Holtberg, J. Diefenderfer, A. LaRose, J. T. Turnure, and L.
Block Westfall, “International energy outlook 2016 with projections to 2040,”
Index 1 2 3 4 Office of Scientific and Technical Information (OSTI), 2016.
Previous 1 e66b1.. 028861.. 01072e846.. [4] M. J. Fell, A. Schneiders, and D. Shipworth, “Consumer Demand for
Hash Blockchain-Enabled Peer-to-Peer Electricity Trading in the United
PoW 100 90966 25665 6500 Kingdom: An Online Survey Experiment,” Energies, vol. 12, no. 20,
Timestamp 16509… 165094.. 1650947 16509477 p. 3913, Oct. 2019, doi: 10.3390/en12203913.
Transaction -- {'event': {'event': {'amount': '10 [5] T. Li, W. Zhang, N. Chen, M. Qian, and Y. Xu, “Blockchain
'start', 'stop', taka', Technology Based Decentralized Energy Trading for Multiple-
'receiver': 'receiver': 'duration': '60 Microgrid Systems,” in 2019 IEEE 3rd Conference on Energy Internet
'Grid', 'Grid', min', and Energy System Integration (EI2), Changsha, China, Nov. 2019, pp.
'sender': 'sender': 'power': '1kw', 631–636. doi: 10.1109/EI247390.2019.9061928.
'DG-1'} 'DG-1'} 'receiver': [6] M. J. A. Baig, M. T. Iqbal, M. Jamil, and J. Khan, “IoT and Blockchain
'DG-1', Based Peer to Peer Energy Trading Pilot Platform,” in 2020 11th IEEE
'sender': Annual Information Technology, Electronics and Mobile
'Grid', Communication Conference (IEMCON), Vancouver, BC, Canada,
'unit_price': Nov. 2020, pp. 0402–0406. doi:
'10 taka'} 10.1109/IEMCON51383.2020.9284869.
[7] M. Jabbar Aziz Baig, M. T. Iqbal, M. Jamil, and J. Khan, “Peer-to-Peer
Energy Trading in a Micro-grid Using Internet of Things and
TABLE III. POW VALUES IN DIFFERENT ITERATION. Blockchain,” ELS, vol. 25, no. 2, pp. 39–49, Dec. 2021, doi:
10.53314/ELS2125039B.
st
block 1 iteration 2nd iteration 3rd iteration [8] Z. Liu, D. Wang, J. Wang, X. Wang, and H. Li, “A Blockchain-Enabled
1 100 100 100 Secure Power Trading Mechanism for Smart Grid Employing Wireless
2 20700 45272 20068 Networks,” IEEE Access, vol. 8, pp. 177745–177756, 2020, doi:
3 65906 93730 3814 10.1109/ACCESS.2020.3027192.
4 53104 16545 320293 [9] A. Paudel, K. Chaudhari, C. Long, and H. B. Gooi, “Peer-to-Peer
5 30388 7732 49418 Energy Trading in a Prosumer-Based Community Microgrid: A Game-
6 212101 40795 17103 Theoretic Model,” IEEE Trans. Ind. Electron., vol. 66, no. 8, pp. 6087–
6097, Aug. 2019, doi: 10.1109/TIE.2018.2874578.
[10] C. Long, J. Wu, Y. Zhou, and N. Jenkins, “Peer-to-peer energy sharing
through a two-stage aggregated battery control in a community
V. CONCLUSION Microgrid,” Applied Energy, vol. 226, pp. 261–276, Sep. 2018, doi:
The suggested peer-to-peer energy trading mechanism 10.1016/j.apenergy.2018.05.097.
features a novel and straightforward design. The proposed [11] N. Ahmed and Z. R. Khan, "A Single-Phase Grid-Connected Inverter
scheme is user-friendly, open-source, and has the potential to using Phase Control Method," 2021 IEEE International Conference in
Power Engineering Application (ICPEA), 2021, pp. 183-187, doi:
boost productivity and competitiveness when compared to the 10.1109/ICPEA51500.2021.9417760.
conventional energy trading systems. The contemporary P2P [12] N. Ahmed and M. Z. R. Khan, "Logistic Regression based Islanding
energy trading systems mostly concentrate on software-based Detection for Grid-Connected Inverter," 2021 IEEE Kansas Power and
monetary transactions. However, the developed scheme in this Energy Conference (KPEC), 2021, pp. 1-4, doi:
research not only addresses the economic tasks of blockchain 10.1109/KPEC51835.2021.9446257.
technology but also introduces a hardware structure of grid- [13] N. Ahmed and M. Z. R. Khan, "A Secure IoT Based Grid-Connected
connected inverter that can directly supply energy to the grid Inverter using RSA Algorithm," 2021 31st Australasian Universities
Power Engineering Conference (AUPEC), 2021, pp. 1-5, doi:
with IoT functionality for real-time transferring energy in 10.1109/AUPEC52110.2021.9597724.
order to gain economic advantages, as blockchain provides a

icSmartGrid 2023
View publication stats

You might also like