**5. Implementation**

To emulate the proposed blockchain-based P2P EV charging system, a virtual environment was created. Several virtual machines were prepared to represent EV, HCS, and blockchain servers. It was assumed that a specific amount of charge was transferred from an HCS to an EV, and the SBS requested a transaction in the blockchain. To simulate the blockchain, a blockchain testing platform called *Truffle* was used [43]. This platform provides a real blockchain with smart contract programming facilities. It provides *Ganache* [44], which simulates a real dummy of the Ethereum blockchain and additionally provides programming ability, customization, monitoring, debugging facilities, etc. The smart contract was written in Solidity programming language and deployed using Truffle. To develop the client side, a lightweight node server [45] was used with Node Packet Manager (NPM) [46].

The target of the implementation was to simulate the transactions, blockchain-based operations such as block generation, and cryptocurrency-based payment management in a real-world environment. Thus, the Ethereum blockchain was selected as the blockchain, and *Ether* as the cryptocurrency. However, some of the transactions were not simulated to simplify the experimental analysis.
