**1. Introduction**

Vehicles with the potential of using renewable energy sources, such as electric vehicles (EVs), have caught worldwide attention in recent times [1–3]. These vehicles do not depend on fossil fuels but use other renewable energy sources to reduce gas emissions. As stated in [4,5], by the year 2040, it is projected that renewable energy is to come to equivalence with coal and natural gas-based electricity generation. Additionally, the EV stock is expected to reach at least 140 million by 2030. However, it will take a long period of time to integrate them efficiently within the infrastructure. At present, EV users are hesitant to use their vehicles for long drives, and potential customers go through the dilemma of choosing an EV over a traditional vehicle, as there are so few charging stations. Level 2 charging equipment can provide a vehicle with 10 to 20 miles of range for every hour of charging. With the necessary set-up, anyone can make their garage available to charge an EV for long-distance traveling [6]. This could provide an abundance of charging stations across the country within the existing infrastructure. Our idea in this setting is that the EVs and the home charging stations would be two different party nodes under a secure and reliable system with availability, security, preservation of privacy, and payment facilities.

Malicious operators can seriously threaten EVs' security and privacy through various malicious exploitations [7–9], e.g., privacy leakage, falsification, node impersonation, or

**Citation:** Akhter, A.F.M.S.; Arnob, T.Z.; Noor, E.B.; Hizal, S.; Pathan, A.-S.K. An Edge-Supported Blockchain-Based Secure Authentication Method and a Cryptocurrency-Based Billing System for P2P Charging of Electric Vehicles. *Entropy* **2022**, *24*, 1644. https:// doi.org/10.3390/e24111644

Academic Editors: Stanisław Drozd˙ z, ˙ Jarosław Kwapie ´n and Marcin W ˛atorek

Received: 28 September 2022 Accepted: 10 November 2022 Published: 12 November 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

advertising fraudulent charging services. To provide secure charging services for EVs, many innovative mechanisms have been proposed so far, and some are even implemented to some extent [10,11]—e.g., trust mechanism and monetary approaches. However, the trust mechanism is not sustainable and susceptible to Sybil attacks and whitewashing attacks, and the monetary approach relies on trusted centers. Trusted centers may not only leak users' private information for profit, but also may be vulnerable to attacks. In this context, blockchain [12] offers a unique platform for secure energy transactions within a distributed network without trusted agents through the use of an immutable ledger, cryptocurrency, and the execution of smart contracts.

As we know from various recent works and interest shown by a wide range of researchers, blockchain technology can come in handy for various management systems. A blockchain is a decentralized, distributed, open ledger, and each node in the network has a copy of the ledger. It was developed as a peer-to-peer network without third-party intervention [13]. The blockchain's integrity is based on strong cryptography and hash functions that provide validation and chain blocks together on transactions, making it nearly impossible to tamper with a block or any individual transaction without being detected [14].

As the number of online systems has increased, we have witnessed that the threats of various types of cyber attacks have also increased significantly. Among the various types of attacks, unauthorized entities or malware-based attacks can cause fatal damage to the system [15]. Thus, a deficiency in the proper authentication process can make a P2P system vulnerable to various types of attacks. In our proposed system, a blockchain-based authentication system is used, so that before making an agreement, the entities (EVs and the HCS) can check the authenticity of each other. Again, while getting services from the HCS, a proper charging measurement system is essential to calculate the amount of the electricity that has been exchanged from the HCS to the EV. Moreover, it is also required to determine the number of bills to be paid. In our system, a smart meter is used to calculate the amount of charging, and the HCS would share that by using the blockchain.

Due to the popularity of cryptocurrency in the financial sector, researchers have also started utilizing it in various fields. In fact, the transparency, trustworthiness, worldwide availability, convenient exchange facilities, ease of access, minimum transaction cost, etc., encourage the business world to utilize cryptocurrency [16,17]. Hence, in this study, a cryptocurrency-based payment system has been used for the system: after calculating the amount (to be paid), the smart meter requests a transaction in the blockchain. The system will automatically deduct the amount from the EV, which will be credited to the HCS's account. After each transaction, the service receiver, i.e., the EV owner, can provide feedback about the service received. It will help the server suggest that HCS out of those nearby, as an HCS with a higher rating will come before one with a lower rating. As generating blocks for a blockchain requires high computational power, edge computing services have been used to perform the complex mathematical calculations required for mining.

In this work, we used a combination of multiple protocols, and the main contributions of this can be summarized as follows:


smart billing system (SBS) automatically calculates the amount to be paid and creates a transaction in the blockchain after the charging process is finished.


To explain the full system, the paper is organized as follows: Section 2 presents the motivations for the proposed system, together with notable research. Section 3 gives some preliminary knowledge on the issues and definitions that could help the general readers get useful information, and it establishes the importance of this work. Section 4 describes the system's architecture with its components and transactions. The implementation details are provided in Section 5. Then, Section 6 contains the performance analysis, and in Section 7, challenges and limitations are discussed. The paper concludes with Section 8 with future research directions.
