4.1.4. Blockchain

To join the proposed system, interested components (EVs, HCSs) are required to be registered by providing the necessary information and documentation. All the members will receive a pair of keys (public and private). The public key will be used as the member's identity, and all the communications will take place by using that. At the same time, the public key will hide the real identity of the member, and in this way, it can protect privacy as well. However, a typical blockchain has to go through a lot of complex calculations because of block generation and validation, which would require servers with high computational capabilities. Thus, an edge server is used to perform those calculations to minimize delays during transactions. With the authentication information, the blockchain is also responsible for storing all the outcomes of smart billing and reputation management system inside a transaction to ensure their security, integrity, availability, transparency, etc.

Any EV or HCS can register with the system by providing the required information and documents. After registration, it becomes a member of the blockchain and is able to perform transactions anytime over an Internet connection. An EV user that wants to charge its car can send a request for charging. Then, the system will suggest the nearby HCSs. Two factors will be applied while suggesting HCSs; one is the distance from the EV, and the other is the ratings of the HCSs. The EV can select the most suitable HCS among those on offer. When there is a mutual agreement between an EV and an HCS, the system will generate an ID for the transaction. In the future, information related to that charging will be identified uniquely by using that same ID. After receiving the service from an HCS, the

SBS will calculate the amount of energy (i.e., the amount of charge) transferred and send a transaction to the blockchain to store the information. At the same time, the system will deduct the payment from the EV and move it to the HCS's account. The flow of the system is illustrated in Figure 3.

**Figure 3.** Workflow of the proposed system.
