Voting System Mini Project Report
Voting System Mini Project Report
BLOCKCHAIN TECHNOLOGY
of
BACHELOR OF TECHNOLOGY
in
BONAFIDE CERTIFICATE
This is to certify that the project work entitled “ELECTRONIC VOTING SYSTEM USING
BLOCKCHAIN TECHNOLOGY” is a bonafide work done by A.R.SHRENATH
[REGISTER NO: 20TK000], ADHITHYA.E [REGISTER NO: 20TK0002], DHINESH.D
[REGISTER NO: 20TK0004] in partial fulfillment of the requirement for the award of B.Tech
Degree in DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (INTERNET OF
THINGS AND CYBER SECURITY INCLUDING BLOCK CHAIN TECHNOLOGY) by
Pondicherry University during the academic year 2022-23.
It gives us great ecstasy of pleasure to convey our deep and sincere thanks to our Principal Dr. S.
MALARKKAN, for giving constant motivation in succeeding our goal.
With profoundness we would like to express our sincere thanks to Dr.N. POONGUZHALI ,
Head of the Department, Computer Science Engineering (Internet of Things and Cyber Security
Including Block Chain Technology), for her kindness in extending the infrastructural facilities to
carry out our project work successfully.
We extend our sincere and heartfelt thanks to our guide Dr. N. POONGUZHALI, Associate
Professor, Department of Computer Science Engineering (Internet of Things and Cyber Security
Including Block Chain Technology) for providing the right ambience for carrying out this work
and her valuable guidance and suggestions for our project work. I thank her for the continuous
encouragement and the interest shown on us to bring out our project work at this stage and also
for providing the freedom that we needed and wanted.
We would like to express our gratitude to all teaching and non-teaching staff members of our
Department for the support they extended during the course of this project.
TABLE OF CONTENTS
1 BONAFIDE CERTIFICATE
2 KNOWLEDGEMENT
3 TABLE OF CONTENTS
4 ABSTRACT
5 INTRODUCTION
6 EXISTING SYSTEM
7 PROPOSED SYSTEM
8 SOURCE CODE
Current voting systems like ballot box voting or electronic voting suffer from various security
threats such as DDoS attacks, polling booth capturing, vote alteration and manipulation, malware
attacks, etc, and also require huge amounts of paperwork, human resources, and time. This
creates a sense of distrust among existing systems.
Abstract
The Proposed system presents an effort to leverage benefits of blockchain such as cryptographic
foundations and transparency to achieve an effective scheme for evoting. The proposed scheme
conforms to the fundamental requirements for e-voting schemes and achieves end-to-end
verifiability. The report presents details of the proposed e-voting scheme along with its
implementation using Multichain platform. The system presents in-depth evaluation of the
scheme which successfully demonstrates its effectiveness to achieve an end-to-end verifiable e-
voting scheme.
Introduction
Electronic voting or e-voting has been used in varying forms since 1970s with fundamental
benefits over paper based systems such as increased efficiency and reduced errors. But, there
remain challenges to achieve wide spread adoption of such systems especially with respect to
improving their resilience against potential faults. Blockchain is a disruptive technology of
current era and promises to improve the overall resilience of e-voting systems.
Elections are fundamental pillar of a democratic system enabling the general public to express
their views in the form of a vote. Due to their significance to our society, the election process
should be transparent and reliable so as to ensure participants of its credibility. Within this
context, the approach to voting has been an ever evolving domain. This evolution is primarily
driven by the efforts to make the system secure, verifiable and transparent. In view of its
significance, continuous efforts have been made to improve overall efficiency and resilience of
the voting system. Electronic voting or e-voting has a profound role in this. Since its first use as
punched-card ballots in 1960’s, e-voting systems have achieved remarkable progress with its
adaption using the internet technologies.
However, e-voting systems must adhere to specific benchmark parameters so as to facilitate its
widespread adoption. These parameters include anonymity of the voter, integrity of the vote and
non-repudiation among others. Blockchain is one of the emerging technologies with strong
cryptographic foundations enabling applications to leverage these abilities to achieve resilient
security solutions. A Blockchain resembles a data structure which maintains and shares all the
transactions being executed through its genesis. It is primarily a distributed decentralized
database that maintains a complete list of constantly germinating and growing data records
secured from unauthorized manipulating, tampering and revision.
Electronic voting has been an area of research focus for many years by using computing
machines and equipment for casting votes and producing high quality and precise results in
accordance with the sentiments of the participating voters. Various attempts have been adopted
in practice to support election process. Initially computer counting system allowed the voter to
cast vote on papers. Later on, those cards went through the process of scanning and tallying at
every polling cell on a central server. Direct Recording Electronic (DRE) voting systems were
put in place later on which were admired and acknowledged greatly by the voters in-spite of the
resistance from computer scientists. If the voting system is well understood by the voters, the
system’s usability can be increased remarkably.
DRE systems in particular have gathered a lot of successes in bringing the voters to use this
technology. These systems work more or less in the same way as any conventional election
system does. In the case of DRE, a voter begins his journey by going to their polling place and
get their token to vote where he utilizes his token at the voting terminal to vote for his candidate.
When the candidate selection procedure is completed, DRE systems present the final selection to
the voter before actually casting it (in case if the voter wants to change his opinion) and after the
final selection, the ballot casting is completed.
More recently, distributed ledger technologies such as blockchain have been used to achieve e-
voting systems primarily due to their advantages in terms of end-to-end verifiability. With
properties such as anonymity, privacy protection and non-repudiation, blockchain is a very
attractive alternative to contemporary e-voting systems.
Existing system
The existing approaches perform well for end-to-end verifiability without compromising the
privacy of voters. In the implementation of decentralized and self-tallying internet voting
protocol over the blockchain using Ethereum. Since current voting systems don’t suffice to
security needs of modern generation, there is a need to build a system that leverages security,
convenience, and trust involved in voting process. Hence voting systems make use of Blockchain
technology to add an extra layer of security and encourage people to vote from any time,
anywhere without any hassle and makes voting process more cost-effective and time-saving.
Proposed System
MetaMask : A software cryptocurrency wallet , which is used to interact with the Ethereum
blockchain. It allows users to access their Ethereum wallet through a browser extension or
mobile app, which can then be used to interact with decentralized applications. Truffle and
Ganache : Truffle is a framework that was used throughout the process of developing the
prototype. It was helpful by having the ability to act as a package manager, but also came with
built-in functionality to compile Solidity code and deploy it to a blockchain. Truffle offered three
different commands: truffle compile, truffle migrate and truffle test which were used to compile
the contracts, deploy them to a blockchain on the network and perform tests on them. Ganache
was used to simulate an Ethereum blockchain on a local machine. It came in two different
representations, GUI and CLI.
The generic requirements for a typical e-voting system have been defined in. We present a brief
description of each requirement along with an explanation of how the proposed system fulfils it.
Privacy - Keeping an individual’s vote secret The system leverages cryptographic properties of
blockchain to achieve privacy of a voter. More specifically, as voter is registered into the system,
a voter hash is generated by blockchain which is the unique identifier of a voter into the
blockchain, and is protected from misuse due to collision resistance property of the
cryptographic hash. Due to this, the traceability of a vote is also non-trivial thereby protecting
the voter when under duress.
Eligibility - Allowing only registered voters to vote, with each such voter voting only once All
eligible users are required to register using unique identifiers such as government-issued
documents to assert their eligibility. In addition to this, our system implements strong
authentication mechanism using finger printing technology to assert that only authorized voters
can access the system.
Furthermore, the use of biometrics also enables the system to protect against double voting.
Receipt Freeness - Voters should be unable to prove to a third party that they voted in a
particular way The proposed system enables a voter to vote as per their choice and creates a
cryptographic hash for each such event (transaction). This is important to achieve verifiability
i.e. to verify if a certain vote was included in the count. However, possession of this hash does
not allow to extract information about the way voter has voted.
Convenience - Voters must be able to vote easily, and everyone who is eligible must be able to
vote The system has been implemented using a user friendly web based interface with the voting
process requiring minimal input from the user. For instance, fingerprinting is implemented for
authentication mechanism to avoid the requirement to remember username/passwords.
Furthermore, the overall process is integrated which enables the user to interact with it in a
seamless manner.
Verifiability - The ability to trust the vote tallying process Upon casting their vote successfully, a
user is provided with their unique transaction ID in the form of a cryptographic hash. A user can
use this transaction ID to track if their vote was included in the tallying process.
Architecture Diagram
However, this process does not enable a user to view how they voted which has been adopted to
mitigate threats when under duress. The analysis presented above highlights the performance of
the proposed system with respect to the specific requirements of e-voting. It also highlights the
significance of defining characteristics of blockchain and their profound role in achieving the
cornerstones of an efficient e-voting system. Therefore, we believe the work presented here
makes significant contribution to the existing knowledge with respect to the application of
blockchain technology to achieve a secure digital voting system.
Source Code
// SPDX-License-Identifier: MIT
contract VotingSystem {
struct Candidate {
string name;
uint256 voteCount;
}
votingOpen = true;
modifier onlyOpen() {
_;
candidates[_candidateId].voteCount++;
voters[msg.sender] = true;
totalVotes++;
votingOpen = false;
}
function getCandidatesCount() public view returns (uint256) {
return candidates.length;
// SPDX-License-Identifier: MIT
contract Ballot {
struct Voter {
string name;
uint8 age;
uint8 stateCode;
uint8 constituencyCode;
bool isAlive;
}
struct Candidate {
// we can use one of bytes1 to bytes32 because they are much cheaper
string name;
string partyShortcut;
string partyFlag;
uint8 stateCode;
uint8 constituencyCode;
address electionCommision;
public
view
public
view
uint256 _politicianOfMyConstituencyLength = 0;
if (
voter_.constituencyCode == candidates[i].constituencyCode
) _politicianOfMyConstituencyLength++;
_politicianOfMyConstituencyLength
);
uint256 _indx = 0;
if (
voter_.constituencyCode == candidates[i].constituencyCode
){
cc[_indx] = Candidate({
name: candidates[i].name,
partyShortcut: candidates[i].partyShortcut,
partyFlag: candidates[i].partyFlag,
voteCount: 0,
nominationNo: candidates[i].nominationNo,
stateCode: candidates[i].stateCode,
constituencyCode: candidates[i].constituencyCode
});
_indx++;
return cc;
function vote(
uint256 candidateNominationNo,
uint256 voterAadharNumber,
uint256 currentTime_
public
areVotingLinesOpen(currentTime_)
isEligibleVote(voterAadharNumber, candidateNominationNo)
voter[voterAadharNumber].voted = true;
voter[voterAadharNumber].votedTo = candidateNominationNo;
if (candidates[i].nominationNo == candidateNominationNo) {
candidates[i].voteCount++;
break;
_;
require(voter_.isAlive);
require(!voter_.voted);
require(
politician_.constituencyCode == voter_.constituencyCode)
);
_;