You are on page 1of 31

Blockchain based voting system Introduction

Chapter 1
Introduction
Democratic voting is a crucial and serious event in any country. The most common way in which a
country votes is through a paper-based system, but is it not time to bring voting into the 21st century of
modern technology?

The twentieth century has modernized the voting system with the arrival of electronic voting machines
which supersedes the traditional ballot system in numerous ways. Although the e-voting system is much more
modernized than the earlier ballot system of voting, it does have its own vulnerabilities and hindrances. The
electronic voting machine itself is expensive and upon that there lies the expense of setting up security in the
voting areas, the human labor for conducting the election and the huge prospect of the error in vote count by
human mistake. Then there lies the hurdle of possible tampering of electronic machine to rig the election itself
and the unsolved problem to huge time consumption for voting that cannot be addressed till date.

Digital voting is the use of electronic devices, such as phones, mobiles, and desktops through internet, to
cast votes. These are sometimes referred to as e-voting when voting using a machine in a polling station, and
i-voting when using a web browser.

Security of digital voting is always the biggest concern when considering implementing a digital voting
system. With such monumental decisions at stake, there can be no doubt about the system’s ability to secure
data and defend against potential attacks. One way the security issues can be potentially solved is through the
technology of blockchains.

Blockchain technology originates from the underlying architectural design of the cryptocurrency bitcoin.
It is a form of distributed database where records take the form of transactions, a block is a collection of these
transactions. With the use of blockchains a secure and robust system for digital voting can be devised.

The purpose is to cultivate the use of blockchain for the above-mentioned problems in the voting system.
Blockchain alleviates the problems of expensiveness, vulnerability and time consumption by a large extent
and provides security which is very difficult to tamper with. The blockchain technology decentralizes the data
and brings about the transparency which is a much-needed aspect for the elections.

1.1 Blockchain
Blockchain technology was first used within Bitcoin and is a public ledger of all transactions. A
blockchain stores these transactions in a block, the block eventually becomes completed as more transactions
are carried out. Once complete it is then added in a linear, chronological order to the blockchain.

Dept. of ISE, SIT, Tumakuru 1 2020-21


Blockchain based voting system Introduction

Fig. 1.1 – Hash table

The initial block in a blockchain is known as the ‘Genesis block’ or ‘Block 0’. The genesis block is
usually hardcoded into the software which is special in that it does not contain a reference to a previous block.
Once the genesis block has been initialized, Block 1 is created. Each block has a transaction data part, copies
of each transaction are hashed, and then the hashes are paired and hashed again, this continues until a single
hash remains which is also known as Merkle root (Figure 1.1). The block header is where the hash is stored.
To ensure that a transaction cannot be modified each block also keeps a record of the previous block’s header,
this means to change data you would have to modify the block that records the transaction as well as all
following blocks, as seen in Figure 1.2.

Fig. 1.2 - Simplified bitcoin block chain

Dept. of ISE, SIT, Tumakuru 2 2020-21


Blockchain based voting system Introduction

A blockchain is designed to be accessed across a peer-to-peer network, each node/peer then


communicates with other nodes for block and transaction exchange. Once connected to the network, peers
start sending messages about other peers on the network, this creates a decentralized method of peer
discovery. The purpose of the nodes within the network is to validate unconfirmed transactions and recently
mined blocks before a new node can start to do this it first has to carry out an initial block download. The
initial block download makes the new node download and validate all blocks from block 1 to the most current
blockchain, once this is done the node is considered synchronized.

1.2 Types of blockchain


Currently, there are mainly four types of blockchain networks — public blockchains, private
blockchains, consortium blockchains and hybrid blockchains.

1.2.1 Public blockchains

A public blockchain has absolutely no access restrictions. Anyone with an Internet connection
can send transactions to it as well as become a validator (i.e., participate in the execution of a consensus
protocol). Usually, such networks offer economic incentives for those who secure them and utilize some
type of a Proof of Stake or Proof of Work algorithm.

1.2.2 Private blockchains

A private blockchain is permissioned. One cannot join it unless invited by the network
administrators. Participant and validator access is restricted. To distinguish between open blockchains
and other peer-to-peer decentralized database applications that are not open ad-hoc compute clusters, the
terminology Distributed Ledger (DLT) is normally used for private blockchains.

1.2.3 Hybrid blockchains

A hybrid blockchain has a combination of centralized and decentralized features. The exact
workings of the chain can vary based on which portions of centralization decentralization are used.

1.2.4 Consortium blockchains

Federated blockchain or consortium blockchain is a blockchain technology where instead of only


a single organization, multiple organizations govern the platform. It is not a public platform rather a
permissioned platform. More so, it is quite like private blockchains as well.

Dept. of ISE, SIT, Tumakuru 3 2020-21


Blockchain based voting system Introduction

Fig. 1.3 – Types of blockchain

1.3 Consensus algorithms


A consensus algorithm is a procedure through which all the peers of the Blockchain network
reach a common agreement about the present state of the distributed ledger. In this way, consensus
algorithms achieve reliability in the Blockchain network and establish trust between unknown peers in a
distributed computing environment. Essentially, the consensus protocol makes sure that every new block
that is added to the Blockchain is the one and only version of the truth that is agreed upon by all the
nodes in the Blockchain.

The Blockchain consensus protocol consists of some specific objectives such as coming to an
agreement, collaboration, co-operation, equal rights to every node, and mandatory participation of each
node in the consensus process. Thus, a consensus algorithm aims at finding a common agreement that is
a win for the entire network. There are various consensus algorithms but two most common are Proof of
Work and Proof of Stake.

1.3.1 Proof of Work (PoW)

This consensus algorithm is used to select a miner for the next block generation. Bitcoin uses this
PoW consensus algorithm. The central idea behind this algorithm is to solve a complex mathematical
puzzle and easily give out a solution. This mathematical puzzle requires a lot of computational power
and thus, the node who solves the puzzle as soon as possible gets to mine the next block.

Dept. of ISE, SIT, Tumakuru 4 2020-21


Blockchain based voting system Introduction

Fig. 1.4 – Proof of Work flow

1.3.2 Proof of Stake (PoS)

This is the most common alternative to PoW. Ethereum has shifted from PoW to PoS consensus.
In this type of consensus algorithm, instead of investing in expensive hardware to solve a complex
puzzle, validators invest in the coins of the system by locking up some of their coins as stake. After that,
all the validators will start validating the blocks. Validators will validate blocks by placing a bet on it if
they discover a block which they think can be added to the chain. Based on the actual blocks added in
the Blockchain, all the validators get a reward proportionate to their bets and their stake increase
accordingly. In the end, a validator is chosen to generate a new block based on their economic stake in
the network. Thus, PoS encourages validators through an incentive mechanism to reach to an agreement.

Fig. 1.5 – Proof of Stake flow

Dept. of ISE, SIT, Tumakuru 5 2020-21


Blockchain based voting system Literature survey

Chapter 2
Literature Survey
2.1 Existing System
In [1] Ahmed Ben Ayed, the author proposes the generation of hash for a block using Secure
Hash Algorithm (SHA-256) designed by NSA (national security agency). The SHA-256 will take any
size plaintext as an input and encrypt it to a 256-byte binary value. The SHA-256 is always a 256-bit
binary value, and it is a strictly one-way function.

Fig.2.1 – SHA 256 encryption

Researchers of the [5], proposed a peer-to-peer blockchain based voting system. Focus of this research
is to protect the anonymity of the ballots and commitment of the votes to the blockchain. According to this
purpose, they propose a unique vote commitment format. Their solution has solid base for such a vote
commitment format, but we propose a different system that leans on another system that is maintained by
government. In this purpose we preferred to use a structure for chains that consists of different key-value pairs
represents vote itself.

Pavel Tarasov and Hitesh Tewar [7] presented protocol developed on blockchain technology. The
underlying technology used in the voting system is a payment scheme, which offers anonymity of
transactions, a trait not seen in blockchain protocols to date. The proposed protocol offers anonymity of voter
transactions, while keeping the transactions private, and the election transparent and secure. The underlying
payment protocol has not been modified in any way; the voting protocol merely offers an alternative use case.

In [2] Alperen Kantarcı et al. they propose a system that will be consisting of nodes which are
closed to human interference. Any input that cannot be considered as vote will be ignored in this system.
For such a system, stealing votes or changing votes are totally blocked. When citizen cast a ballot, e-
government system will be informed without revealing any information about vote. Then, e-government
system marks that person as voted. Since the system takes electorate data from e-government, it is not
possible for a marked person to vote again. They propose a system that has a levelled structure. There
will be different number of levels in that system according to necessities of the country. To provide a
fast, consistent, and secure system, system is designed in a levelled architecture.

Dept. of ISE, SIT, Tumakuru 6 2020-21


Blockchain based voting system Literature survey

Fig.2.2 – General system architecture

In [3] Andrew Barnes et al. they propose a system that that does not entirely replace the current
voting but rather integrates within a current system. For registration, a voter blockchain is used to keep a
record of the voter information where their proposed service utilizes both postal based forms as well as
web forms. This information includes their national identity number, postal address, optional email
address and a password. All this information then forms a transaction for the user agreeing with the
government that they are asking to vote.

Dept. of ISE, SIT, Tumakuru 7 2020-21


Blockchain based voting system Literature survey

The network is a multi-tiered, decentralized infrastructure which houses the two distinct
blockchains, the network is divided into three abstract tiers, National, Constituency and Local. For
voting, a vote blockchain which keeps record of a vote casted by a person/voter and the authentication of
a user requires three distinct pieces of evidence; their identification number, the password supplied on
registration, their ballot card which contains a QR code. Once the vote(transaction) is casted, it is passed
onto the constituency node and eventually to all peers/data blocks until the whole network is updated.

Fig.2.3 – Overview of node architecture

In [4], the voting process relies on citizen’s email address that can be hacked or manipulated easily. To
be obvious, there will be always some people who registers to the system using someone else’s mail address
and votes on behalf of them. For example, a grandson may open an email address for his grandparents from
different devices and cast their votes. This method guarantees none of the required qualifications such as

Dept. of ISE, SIT, Tumakuru 8 2020-21


Blockchain based voting system Literature survey

security, data integrity or privacy that an e-voting system has system. For such a system, stealing votes or
changing votes are totally.

E-voting could take many forms: using the internet or a dedicated, isolated network; requiring voters
to attend a polling station or allowing unsupervised voting; using existing devices, such as mobile phones and
laptops, or requiring specialist equipment. To continue trusting central authorities to manage elections or to
use blockchain technology to distribute an open voting record among citizens. Many experts agree that e-
voting would require revolutionary developments in security systems. The debate is whether blockchain will
represent a transformative or merely incremental development, and what its implications could be for the
future of democracy [6].

The blockchain network is decentralized meaning that it doesn’t have governing authority or a single
person looking after the framework. This brings about the much needed “transparency” that is the
decentralized nature of technology creates a transparent profile of every voter. Every change on the
blockchain is viewable and makes it more concrete [8].

A public ledger will provide every information about a transaction(vote) and the participant(voter). It
is distributed among everyone in the network and nowhere to hide. The voters can witness everything that is
happening in the ledger [8].

Immutability refers to something that cannot be changed or altered. This is one of the important
blockchain features which makes it an unalterable network. Every node on the system has a copy of the digital
ledger. To add a transaction(vote) every node needs to check its validity. If the majority thinks it’s valid, then
it’s added to the ledger (i.e., to the blockchain network). This aspect makes it next to impossible to tamper
with a vote [9].

As decentralization is achieved, no one can just simply change any characteristics of the network for
their benefit. Using cryptography, blockchain ensures another layer of security for the system. Every
information on the blockchain is hashed cryptographically. In simple terms, the information on the network
hides the true nature of the data. All the blocks in the ledger come with a unique hash of its own and contain
the hash of the previous block. So, changing or trying to tamper with the vote will mean changing all the hash
IDs. And that’s kind of impossible [9].

2.2 Proposed System

2.2.1 Smart contracts

A Smart Contract (or crypto contract) is a computer program that directly and automatically controls
the transfer of digital assets between the parties under certain conditions. A smart contract works in the same

Dept. of ISE, SIT, Tumakuru 9 2020-21


Blockchain based voting system Literature survey

way as a traditional contract while also automatically enforcing the contract. Smart contracts are programs
that execute exactly as they are set up (coded, programmed) by their creators. Just like a traditional contract is

enforceable by law, smart contracts are enforceable by code.

A smart contract is just a digital contract with the security coding of the blockchain. A smart contract
has details and permissions written in code that require an exact sequence of events to take place to trigger the
agreement of the terms mentioned in the smart contract. It can also include the time constraints that can
introduce deadlines in the contract.

This contract is embedded in the blockchain making it transparent, immutable, inexpensive, and
decentralized. Every smart contract has its address in the blockchain. The contract can be interacted with by
using its address presuming the contract has been broadcasted in the network. With smart contracts being the
core of our blockchain based voting system we propose a 4-phase system.

1. Authentication Phase
2. Voting phase
3. Encryption of votes and adding to the blockchain
4. Display result

The complete implementation will be explained later in system implementation phase

2.2.2 Scope of the project

Innate characteristics of the blockchain technology show that over the last decade they are cutting-
edge in bucking typical cyber-threats. These symbolic specs afford Blockchain an air of invincibility over
paper ballots:

Immutability

Many experts vouch for the role of Blockchain Technology in online voting as the architecture offers
an immutable apparatus. Security and privacy are two pivotal aspects that bear the load of public expectations
for online voting systems. As far as the memory goes, the Bitcoin Blockchain, which was purportedly the first
globally famed version of the tech, has never been tampered with.

The longer the node-chain gets, the harder, more resourceful (and senseless) a 51% attack gets. It is
this formidable, God-like, and law-abiding image that Blockchain can attest to our elections and act as an
agent of trust.

Dept. of ISE, SIT, Tumakuru 10 2020-21


Blockchain based voting system Literature survey

Transparency

A Blockchain voting app would naturally offer transparency in terms of validating the accuracy of the
trail of inputted votes. In such a blockchain-based voting system the entries would be time-stamped and
encrypted before being secured with private keys. This might sound futuristic, yet the truth is that the
upcoming elections will be dominated by technology like these.

Anonymity

Since the nodes are distributed randomly, the dependency on a centralized authority to secure the
cyberspace is automatically mitigated in a Blockchain voting system. Not to mention the added layers of
anonymity that the peer-to-peer network augments the entire system with. Electronic voting using Blockchain
could introduce familiar identification mechanisms for people, such as 2-factor authentication, to preserve the
sanctity of the election. Depending upon the nature of the Blockchain, node-participation could be opened to
public-players, increasing the economy of scale, and bringing down the cost to operate.

Processing time

The turn-around time post the election to the result day is a lot, by the current measure of technology.
Such a monumental organization of election professionals, coordinating at enormous, mind-bending scales
warrants equally appreciable time. But all that could evaporate in the blink of an eye with Blockchains that, by
the way, offer real-time results.

The Bitcoin Blockchain, which is slower in processing transactions, takes a minimum of 10 minutes to
update and broadcast the new transactions to the network. Ethereum is still faster. Imagine hearing who the
public elects as its leading representative, within minutes of concluding the final round of votes. It is possible
with Blockchain.

2.2.3 Aim of the project

Security and trust are seen as the most important issues in electronic voting systems. Therefore, it is
necessary to use cryptographic procedures to ensure anonymity, security, privacy, and reliability in these
systems. In recent years, blockchain has become one of the most used methods for securing data storage and
transmission through decentralized applications. E-voting is one of these application areas. However, data
manipulation is still seen as a major potential problem in e-voting systems. The project is aimed at ensuring
that the election results can be counted after the participation of all stakeholders at the end. In this way,
potential manipulations may be prevented during the election period. As a result of the model, the privacy of
voters is ensured, no central authority is needed, and the recorded votes are kept in a distributed structure.

Dept. of ISE, SIT, Tumakuru 11 2020-21


Blockchain based voting system Requirement specification

Chapter 3

Requirements Specification

3.1 Software Requirements


The software requirements of the project include:

 Database (MySQL v5.7.31)


 Remix (v0.10.3)
 Solidity (v0.5.14)
 Ganache (v2.5.4)
 PHP (v7.4)
 Ethereum (v2.0)

3.1.1 Database

A database is an organized collection of structured information, or data, typically stored electronically
in a computer system. The data can then be easily accessed, managed, modified, updated, controlled, and
organized.

In the project there are 3 tables namely Voter, Candidate and Admin to store the detail of all the people
who are involved in the election. The Candidate and Admin will have a distinct identity which will be stored
in their respective databases that will be asked at the time of Authentication. If the identity provided by the
respective student is correct, then they will be allowed to cast the vote or else will be discarded and will not be
allowed to participate in voting. If the vote is casted then the Candidate Database will be updated, and a new
node will be formed

3.1.2 Remix

Remix IDE is an open-source web and desktop application. It fosters a fast development cycle and has
a rich set of plugins with intuitive GUIs. Remix is used for the entire journey of contract development as well
as being a playground for learning and teaching Ethereum. Remix is also part of the Remix Project which is a
platform for development tools that use a plugin architecture. It encompasses sub-projects including Remix
Plugin Engine, Remix Libs, and of course Remix-IDE.

Remix IDE is a powerful open-source tool that helps you write Solidity contracts straight from the
browser. It is written in JavaScript and supports both usage in the browser, in the browser but run locally and

Dept. of ISE, SIT, Tumakuru 12 2020-21


Blockchain based voting system Requirement specification

in a desktop version. Remix IDE has modules for testing, debugging and deploying of smart contracts and
much more.

3.1.3 Solidity

Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts
are programs which govern the behaviour of accounts within the Ethereum state. It is influenced by C++,
Python and JavaScript, and is designed to target the Ethereum Virtual Machine (EVM). Solidity is statically
typed, supports inheritance, libraries, and complex user-defined types among other features. With Solidity you
can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets. When
deploying contracts, you should use the latest released version of Solidity. This is because breaking changes
as well as new features and bug fixes are introduced regularly.

3.1.4 Ganache

Ganache is used for setting up a personal Ethereum Blockchain for testing your Solidity contracts. It
provides more features when compared to Remix. Ganache comes in two flavours: a UI and CLI. Ganache UI
is a desktop application supporting both Ethereum and Corda technology. The command-line tool, ganache-
cli is available for Ethereum development. In our project we will be using the UI version of ganache

3.1.5 PHP

The PHP Hypertext Pre-processor (PHP) is a programming language that allows web developers to
create dynamic content that interacts with databases. PHP is basically used for developing web-based software
applications.

In the project, we have 5 web pages interconnected to Remix, Ganache and the database which is the
used for the displaying the information either for voter or the admin without knowing the internal details of
how it works. We have made it user friendly where the working is very simple, where the voter and admin can
easily interact and run their election.

3.1.6 Ethereum

Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether is the


native cryptocurrency of the platform. After bitcoin, it is the largest cryptocurrency by market capitalization.
Ethereum is the most actively used blockchain.

The platform allows developers to deploy permanent and immutable decentralized applications onto it,
with which users can interact. applications provide a broad array of financial services without the need for

Dept. of ISE, SIT, Tumakuru 13 2020-21


Blockchain based voting system Requirement specification

typical financial intermediaries, such as brokerages, exchanges, or banks, allowing cryptocurrency users to


borrow against their holdings or lend them out for interest. Ethereum also allows for the creation and
exchange of NFTs, which are non-interchangeable tokens connected to digital works of art or other real-world
items and sold as unique digital property.

3.2 Hardware Requirements

The minimum hardware Requirements of the project is:

 Processor: i5
 RAM: 4GB
 Hard disk :256GB

Dept. of ISE, SIT, Tumakuru 14 2020-21


Blockchain based voting system System design

Chapter 4

System Design

4.1 Database design

Admin

Name: String Password: String

Candidate

Name: String USN: String Count: Integer

Voter

USN: String Password: String

Fig 4.1 – Schema diagram

Admin table is for the person who will be conducting the election where the name and password are
the entities of the table. Name will be treated as the username of the admin and the password is his protection
ID. Here if both the credentials provided by the user is correct, they will be allowed to enter the election page
where they can register the voters and candidates who will be participating in the election. To start the
election, they need to press the start button. After the start button is pressed the election will be activated and
all the voters can login and vote for their candidate.

Candidate table is where names of the candidate who will be standing for the election will be added.
This process will be done by the admin where after he has successfully provided his username and password,
he will be adding candidate to this database where name is treated as the name of the candidate, USN is the
distinct character set provided for the candidate to differentiate between the candidates and count is the no of
votes casted to the respective candidate which will be done in the blockchain by incrementing.

Voter table is the one which will be inserted by the admin. After providing their proper username and
password, they can login and cast vote of their choice and password will be distinct. After the admin has
registered all the voters, he/she can start the election where only the voters registered by the admin can login
and cast their vote and others who have not been registered cannot login. Voters can login after providing the

Dept. of ISE, SIT, Tumakuru 15 2020-21


Blockchain based voting system System design

credentials which admin registered where only if the provided credentials are correct then Candidate list will
be seen by the voters and can choose their respective candidate.

4.2 Use Case Diagram

Authentication

Add

Candidate

Add
Admin Voter

Cast vote

Start/Stop

Voter

Declare Results

View

winner

Fig. 4.2 – Use case diagram

Dept. of ISE, SIT, Tumakuru 16 2020-21


Blockchain based voting system System design

Use case diagrams give a graphic overview of the actors involved in a system, different functions
needed by those actors and how these different functions interact. In this use case diagram actors are admin
and voters, and the functions are as specified inside the box.

4.2.1 Admin functions

The functions of the admin are:

 Authentication is where admin needs to specify his username and password correctly to enter the web.
 Add candidate is where admin will be registering the candidate’s name to candidate database who is
interested in standing for the election.
 Add voter is where the admin will be registering the voters who will be casting the vote to candidate
of their choice stood for the election.
 Start/Stop is where the option which is provided to the admin where he can start the election and end
the election at any given time. The voters must cast their votes within this time.
 Declare result is the function where the admin, after stopping the election can declare the result where
all the voters and admin can view the result.
 View Result is the function where the candidate who has got the most no of votes will be displayed
along with the number of votes the candidate has got.

4.2.2 Voter functions

The functions of the voters are:

 Authentication where the voter needs to provide his/her username and password to enter the voting
system and cast their vote to respective candidate.
 Cast vote is the function where the voter will be able to see all the candidates who have stood for
the election and cast their vote to desired candidate.
 View winner is the function where the voter can see number of votes received by the specific
candidate who had stood for the election and can see the winner on top.

4.3 Data Flow Diagram


A data flow diagram (DFD) maps out the flow of information for any process or system. It uses
defined symbols like rectangles, circles and arrows, plus short text labels, to show data inputs, outputs, storage
points and the routes between each destination. Data flowcharts can range from simple, even hand-drawn
process overviews, to in-depth, multi-level DFDs that dig progressively deeper into how the data is handled.
They can be used to analyse an existing system or model a new one.

Dept. of ISE, SIT, Tumakuru 17 2020-21


Blockchain based voting system System design

4.3.1 Level 0

Fig. 4.3 – Level 0 DFD

Level 0 diagram is also called a Context Diagram. It is a basic overview of the whole system or
process being analysed or modelled. It is designed to be an at-a-glance view, showing the system as a single
high-level process, with its relationship to external entities.

Here the primary use is of the voter who will be voting using the voting system as shown in the figure,
after all the voters have voted then the admin declares the result which will be future elaborated in level 1
diagram. After the admin declares the result all the voters can view the election winner in the voting system.

4.3.2 Level 1

Level 1 DFD provides a more detailed breakout of pieces of the Context Level Diagram. We will
highlight the main functions carried out by the system, as we break down the high-level process of the
Context Diagram into its subprocesses. 

We will start with admin who will need to start the election and then register the voter and candidates
which will be stored in their respective databases as shown in the figure. The voter who will be eligible to vote
will be login into the platform and will be verified with the voter database whether the username and
password provided by the user is valid or not.

If the information provided by the voter matches the data in database of the voter, then they will be
allowed see the candidate list and be able to cast their vote to desired candidate. After voting, they will be
redirected to the result page where result of the election will be declared by the admin in the end and voters
will be able to see the number of votes casted to candidates.

Dept. of ISE, SIT, Tumakuru 18 2020-21


Blockchain based voting system System design

Fig. 4.4 – Level 1 DFD

If the credential of the voter does not match, they will not be allowed to enter the platform and will be
redirected back to the login page. This can happen in three cases where the admin would have not registered
the voter in the voter database, or the username and password provided by the user will be incorrect or if the
voter has already voted.

After all the voters have casted their vote then the admin can end the voting system where no more
votes can be casted by the voter and can declare the result, after which all the voters can see the can result and
see how many votes have been casted to each voter.

Dept. of ISE, SIT, Tumakuru 19 2020-21


Blockchain based voting system System implementation

Chapter 5

System Implementation

5.1 Candidate registration

As we can see in the figure, in the candidate registration phase the admin will login to the platform and
first get to know who all the candidates are interested in standing for the election. The details of the interested
candidate will be inserted into the database of the candidate and detail include the Name, USN and count.

Fig 5.1 – System implementation

Dept. of ISE, SIT, Tumakuru 20 2020-21


Blockchain based voting system System implementation

All the information of the candidate will be stored which will be further seen by the voter to cast their
vote in phase 2. After all the candidates have been registered, the admin will start the election and all the
eligible voters will be allowed to enter the platform and cast their vote to their desired candidate.

Fig 5.2 – SQL database

5.2 Caste Vote

Here all the eligible voters who have been registered by the admin need to provide their username and
password correctly to enter the platform and they will see all the candidates who stood for the election and
will be allowed to vote to a specific candidate only once and he will be redirected to the winner page where
after the election is ended and will be seeing the result.

If the identity specified by the user is not correct, then he will be redirected to the login page where he
will not be allowed to enter the platform and should be either trying or can exit the page.

Here the vote that is casted will be moved to the blockchain and treated as a node which will be having a hash
from and to address which will be future explained in phase 3.

Fig. 5.3 – Voter entered and trying to vote

Dept. of ISE, SIT, Tumakuru 21 2020-21


Blockchain based voting system System implementation

5.3 Result Announcement

Here you can see there is a transaction generated in phase where one vote is converted into a node, and
we will be able to see a from and to node where is it connected as peer to peer. This provides us with the
double layer security which can been seen in Ganache. The addresses are 32-bit hash which will be difficult
for the hackers to decrypt and if they have successfully decrypted and modified the content it can be easily
known as the hash will be different in that node as compared to the hash present other nodes which all
contains a copy of each node in blockchain

Fig 5.4 – Encryption of each transaction through ganache

When Admin stops the election, it means that none of the voter will be allowed to further vote and
enter the platform. The admin will declare the winner by clicking on the result button. This will reflect to the
result page where the number of votes casted to each of candidate will be arranged in a sorted order of which
the maximum number of votes received by the candidate will be placed first then other corresponding
candidates with respect to number of votes received

Fig 5.5 – Result showing winner

Dept. of ISE, SIT, Tumakuru 22 2020-21


Blockchain based voting system Results and discussion

Chapter 6

Results and Discussion


6.1 Attack analysis

To complete an attack, the attacker needs to create another chain that is faster than a legitimate chain.
We considered the probability of an attacker succeeding when attempting to use an illegal chain.

According to Satoshi Nakamoto, an attacker is likely to recover from a given shortfall in which a block
disparity exists among the legal blockchain and their illegal blockchain. The voter waits until the transaction is
added to a block and all other blocks are linked after it. The voter is clearly unaware of the actual
advancement the attacker has made but simply knows that the legitimate blocks took the average expected
time per block. This model requires several assumptions to be made:

 The likelihood of more than one success in a brief time is insignificant.


 The likelihood of a scenario yielding a successful outcome during a short time is relative to the
duration of the time interval.
 The number of successful scenarios that occur during each time is autonomous to each other.
 We are also of the assumption that the likelihood of success does not change during the experiment,
although, voters can alter their resources accordingly.

6.2 Security analysis

The security analysis comprises two aspects. The first aspect involved the security analysis of the
proposed consensus model with the sharding mechanism. Because a 51% attack is one of the security
concerns of blockchain, for instance, with the PoW consensus protocol, nodes that control more than half of
the total CPU power can successfully launch malicious attacks. In contrast, the PoS consensus method is
considered more secure in this regard. This is because, in PoS, a certain number of coins are involved and this
increases the cost of carrying out the 51% attack compared with PoW but although, in the event of a 51%
attack, the attacker's gain would be small. Therefore, malicious nodes have little motivation to attack the
network.

Another aspect involved the security analysis of the proposed blockchain-based voting system, which
can afford the accuracy and security by satisfying the following requirements:

Voter Eligibility: Only a verified voter has the right to vote.

Dept. of ISE, SIT, Tumakuru 23 2020-21


Blockchain based voting system Results and discussion

Verifiability: Every voter can check whether their vote has been tallied appropriately.

Robustness: The results of tallying the votes and the recorded information are transmitted to the blockchain
with which it is difficult to tamper.

Uniqueness: Each vote is considered a transaction and all of them have different transaction hash.

Ballot Receipt: After the elector submits their vote, the transaction ID (TxID) is turned back to the elector as
proof that their vote is recorded successfully in the blockchain.

Transparency: Because the nature of the blockchain offers transparency by default, it ensures that all the
voting procedures are available for the people joining the blockchain network.

Dept. of ISE, SIT, Tumakuru 24 2020-21


Blockchain based voting system Conclusion and future work

Chapter 7

Conclusion and future work


In retrospect, the flaws of current E voting system are increasing significantly in the aspects of
expense, security, time, and consumption. Most importantly the inability to provide transparency to the
citizens is the biggest problem in current voting system. With the arrival of blockchain technology, all of these
hurdles of the current system could be avoided and with its decentralized nature, everything will be
transparent in the system and the prospect of human error ceases to exist.

The blockchain technology is not just limited to voting system, it can be applied in various other fields
like healthcare, banking sector, supply chain, asset management and many more. Walmart is already using the
blockchain technology for the purpose of tracking the supply chain and sooner than later it will be inculcated
in many sectors which brings about the much-needed aspect, credibility.

Dept. of ISE, SIT, Tumakuru 25 2020-21


Bibliography
[1] “A conceptual secure blockchain- based electronic voting system.”, Ahmed Ben Ayed, International
Journal of Network Security & Its Applications (IJNSA) Vol.9, No.3, May 2017, DOI: 10.5121

[2] “Blockchain-Based Electronic Voting System for Elections in Turkey”, Rumeysa Bulut, Alperen Kantarcı,
Safa Keskin, Şerif Bahtiyar, Istanbul Technical University, Istanbul, Turkey, {bulutr, kantarcia, keskinsaf,
bahtiyars}@itu.edu.tr

[3] “Digital Voting with the use of Blockchain Technology”, Andrew Barnes, Christopher Brake and Thomas
Perry, Plymouth university

[4] “Towards the intelligent agents for blockchain e-voting system”, M. Pawlak, A. Poniszewska-Marańda
and N. Kryvinska, Procedia Computer Science, vol. 141, pp. 239-246, 2018.

[5] “The Future of E-voting” IADIS International Journal on Computer Science and Information Systems, P.
Tarasov, and H. Tewari, IADIS International Journal on Computer Science and Information Systems, vol. 12,
no. 2, pp. 148-165, ISSN: 1646-3692.

[6] “An E-voting Protocol Based on Blockchain”, Yi Liu and Qi Wang, ACM, [2010].

[7] “What if blockchain technology revolutionised voting?”, Philip Boucher, EPRS- Europian Parliamentary
Research Services, PE-581.91, [2016].

[8] “Blockchain-Based E-Voting System”, Friðrik Þ. Hjálmarsson, Gunnlaugur K. Hreiðarsson, Mohammad


Hamdaqa, Gísli Hjálmtýsson, School of Computer Science, Reykjavik University, Iceland, {fridrik14,
gunnlaugur15, mhamdaqa, gisli}@ru.is.

[9] https://cointelegraph.com/news/blockchain-for-elections-advantages-cases-challenges, “Blockchain for


Elections: Advantages, Cases, Challenges”, Darryn Pollock, May 17, 2018
APPENDIX

You might also like