Final Report 2022
Final Report 2022
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING
by
This is to certify that the project titled “Decentralized E-Voting System Using Block
Chain Technology” is the bonafide work carried out by JASHWANTH
BHEEMAPAKA (160118733098) and DOMAKONDA RAVITEJA
(160118733308),students of B.E.(CSE) of Chaitanya Bharathi Institute of
Technology(A), Hyderabad, affiliated to Osmania University, Hyderabad,
Telangana(India) during the academic year 2021-2022, submitted in partial fulfillment
of the requirements for the award of the degree in Bachelor of Engineering
(Computer Science and Engineering ) and that the project has not formed the basis
for the award previously of any other degree, diploma, fellowship or any other similar
title.
Supervisor
Dr .Y. Rama Devi
Professor and Head
Department of CSE,
Prof. N Rama Devi. CBIT(A),Hyderabad
professor, CSE Dept
CBIT(A),Hyderabad
Place: Hyderabad
Date:
ii
DECLARATION
I/we hereby declare that the project entitled “Decentralized E-Voting System Using
Block Chain Technology” submitted for the B.E (CSE) degree is my original work
and the project has not formed the basis for the award of any other degree, diploma,
fellowship or any other similar titles.
Place: Hyderabad
Jashwanth Bheemapaka(160118733098)
Date:
iii
ACKNOWLEDGEMENT
It is our privilege to acknowledge with deep sense of gratitude and devotion for keen
personal interest and invaluable guidance rendered by our Project Guide N.Rama Devi,
Professor, CSE Department,CBIT (A).
We are very thankful for the assistance and guidance of T.Sridevi, Associate Professor,
CSE Department, E. Kalpana, Assistant Professor, CBIT(A).
We take the opportunity to express our thanks to Dr. Y.RamaDevi, Professor & Head
of CSE Department, CBIT (A)for her valuable suggestions and moral support.
Finally, We also thank all the staff members, faculty of Dept. of CSE, CBIT(A), and
our friends, who with their valuable suggestions and support, directly or indirectly
helped us in completing this project work
Iv
ABSTRACT
In today's democracy, elections are very important but large sections of society around
the world do not trust their electoral system which is a major concern for democracy.
Even the world's largest democracies like India, the United States, are still plagued by
flawed electoral systems. Voter fraud, EVM (electronic voting machine), electoral
fraud, and confiscation of polling stations are major problems in the current voting
system.
Blockchain is a powerful tool because of its smarts contracts and many features that
override traditional systems.
Blockchain, with smart contracts, emerges as a viable candidate for the development of
secure, cheap, secure, transparent, and easy-to-use electronic voting systems. Due to its
consistency, extensive use, and logic provision of smart contracts, Ethereum and its
network are one of the most appropriate.
V
TABLE OF CONTENTS
Title Page I
Certificate II
Declaration III
Acknowledgement IV
Abstract V
List of Figures VIII
List of Tables IX
1. INTRODUCTION
1.1 Problem Definition , significance and objective 10
1.2 Methodologies 11
1.3 Outline of the project 11
1.4 Scope of the project 12
1.5 Organization of the report 13
2. LITERATURE SURVEY
4. IMPLEMENTATION
4.1 Flowcharts /DFDs / ER Diagrams 25
4.2 Design and Test Steps / Criteria 30
4.3 Algorithms / Pseudo Code 30
4.4 Data Set description 32
4.5 Testing Process 32
5. RESULTS 33
6. CONCLUSIONS
6.1 Conclusions
6.1.1 Limitations 46
6.2 Recommendations /Future Work / Future Scope 47
REFERENCES 48
APPENDICES 51
LIST OF FIGURES
3.2.2 Dependencies 24
4.1 ER diagram 25
5.1 Homepage 33
5.14 Etherscan 41
VIII
List of Tables
Table Page No
IX
1.INTRODUCTION
An electoral system or voting system is a set of rules that determine how elections and
referendums are conducted and how their results are determined. Political electoral
systems are organized by governments, while non-political elections may take place in
business, non-profit organisations and informal organisations. E-voting systems can
crash on election day, can lose or scramble votes, or can operate incorrectly. Even minor
errors can be catastrophic because a fault in an electronic system has the potential to be
systematic and centralised, whereas in manual systems faults tend to be random and
localised.
Even minor errors can be catastrophic because a fault in an electronic system has the
potential to be systematic and centralised, whereas in manual systems faults tend to be
random and localised. Even the world’s largest democracies like India, United States,
still suffer from a flawed electoral system. Vote rigging, hacking of EVM (Electronic
voting machine), election manipulation, and polling booth capturing are the major
issues in the current voting system.
Problem Definition : Current voting systems such as ballot box voting or electronic
voting are subject to various security threats such as DDoS attacks, voting booths, vote-
rigging and fraud, malware attacks, etc., and require large amounts of paper, human
resources, and time. This creates a sense of mistrust between existing systems.
Disadvantages are: Long lines during elections, Security breaches such as data leaks,
vote rigging, It is difficult for disabled voters to reach the polling station, The cost of
elections is high.
Page 10 of 60
Objective: The objective of this project is to build a platform using Block chain smart
contracts.
1.2Methodologies
This project will be a web application with front end, back end and database.
Registration of voters and candidates must be done in advance. Personal verification
must be done before creating accounts. After verifying the identity document, the
authorized person must verify the eligible users by proving a coin or token Using this
coin or token each user can vote only once. The Blockchain verification process will
ensure that dual use of this symbol is not possible. So any user can not vote multiple
times. The blockchain-based e-voting system has been expanded. There is no central
authority to conduct elections. Votes are cryptographically protected.
An app dedicated to electronic voting, or dApp, built into the Ethereum blockchain. A
smart Ethereum contract was signed with Solidity to get the votes cast. User
communication on the client side is designed to use Ethereum accounts for voting.
At the end of the project, our application accomplishes all the functional
requirements.[16]
Page 11 of 60
1.4 Scope of the Project
This project is intended to work on various devices such as mobile, PC / Laptop. This
project will only work once the main function in the backend has been completed.
Blockchain is a distributed spreadsheet program that accesses, verifies, and transmits
network data through distributed nodes.
First of all, the objectives of the project will be determined. Then the software
requirements will be analyzed. The planning languages involved, the frameworks used,
the technology to be used etc. will be analyzed.
Then the hardware requirements are understood, what type of hardware is required, etc.,
will be understood.
This report will clearly explain the terminologies used, tools used, proposed
implementations, results of the implementations, and conclusions drawn from the
results. After this introduction section,
section 2, the literature survey, will introduce the problem in detail. It will go over the
necessary domain terminology, mention the tools, and discuss how they will be used.
We will then go over the existing solutions that have already been presented along with
any other related works.
Section 3 ,We will look into the details of how exactly we implement this tool and how
this tool is run and implemented differently from the existing solutions. Block
diagrams, implementation architectures, module descriptions, and any other relevant
descriptions of the tool’s design will be clearly presented in this section.
Page 12 of 60
Next, section 4 will show the implementation of the proposed system. This section will
depict the implementation of the tool through flowcharts, DFDs, ER Diagrams, etc. The
algorithms or pseudo code will also be presented in this section. Any data sets would
also be presented and described in this section.
In section 5, We’ll look at how the tool run at each step and displaying all the outputs
and results obtained from the training and execution of our proposed model.
Page 13 of 60
2. LITERATURE SURVEY
2.1.1 BlockChain
A blockchain is a shared site shared between computer network nodes.As a web site,
blockchain stores computer information in a digital format. Blockchains are best known
for their important role in cryptocurrency systems, such as Bitcoin, by keeping a secure
and separate record of transactions.
2.1.2 SmartContract
Smart contracts are simply blockchain-based programs that work where predetermined
conditions are met. They are usually used to automatically execute a contract so that all
participants can be immediately assured of the outcome, without the involvement of
any arbitrator or loss of time.
2.1.3 Ethereum
Ethereum is a blockchain platform with its own cryptocurrency, called Ether (ETH) or
Ethereum, and its own programming language, called Solidity. Ethereum is an all-
inclusive public bridge to verify and record activity.[12]
2.1.4 Dapp
Page 14 of 60
2.1.5 Solidity
2.1.6 Metamask
2.1.7 Truffle
2.1.8 web3.js
Web3.js is used to connect a localhost or remote ethereum node using HTTP, IPC or
WebSocket.[13]
Hyperledger Sawtooth provides a flexible and modular architecture that separates the
main program from the application domain, so smart contractors can specify the
business rules of the applications without knowing the basic design of the main system.
Page 15 of 60
2.1.10 Invisible signature
2.1.12 DAO
A distributed ledger is a type of shared database that is agreed upon, duplicated, and
synchronized between members of a shared network. All information in this file is
stored securely and accurately using cryptography.
Page 16 of 60
2.2 Existing solutions for decentralized E-voting system
Page 17 of 60
2.3 Related works
[3] “A blockchain based E-voting system”- They have analyzed three blockchain
frameworks for implementation and use our smart election contracts. Those are
Exonum, Quorum and Geth. Go-Ethereum or Geth is one of the three main uses of the
Ethereum protocol. It uses smart contract plans as planned without the possibility of
inefficiency, research, fraud or interference by third parties. This framework supports
the further development of the Geth protocol and is the most appropriate framework for
the developer .The level of performance depends on the blockchain being used as a
public or private network.they use a region-based voting system.
[4] The Hyperledger Sawtooth framework is used to ensure consistency using the same
transaction processing, and to use two different stages in a single blockchain, to ensure
anonymity and fairness in the voting process. and blockchain business logic, a smart
contract, to be implemented.
Page 18 of 60
[5] “ElectionBlock: An Electronic Voting System using Blockchain and
Fingerprint Authentication”- ElectionBlock adheres to the standard principles of
central blockchain technology and integrated biometric authentication. Registered
voters will have their biometrics registered on the website. will verify that the user is a
registered voter, and secondly, will check the blockchain to ensure that the user has not
cast a vote. Voting is accelerated using the Merkle Tree algorithm.
[8] “A Smart Contract For Boardroom Voting with Maximum Voter Privacy” -
doped an online voting protocol with separate features and greater voting privacy using
Open Vote Network (OVN) .OVN is a smart Ethereum Blockchain contractor. After
using the program the creators concluded that it cost $ 0.73 per voter in the program.
Researchers soon found that OVN was at risk of being attacked by DOS and traffic
jams at the time of purchase.
Page 19 of 60
[9] “Securing e-voting based on blockchain in P2P network”- Designed a
harmonized model of DLT-based voting records to avoid vote-rigging.Design an ECC-
based user verification model to provide authenticity and non-refusal.Design a
withdrawal model that allows voters to change their vote before the deadline.
React.js - React is a JavaScript library for building user links. Used for building single
page applications. React allows us to create reusable UI components.
Page 20 of 60
3.DESIGN OF THE PROPOSED SYSTEM
1.Frontend: The part visible to the user. It is an interface through which users will
interact the components/pages available in the website . It also contains all the stylized
pages. This is created mainly using React.js and styled using MaterialUI. The
Metamask extension is the wallet which is used by the user for initiating transactions.
Page 21 of 60
IPFS is a distributed system .Designed for speed and simplicity, the IPFS API for Infura
and the dedicated gateway connects applications of all sizes to a secure, distributed
environment, opening up a web-resistant webpage.
Page 22 of 60
3.2 Module description
➢ Metamask: A browser plugin that acts as an Ethereum wallet, and is installed
just like any other normal plugin. Once installed, it allows users to store Ether
and other ERC-20 tokens, enabling them to make transactions at any Ethereum
address.The website can be accessed in the local computer or globally using
infura IPFS.
Page 23 of 60
The project is developed with React.js where many files have been coded and many
libraries have been imported.It has many components like Admin, User, Contracts and
soon.The project has been deployed on Infura Ipfs platform.
Dependencies:
These are the dependencies that have been installed to develop the project.There are
many versions but we have used the ones which are compatible for our project.
Page 24 of 60
4. IMPLEMENTATION
ER Diagram
Here the Admin will manage the Voters and Party Candidates, the user will cast his
vote. Only the voters who are registered will be eligible for voting.
Page 25 of 60
Class Diagram
This is a class Diagram where classes have been created for party, Admin, Phases, User,
Vote. Each class has different Attributes and Methods.
Page 26 of 60
Sequence Diagram
This is a sequence diagram which shows the flow of casting of a vote from user/voter
to Ethereum chain. The Transaction will be submitted for mining and block will be
appended to Ethereum chain and total vote count will be increased by one on electrol
candidate.
Page 27 of 60
Use Case Diagram
This is a use case diagram which describes the role of each of the voter and Admin. The
Admin manages the overall elections. The system checks voter identity and Admin will
verify the voter details.
Page 28 of 60
BLOCK CHAIN DEPLOYMENT
The Truffle compile the smart contract and is converted to byte code the truffle will
migrate the byte code and will be deployed on the network.
Page 29 of 60
4.2 Design and Test Steps / Criteria
• User has to create an account with Email and login to website
• Then user need to register with aadhar number and admin checks whether the
aadhar is eligible to register or not.
• Admin will add the candidates who are participating in elections and change the
phase to “voting”
• Now Voting will become live and users start voting to candidates and results
are hidden .
• Admin has to change the phase to “Election is done” and results are shown.
• The system does not allow user to cast his vote more than once.
Step1: Start
Step2: User will create his account with email and password.
Step3: User need to give his Aadhar number after login ,admin will verify
the number.
Step4:Stop
Page 30 of 60
4.3.2 Adding Candidates interested in elections and election phase
Step1: Start
Step2: Admin will add the candidates and turn the phase to Election Phase
on Election day.
Step3:Users start casting their votes and once voted cannot cast again the
system shows warning.
Step5:Stop
Step1: Start
Step2: Admin will change the phase of elections to results and users can’t
cast their vote.
Step3: users can view the results by going to the results tab in the website.
Step4: Stop
Step1: Start
Step4: Stop
Page 31 of 60
4.4 Data Set description
This is a web based application and it doesn’t require any data set.
➢ Casted votes from created account and checked whether user can cast the vote
more than once or not.
➢ All the block chain transactions have been checked carefully and no problem
arised.
Page 32 of 60
5 . RESULTS
In this project we used React.js for developing front-end and solidity to write smart
Contracts. we used Metamask wallet for performing transactions using ether. The
application is working and is deployed on Netlify hosting site, everyone can access
the website from any location. The transactions in the application are immutable,
transparent and are secured.
This is the Homepage of the E-Voting web application where there are User login and
Admin Login Features.
User need to create his account by providing his Email Id and a unique Password.
Page 33 of 60
Figure 5.3 SignUp
If a user is new to the website he/she must create a new account by providing a
username, Email Id, Password. If Email Id already exists then the website will not
allow user to create the account.
Page 34 of 60
Once the user login successfully the user will be redirected to User Dashboard, After
which the user need to provide his Aadhaar Details to be eligible for voting.The Admin
will check the Age from Aadhaar details and may allow the user to cast the vote if
eligible else will be rejected.
This is the area where user will cast his vote once the time has come for Elections. The
Candidates who are Participating in elections will will be displayed here.
Page 35 of 60
The Results page is where the candidate who won in the elections will be displayed and
it also shows each candidate got how many votes.
This is the page for user reference where it gives a clear idea for the user how election
process carry on.
This is the Admin dashboard where the contesting candidate details will be added by
the admin.
Page 36 of 60
Figure 5.9 Candidate details
Once the admin add the candidate details the data will be shown in the Candidate details
page.
This is the area where admin will change the state of elections to Registration, Voting,
Result.
Page 37 of 60
If the state is Registration means the admin is adding the eligible candidates for
elections where user cant see the vote button.
If the state is Voting implies that users can cast their vote.A user can cast a vote only
once.
If the state is Results implies that the elections are completed and the results are
announced where users can see the results.
This is the page which describes total no of candidates and total votes casted as of now.
The Graph shows who has got more votes as of now i.e till a particular time.
Page 38 of 60
Figure 5.12 Metamask wallet
MetaMask is used to store and manage account keys, streaming, send and receive
cryptocurrencies and Ethereum-based tokens, and is securely connected to nationally
distributed systems via a compatible web browser or built-in mobile browser.
For casting the vote, changing the phase of elections, adding the candidates we need to
spend some ether to perform a transaction.
Page 39 of 60
In today’s global market the cost of 1 Ether is around 2.5 lakhs to 3 lakhs.In this
application we have got some free ether from different testing providers. The ether has
no value that is we cant sell to gain the money.
Instead we can make use of Ganache Truffle suite which provide 10 free accounts with
100 Ether each for one particular project.We can create any no of projects in Ganache
Truffle suite.
When a transaction is performed we can get to know all the transaction information but
we cant track the transaction made by a user.
Page 40 of 60
The transaction has the following information:
Nonce
Amount:
Gas Limit:
Gas Limit is the maximum amount a cryptocurrency user is willing to pay when
sending a job, or doing smart contract work, to the Ethereum blockchain.
Gas used:
It is the fee or the pricing value that is used to perform the transaction.
Base Fee, Priority fee, Total gas fee, Max fee for gas and total Ethereum spent on the
transaction.
Page 41 of 60
We can also view the transaction details on the etherscan website which contains all the
information about the transaction.
Page 42 of 60
Figure 5.16 Ganache Suite
Ganache is an instant blockchain for Ethereum and Corda 's distributed application
development. We can use Ganache for the development, which enables us to develop,
implement, and test our dApps in a secure and secure environment.[14]
We have successfully deployed the application on Netlify, where users can access the
application by living any place. This only works if they have Metamask extension on
their browser and have some Eth coins with them.
https://e-voting-blockchain.netlify.app/
Page 44 of 60
TRANSACTION
V
Cryptographic pieces of datathat can be used to
T generatethe senders account address.
Generated from the users private key.
S
Page 45 of 60
6. CONCLUSIONS
6.1 Conclusions
Active E-Voting platform created using HTML / CSS / JavaScript, React.js, Material
UI, Ganache, Truffle Integrated Environment, Infura and Metamask. Users were able
to register for the application and the administrator was able to add candidates to the
election. The administrator was able to control the entire election process.The main
objective of the project and achieved is that the user can only vote once. In each case
the work will be done using the Metamask wallet and the details of the transaction will
be displayed on the ether scan, but no one can track the user who did the work because
it is completely protected by cryptographic hashing. User votes are cryptographically
protected. Once the votes have been saved they have not changed and there is evidence
of disruption. The system maintains voter privacy and anonymity. The program also
promotes transparency. The system allows for quick results.
6.1.1 Limitations
Page 46 of 60
6.2 Recommendations/Future Work/Future Scope
The application should have a proper Domain name instead of using Hosting systems
like Heroku and Netlify. The application can have translation feature using Google Api.
We can also add Face Recognition feature to have more security when ever user login
to the application. The Aadhaar Card validation is not added in the current application
as the Api is not open source and will not be given for un-authorized users.
We can add more Stylings to improve the website and can make the system
robust.
We need to work on or look on how to make the transaction speed faster.
Page 47 of 60
REFERENCES
[1] G. Rathee, R. Iqbal, O. Waqar and A. K. Bashir, "On the Design and
Implementation of a Blockchain Enabled E-Voting Application Within IoT-
Oriented Smart Cities," in IEEE Access, vol. 9, pp. 34165-34176, 2021, doi:
10.1109/ACCESS.2021.3061411.
Page 48 of 60
[7]K. Garg, P. Saraswat, S. Bisht, S. K. Aggarwal, S. K. Kothuri and S. Gupta,
"A Comparitive Analysis on E-Voting System Using Blockchain," 2019 4th
International Conference on Internet of Things: Smart Innovation and Usages
(IoT-SIU), 2019, pp. 1-4, doi: 10.1109/IoT-SIU.2019.8777471.
Available:https://docs.soliditylang.org/en/
v0.8.10/
Page 49 of 60
[14] (web article) Akash Mittal - Truffle Suite tutorial: How to develop
Ethereum smart contracts, November 2021
Available:https://blog.logrocket.com/truffle-suite-tutorial-develop-
ethereum-smart-contracts/
[16]https://www.geeksforgeeks.org/decentralized-voting-system-using-
blockchain/
Page 50 of 60
APPENDICES
Solidity code
Page 51 of 60
Page 52 of 60
Web3.js
Page 53 of 60
Frontend
Step 1: Create React app
Step 2: Install required dependencies
Step 3: Create App.js file and create routes
Step 4: Create a screens folder to store page components
Step 5: Create components folder to store general components
Step 6: Create a user context
Step 7: Initialize Metamask using web3.js
Step 8: Check if Metamask is loading Ganache accounts
Step 9: After building main functionality add styling
Below code in smart in contract adds all users using map function in solidity language
Authentication
Authentication using normal Databases
• Firebase
• Mongodb
• Mysql
Above public databases there is a high chance of hacking , admin has chance to
manipulate database , here user details are at high risk
Authentication using Blockchain
Page 54 of 60
Declared function in smart contract
Page 55 of 60
Modules used to develop website
Frontend Routes
Since we are using React JS it is a single page application here we use routes.
Page 56 of 60
Calculating the winner
Page 57 of 60
Frontend Code
Page 58 of 60
Page 59 of 60
Finally smart contract is deployed to the ropsten network which is provided by Infura
Page 60 of 60