# PVPBC: Privacy and Verifiability Preserving E-Voting Based on Permissioned Blockchain
## 8 Performance Analysis
### Prototype System: Voter Registration and Authentication Scheme  
We evaluated the PVPBC voting system by implementing a proof-of-concept (PoC) prototype using a Quorum blockchain network. The implementation was divided into three phases: Quorum-network configuration, smart-contract development and deployment,and front-end application development using the REST APIs. For the PoC implementation of the PVPBC voting system, we built REST APIs using Node.js and Express. These APIs allowed us to access and to interact with the blockchain and the functions defined in the smart contract from the front-end system. We used Postman, which is an API development tool, which allowed us to send requests to the Rest APIs and to receive responses. Regarding the TTP and the front-end blockchains, a Byzantine fault tolerance consensus was implemented. The block time was maintained at the default value of 50 ms. We developed all smart-contract code in Solidity using the remix IDE, which allowed us to write, to test, and to debug our smart-contract transactions before deploying the contract on the blockchain network. Finally, we used web3.js and Node.js to interact with the Quorum blockchain and smart contract from the client side. We continue by describing the functionalities implemented in more detail. We then describe the performance evaluation carried out for each function. Finally, we evaluate the voting phase. The goal of this final experiment was to verify how the cost of casting a ballot varied as a function of the number of candidates. **Voter registration:** The voter-registration process is described in Algorithm 1. The register-Voter() function in the register-smart-contracts component is used to register a voter on the blockchain. During voter registration, the TTP calls the smart-contract registrar to verify that the provided voter's ID (\(voter_{id}\)) is part of the whitelist. If the check is successfully passed, the voter is allowed to register themselves for the election (\(Access_{v}\)). The TTP handles the registration transaction, which adds the voter's information to the authentication blockchain. Subsequently, an access token is placed on the blockchain. The voter's access token (\(Token_{v}\)) is entered by the TTP responsible for pushing the contract to the blockchain. It is then stored in the contract state (smartContract). ```
Input:\(voter_{id}\) Output:\(VID_{v}\),invalid() \(Access_{v}=false\); candidates \(=candidates\); if(\(voter_{id}\in candidates\))then \(Access_{v}=true\); \(Token_{v}=(timestamp,expDate,Access_{v})\);  smartContract=update(\(Token_{v}\)); \(VID_{v}\)= address(smartContract) return \(VID_{v}\); else return \(invalid(Access_{v})\);  end if
```  
**Algorithm 1**Voter registration. **Time and gas cost:** In order to determine the number of units of gas required by PVPBC to perform voter registration, we measured the gas required to deploy the smart contract as part of voter registration for 10 contracts. We repeated each experiment 30 times for each contract, and report the average time in seconds and cost for each contract. The results are tabulated in Table 2 for each contract. The average, of the average time required for each contract, is 34 s and the average gas cost for all contracts is 181000. **Authorisation:** During the voter-authorisation phase, the voter submits an access request to the front-end system. This process is described in Algorithm 2. When an access request is initiated using the voter's VID (\(VID_{v}\)), the EA initially checks whether or not the token data associated with the user's address exists in the local database (\(localDatabase\)). If the search for token data fails, the EA interacts with the authorisation contract (querySmartContract(VIDv)), which fetches the token data from the TTP DLT network by calling an exposed-contract method and saving the token data to the local database. After retrieving the access token, the accessRequest() checks the current capability status of the token,such as the initialized, isValid, issuedate, and expireddate functions.