Keywords

1 Introduction

Electrical vehicles are emerging out to be prominent mode of transportation in order to counter the growing environmental concerns because of fossil fuel pollution [1, 2]. Indian government is promoting in big way by supporting development of ecofriendly technologies like EV. In this direction, Indian government through ministry of Heavy Industries and Public Enterprises launched FAME scheme in year 2015. Prime aim of this scheme is to promote electric mobility and provide incentives in financial terms to companies involved in EVs production and designing charging infrastructure [1,2,3]. In India, there are 150 electric vehicle charging stations only. This number is too less to have electric vehicle as major source of transportation in India. Considering this shortfall, government of India is planning to set up one charging station every three Km in cities and every 25 km on both sides of highways [2,3,4]. Government of India has planned to switch over to 100% electric mobility by 2030 [3,4,5]. In this direction, most of the automobile industries have been complaining of acute shortage of electrical vehicle charging stations [2,3,4]. Looking at the prospective aim of government of India to transit to 100% electric mobility in future and the charging stations and piles required, there is clearly a huge gap. In an attempt to fill this gap, government of India is planning to set up 2636 charging stations across India [4,5,6]. Not only Indian government but many private companies like Tata Power is planning to set up 700 electrical vehicle charging stations in India by 2021 [5,6,7]. Few more private companies like ABB, Acme industries, Fortum India and state-run companies like NTPC, GAIL INDIA, Indian oil corporation and power grid have shown their interest in setting up charging stations in India. Besides this, government of India is giving subsidy up to Rs. 10 million for encouraging the entrance of private investment [6,7,8]. For a country like India aiming to significantly transit toward electric mobility by 2030, mobilizing financial investment in setting up charging station is critical [7,8,9]. It can be observed that prime investors in setting up electric vehicle infrastructure involve government bodies, big private enterprises and grid companies but a common a low budget investor is not having platform to participate. Advent of crowdfunding concept can play a pivotal role in this direction. In crowdfunding, a good number of people fund a project or one can say money is raised through people for a venture mainly from Internet [8,9,10]. With time, this source of funding has become extremely popular because of its success [9,10,11]. Since crowdfunding involves gathering funds from Internet and since small clients can also participate, large amount of capital can be gained. Crowdfunding can play a vital role in expansion of electric vehicle charging stations. Since crowdfunding is Internet-based financing method, it demands complete safety and transparency. In crowdfunding project, the one who starts the crowdfunding campaign called idea person or manager collects the money from contributor through Internet. Ideally, the manager diverts the money to the vendors who supply the basic parts of the project. But in real world, cases have been reported where the manager malfunctions and divert the fund to private bank accounts and does illegal transactions. In the presented research work, a blockchain-based crowdfunding platform has been designed for raising funds to set up EV charging stations infrastructure. For this, a smart contract is designed on Ethereum blockchain platform. To best of the author knowledge, this is first of its kind of smart contract designed for EV charging station infrastructure fund raising through crowdfunding platform. The proposed smart contract provides secure way of crowdfunding. The presented paper is divided into different sections. In first section, basic concept of blockchain is explained followed by insight into EV charging station crowdfunding smart contract. In Sect. 4, proposed smart contract is tested.

2 Blockchain Basics

As the name suggests, blockchain is nothing but chain of blocks which are connected to each other by a means of cryptographic technique called hash pointers. Each block of blockchain has record of transactions; hence, it can be termed as ledger as well. The main aim of blockchain technology is to move from centralized system to decentralized system. In traditional centralized system, there is complete reliance for data security on single node which is not a safe practice. The advent of this technology was with aim of decentralize transactions between peer to peer in a secure manner [12]. Each participating node contains copy of the blockchain so that all the transactions are visible to all the participating nodes. Through synchronization process, any change in the ledger record across any node, the same is reflected at all the nodes. In one way, blockchain is a distributed ledger. One of application of blockchain technology is Bitcoin which is peer-to-peer payment network that involves no central authority [13].

Major characteristic of Blockchain can be stated as follows

  • It is accessible to all therefore open

  • There is no central authority to maintain the ledger that is why it is distributed among the participating parties with identical copies.

  • It is scalable and quite fast in terms of transactions execution and recording so can be termed as efficient.

  • The transactions recorded in block are immutable which means that they cannot be change.

Every of block of a blockchain has two main parts, i.e., header and body [14]. The block header of a block contains information like block number, current block hash, previous block hash, time stamp, nonce and address of the creator. Similarly, block body contains information of transactions. A basic blockchain diagram is shown in Fig. 1.

Fig. 1
figure 1

Basic blockchain

Each block of a blockchain has two main components, i.e., header and body [14]. Block header comprises of block number, hash value of previous block, hash value of current block, time stamp, nonce, address of the creator. The block body contain transactions. Figure 1 shows a basic design of a block.

Block hash is nothing but cryptographically generated number for a block using hash functions. Hash functions are the functions that used for cryptography of the data [15]. In blockchain, block hash is generated by hashing three parameters, i.e., previous block hash (Hk − 1), Merkle root (T) of the current block and nonce which is nothing but a random value. This is done by what we call as miner for which reward is given. In other sense, a miner has to solve a mathematical puzzle HK = Hash(Hk − 1||T||Nonce) such that the resulting block hash has certain number of zeros prefixed which is called difficulty level. The miner has to find the nonce for that. Data of any arbitrary length is mapped to a fixed length data using hash functions. Hash functions have one-way property in the sense that given a data X if its computed hash value H(X), then it is not possible to compute X given its hash value H(X). In most of the literatures, X is stated as message and H(X) as message digest. There are many hashing functions but SHA256 is mostly used in blockchain technology. SHA256 hash function generates 256-bit length encrypted data.

One very important aspect of blockchain in Merkle root which is obtained from Merkle tree [16] which is shown in Fig. 2. This tree-like structure is formed by hashing the transactions which is shown as an example in Fig. 2. In Merkle tree if any intruder tries to change any transaction data, then Merkle root will change which will eventually change all the block hash values which do not obey difficulty level. This will immediately report tampering. Because of this technique blockchain is called as immutable record of transaction and hence secure.

Fig. 2
figure 2

Merkle tree

3 Smart Contract Design

Smart contracts are nothing but the agreement between the participating parties which are implemented by digitally through coding and then embedded into the blockchain [17]. In order to code smart contracts, programming language called solidity is used. Once smart contract is embedded in blockchain as a transaction, then it cannot be tampered by any participating parties. Blockchain technology saw its first application in Bitcoin form but smart contracts further extend this technology in terms of its application in variety of domains. Smart contracts are used to implement business logics and contracts digitally. The smart contracts are executed automatically once certain conditions are met.

3.1 Proposed Smart Contract Algorithm

  • Smart contract for electrical vehicle charging station is deployed in blockchain by idea person by setting minimum donation amount.

  • The donators contribute to the smart contract

  • If the donator contributed amount greater than minimum donation amount, then he is considered as valid donator and has voting right.

  • After good amount of donation is done, the idea person initiates spending request by entering the details of spending request, i.e., reason for spending request, amount required to be paid to vendor, address of the vendor.

  • Legitimate donators vote for the spending request.

  • A spending request gets approval only if more than have legitimate donators have voted in favor of spending request.

  • Once the spending request gets approval through majority voting, the amount is transferred from smart contract to the vendor account.

The smart contract code written in solidity language and implemented on REMIX IDE Ethereum platform is given in Appendix 1. The design of functions and variables used in smart contract is given in Table 1.

Table 1 Functions and variables defined for proposed smart contract

4 Smart Contract Testing

The smart contract is executed and tested in Remix IDE platform provided by Ethereum. The smart contract is tested in four phases as per following explanation.

4.1 Deployment Phase

First, we will deploy “chargingstationcampaign” with setting minimum contribution of 100 Wei. The idea person who launches or deploys the contract has account number 0xca35b7d915458ef540ade6068dfe2f44e8fa733c. The smart contract deployment execution on REMIX IDE is shown in Fig. 3. When we test the minimal contribution after deployment, it shows 100 Wei as evident in Fig. 3.

Fig. 3
figure 3

Testing of “chargingstationcampaign” smart contract deployment on remix IDE

4.2 Donation to “Chargingstationcampaing” Phase

In next testing phase, the idea person itself contributes 1 ether to the campaign. His account has balance of 99.99 ether before donation as shown in Fig. 4a. After donation, his account balance reduces to 98.99 ether as shown in Fig. 4b.

Fig. 4
figure 4

a Idea person account balance before donation. b Donation of 1 ether by idea person to charging station campaign

4.3 Spending Request Phase

In this phase, the idea person places spending request to buy accessories for EV charging station setup from a vendor. It is to be mentioned here that following accessories are required to set up a EV charging station

Charging station accessories [18]

  • As per society of automotive engineers the J1772 connector.

  • Charging chord of minimum length of 20 feet.

  • Power availability at 120 V single phase 12–16 A for level-1 with maximum 1.44 KW power, 240 V single phase up to 80 A for level-2 with maximum 1.92 KW for AC charging.

  • Power availability at 50–1000 V up to 80 A with maximum power 80KW for level-1, 50–1000 V, up to 400 A with maximum power 400 KW for level-2 DC charging.

  • Charge stands.

  • Attachment plugs.

  • Vehicle connector.

  • On board or off board charger.

Various vendors like ABB, Siemens, Bosch, Nissan, etc. are providing the charging station setup accessories [18]. The proposed smart contract facilitates secure method of spending the funds collected from crowdfunding for buying the accessories.

Here, we select account 0x14723a09acff6d2a60dcdf7aa4aff308fddc160c as recipient address of the vendor from whom cord and J1772 connector for charging station will be ordered by the idea person. It is to be noted that before approval of the spending request, the balance of the idea person is 100 ether as shown in Fig. 5a. In Fig. 5b a, spending request is executed by idea person. The details entered in spending request field are to order cord and J1772 connector for charging station with payment of 9999999 Wei to the vendor having account 0x14723a09acff6d2a60dcdf7aa4aff308fddc160c. After pressing “requests” button, the details of spending request executed can be seen as in Fig. 5b.

Fig. 5
figure 5

a Vendor address and balance before spending request approval, b spending request executed by the idea person

4.4 Spending Request Approval Phase

For testing purpose, the idea person gives consent to spending request and index 0 through button “requestconsent.” After this, final approval is executed by idea person through button “finalapproval” for index 0 as shown in Fig. 6. It can be observed in Fig. 6 that the balance of the vendor has increased from 100 ether. Also, it can be seen from Fig. 6 that the “consentorscount” has increased to 1 as compared to 0 in Fig. 5b.

Fig. 6
figure 6

Smart contract approval

It can be seen from the testing phase that the smart contract works as desired and hence ready to be deployed to blockchain.

5 Conclusion

In the presented work, a smart contract has been designed for secure crowdfunding in order to set up electrical vehicle charging station. The smart contract is designed on Ethereum blockchain platform using solidity language. The proposed smart contract is tested in four phases. It is observed that it passes all the test phases as it works as desired. It is expected that the proposed smart contract would be a guiding platform for the those desirous of designing decentralized application for electrical vehicle charging station crowdfunding on blockchain.