Skip to content

pbdsce/Smart-Voting-App

Repository files navigation

Electronic Voting System using Blockchain and Smart Contracts

MIT license

In recent years, traditional elections have failed to satisfy either citizens or political authorities. They are not secure since attacking votes is easy and also threatens voters' privacy and transparency. Furthermore, counting the votes takes too long.

We propose a Blockchain-based solution for solving various problems faced in the voting process. This project is a simple attempt to design and build an electronic voting system; where we make use of Solidity Smart Contracts to create a decentralized voting application (DApp).

Our implementation consists of a web interface to allow users to interact with the blockchain, rest API to handle required records of data.

This project is inspired by this paper.

System Design

At a very high level, a simple voting system comprises of an organizing authority, a voting machine and a vote. In case of our system, we add an ethereum based blockchain, which establishes the network between the three mentioned entities.

network_image

Ultimately our project converges to a Decentralized Web application(). The components of this application are:-

  1. Smart Contracts
  2. Front-end Software for Election Commission (ECI) and for Voting Machine
  3. Voter Authentication Service

architecture image

Smart Contracts

The system includes two Smart contract:

  1. Ballot smart contract. the Ballot smart contract is where the votes are recorded. Each district or constituency would have a Ballot instance deployed on the blockchain; and it consists a list of candidate data for respective district. The Ballot consist of a vote function which can be called by the client to increment vote count of a candidate. Since this function changes the state of the contract, it is function is payable, and thus recorded on the blockchain. Each ballot has a time parameter which specifies the duration till which the vote function would be valid. This contract will be accessed by the voting machine for voting and the ECI portal for monitoring and counting process.

  2. Election creation smart contract. the election creation smart contract is what is used to deploy the ballots on the blockchain. Only the ECI representative, operating the ECI portal client can connect to this contract. This contract takes input as the database of all candidates of respective districts and deploys ballots for every district onto the blockchain. This contract also has a function which returns the addresses of the deployed ballots, so they can be used by the voting machines later.

Web clients

There are two web clients in this project viz the ECI portal and the voting machine. Both of these clients require communication using both http and rpc protocols, hence make use of api/libraries such as XMLHttpRequest and web3.js

  1. ECI portal.

The ECI portal has several functions. First, it has to register eligible voters. For this, a table consisting of required voter data is created using this functionality. this data includes a hash of voter id and fingerprint and the voters' district. For each registered voter, this data is collected and maintained in a database. Secondly, to create a database of candidates of respective districts, another functionality is added. This would create a table of candidate data which will be used to load the ballots later. Third, this portal allows the ECI official to start the election, by specifying the candidates and the time duration. This would make use of election creation smart which would intern deploy the Ballots. The Addresses of these deployed ballots are maintained in a separate table for future use. Lastly, the portal makes use of the address stored in the table, to access the ballots to monitor the votes; thereby declaring the winner of the election.

  1. The Voting machine interface.

The voting machine interface would first verify the voters' eligibility. For this, the machine would input the voter id signature from the voter. This data is hashed and compared with the voter database for authentication. Eligible voters are given access to the ballot, where they can cast their vote. The interface is simple and provides instructions in several languages. The interaction with the ballot is done by using web3 IPC protocol which would connect to the node on the machine. The web app interacts with the ballot smart contract using web3js and thus sends votes as a transaction.

Voter Authentication Service

All database interactions are built on a REST api built using NodeJS application. This api interacts with clients and a mysql server hosted online.

The database maintains 3 tables viz, candidate data, voter data and contract addresses.

Blockchain

We create a private p2p network of all voting machines, miners and eci portal. We created our own genesis description which would be needed to connect to our network.

Screen Shots:

Voter Interface

Screen_1 Screen_2

Election Commission Interface

Screen_2

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •