Decentralized Blockchain E-Voting System
Decentralized Blockchain E-Voting System
1
ACKNOWLEDGEMENT
2
CONTENT
Introduction 9-10
Objective 11-13
3
EXECUTIVE SUMMARY
**1. Introduction**
4
**3. Key Features**
**4. Benefits**
- Cost Savings: The elimination of physical ballots and manual counting lowers
operational expenses.
5
**5. Implementation Plan**
About System
Talking about the features of this system, the admin can manage the candidates,
view results, and check feedback. While the user can simply vote for all the
available candidates by giving some Basic Details of oneself. This system is A
Interactive Way To Solve Conventional Voting.
The voters can also easily vote for their favourite person without having to go
to the voting area. Also, the admin can easily view voting status. The design of
this project is very simple so that the user won’t find any difficulties while
working on it.
How To Run??
To run this project we installed a virtual server i.e XAMPP on our PC. Online
Voting System in PHP with source code is free to download.
6
After Starting Apache and MySQL in XAMPP, follow the following steps
6th Step: Create a database naming “db_evoting” and then click on the import
tab
7th Step: Click on browse file and select “db_evoting.sql” file which is inside
the “Online-Voting-System” folder
7
The e-voting blockchain project faces challenges such as cybersecurity threats
and potential resistance to change. We address these concerns through robust
security measures, thorough testing, and public awareness campaigns.
**7. Conclusion**
The e-voting blockchain project holds the potential to transform the electoral
landscape by ensuring a more secure, transparent, and accessible voting
experience. By embracing this innovative technology, we can strengthen
democratic processes and restore public faith in the electoral system.
8
INTRODUCTION
9
In this implementation of decentralized blockchain e-voting, various
technical challenges are addressed to ensure the system's robustness and
reliability. Smart contracts play a vital role in executing the voting process
autonomously, enforcing predefined rules and conditions without human
intervention. By leveraging cryptographic techniques and consensus
algorithms, the system guarantees the authenticity and validity of each vote,
enhancing voter confidence in the electoral process.
10
OBJECTIVE
Objective of the Implementation of Decentralized Blockchain
E-Voting
5. Efficiency: Streamline the voting process, reducing the time and resources
required for conducting elections, and providing timely and accurate results.
11
6. Decentralization: Establish a distributed and decentralized network of nodes
that collectively validate and record votes, eliminating the reliance on a single
central authority and enhancing the system's resilience.
2. Smart Contracts: Familiarity with smart contract development and their role
in automating the voting process, enforcing rules, and ensuring transparency
and accountability.
12
5. Security Best Practices: Implementing robust security measures to protect
against potential threats, including denial-of-service attacks, double-spending,
and identity fraud.
13
BRIEF OF LEARNING FROM ONLINE SESSIONS
Introduction to blockchain technology
14
4. Transparency and Security: Transactions on the blockchain are
transparent and visible to all network participants. However, the identity
of the participants can remain anonymous or pseudonymous, depending
on the specific blockchain implementation.
15
As the technology evolves, we can expect to see even more innovative
use cases and applications that could reshape industries and enhance our
digital infrastructure.
16
4. Permissionless Participation: Anyone can participate in the Algorand
network as a staker and earn rewards by helping to secure the
blockchain. This inclusive approach fosters a robust and open
ecosystem.
17
Basics of Blockchain Development
18
7. Test and Deploy:
- Use the test network to test your smart contracts and applications
before deploying them on the mainnet. This ensures that your code
works as expected and reduces the risk of errors on the live network.
19
Algokit from github is cloned and utilised following with setting up
environment
Generally, setting up a development environment for blockchain projects
involves the following steps:
Identify the Purpose: Determine the specific use case or project you want to
work on using Algokit. Understanding the purpose will help you choose the
appropriate platform and development tools.
Write and Test Smart Contracts: Use the appropriate programming language
(e.g., Solidity for Ethereum) to write your smart contracts. Test them on a test
network to ensure they work as intended.
20
Deploy on Mainnet or Testnet: When you are confident in your code's
correctness, you can deploy your smart contracts on the mainnet (for production
use) or a public testnet (for testing).
The Algorand Python SDK allows developers to interact with the Algorand
blockchain network and build applications using Python.
To get started with the Algorand Python SDK, follow these steps:
21
```python
algod_address = "[Link]
algod_token = "<your-algod-node-api-token>"
algod_client = [Link](algod_token, algod_address)
```
5. Send Transactions:
Use the SDK to send transactions to the Algorand network. You can transfer
Algos, create assets, interact with smart contracts, etc.
6. Handle Errors:
Make sure to handle errors appropriately, as API calls or transactions may
fail due to various reasons.
Please note that the Python SDK and its usage might have evolved since my
last update. To get the latest information and examples, you should visit the
official GitHub repository or the Algorand Developer Portal.
22
Algorand Standard Assets
23
6. Smart Contracts Integration: ASAs can be used within Algorand Smart
Contracts (ASC1), enabling complex logic and use cases involving
assets.
24
How to Mint NFT on Algorand
Introduction:
Non-Fungible Tokens (NFTs) have become a hot topic in the blockchain
space, revolutionizing the way we perceive and exchange digital assets.
Algorand, a high-performance blockchain platform, offers a seamless
and efficient way to mint NFTs, enabling creators and artists to tokenize
and authenticate their unique works. In this article, we will walk you
through the process of minting NFTs on the Algorand blockchain,
providing a step-by-step guide to get you started.
b. Generate the Asset: Using the Algorand Python SDK or any other
compatible SDK, create the ASA transaction. This involves specifying
the asset configuration, total supply (usually 1 for NFTs), decimals
(usually 0 for indivisible NFTs), and whether the asset is reissuable or
non-reissuable.
25
c. Sign and Broadcast the Transaction: Sign the transaction using your
wallet's private key and broadcast it to the Algorand network. This will
create your NFT asset and assign it a unique asset ID.
b. Sign and Broadcast the Transaction: Sign the mint transaction with
your wallet's private key and broadcast it to the Algorand network. This
will mint a new NFT token associated with your NFT asset ID.
Conclusion:
Minting NFTs on the Algorand blockchain provides an efficient and
secure way for creators to tokenize and share their unique digital assets
with a global audience. By following this step-by-step guide, you can
leverage the power of Algorand's high-performance blockchain to mint
your NFTs and participate in the rapidly growing world of digital art and
collectibles. Embrace the potential of NFTs on Algorand and unlock new
possibilities for creative expression and value creation.
26
Algorand Smart Contract
Introduction:
Blockchain technology has evolved beyond its initial role as a ledger for
cryptocurrencies, opening the door to a wide range of decentralized
applications. Algorand, a high-performance and scalable blockchain
platform, has been at the forefront of innovation, providing developers
with powerful tools to build robust and secure applications. In this
article, we delve into Algorand Smart Contracts (ASC1), a cutting-edge
feature that allows developers to unlock the full potential of
decentralized applications on the Algorand blockchain.
27
3. TEAL: The Transaction Execution Approval Language:
TEAL is the bytecode-based programming language used to write ASC1
contracts. It provides a simple and deterministic environment for
executing smart contracts on the Algorand blockchain. Developers can
leverage TEAL's capabilities to create complex logic and conditional
clauses for their applications.
b. Write the Smart Contract: Develop the TEAL smart contract code
using a code editor, specifying the logic and conditions for your
application.
c. Compile and Deploy: Compile the TEAL code into a TEAL program
and deploy it on the Algorand blockchain, creating the ASC1 contract.
d. Interact with the Contract: Use the Algorand Python SDK or any
compatible tools to interact with the deployed smart contract, including
calling its functions and updating its state.
28
Conclusion:
Algorand Smart Contracts open up a world of possibilities for
developers, offering an efficient, scalable, and secure solution for
building decentralized applications. With the growing adoption of the
Algorand blockchain and the continuous improvement of ASC1 features,
we can expect a vibrant ecosystem of innovative applications that
leverage the full potential of smart contracts. As the Algorand platform
evolves, developers will continue to explore new use cases and push the
boundaries of what is possible in decentralized application development.
29
Implementation of Decentralized Blockchain E-voting
Abstract
E-voting:
E-voting refers to the process of casting and compiling votes using an
electronic system. Votes are stored in tape cartridges, diskette, smart cards
and sent to a centralized location for compilation process. The various
forms of evoting are DER (direct electronic recording) touch screens,
optical scanners. On-site e-voting where electronic voting machines are
placed / present in the polling boots with some government official who
will supervise the voting process and people have to be in queue for casting
the vote. Remote e-voting; where people need not be present at the polling
station instead can cast their vote from any remote location using
computers, mobile phones, etc. through internet, sms, or kiosks.
30
The security community found electronic voting machines inaccurate and
untrustworthy based on security issues. The software can be undermined when
the device is physically reached which affects the votes on the machine.
Elections need to be secure and unimpeachable irrespective of the
organization. People’s privacy and voting protection must be secured but it
should not take too long for votes to be counted, as it upraises concerns.
Blockchain:
Blockchain proved to be a substitute for the conventional approach by
making system unalterable and transparent. Blockchain is an organized data
structured that includes blocks where each block is connected to every other
block through a chain. The first block is called as genesis block. Each new
block will be stacked to form a stack called a blockchain. Each block consists
of data, hash and hash of previous block. If any change is being made to the
data available in a particular block, consequently the hash of the block also
gets changed but the next block will have the same unchanged hash of the
previous block which invalidates this block and all other succeeding blocks.
This is to avoid tempering because making change in one block you will
need to calculate hash for every other following block however hackers now
a days can compute hundreds of thousands of hashes in a matter of seconds.
In order to avoid this problem it makes use of proof-of-work concept that
delays the pace of forming a new block. Moreover it make use of a
distributed peer to peer network where no central entity is present. Whenever
a new block gets created it is sent to all other nodes present on this network
where each node makes sure that no tempering is done by verifying the block
after which the new block is added to every other node’s blockchain. Every
node on the network agrees on whether the block is valid or not by creating a
consensus which makes blockchain so secure, safe and reliable.
31
Smart contract:
A smart contract is a self-imposed contract that is embedded in a blockchain
managed computer code. This code includes a set of rules governing the
communication and decision on the contract between the parties, the contract
will be enforced automatically once the already defined rules are met. Smart
contract gives a framework for efficient control between two or more parties
of tokenizes assets and access rights [1]. Fig 1 [1]; shows the working
principle of smart contract. Blockchain is just a database that cannot be
altered, without smart contract,
which expands and leverages
blockchain technology
There are various aspects of smart contract including technical aspect, legal
aspect, economic aspect, that can be seen from the Figure 2 [2].
Figure 2. Various Aspects of Smart Contract.
Self-verification of the conditions in a smart contract is done by data
interpretation. Each network node will guarantee the proper execution of a
single contract, which relief the contract creators from tracking the execution
of the contract. Smart contracts are self-executing, where the conditions of the
32
agreement between different parties are written into the code. This means that
legal obligations can be mapped using smart contracts into automated process.
The execution of the contract can be automatically invoked by a trigger like
expiration date. In this paper, we implement blockchain based e-voting system
which overcome the problems encountered in e-voting and builds trust among
voters for legitimate voting. Moreover, it will also be a helpful step towards
the development of smart governance. This paper contains various sections;
section 2 presents recent related work in block chain technology and evoting
system, section 3 presents proposed e-voting system based on blockchain,
section 4 gives implementation details and results. Finally, section 5 concludes
our work
2. Related Work
E-voting system was a great advancement over traditional pen and paper
approach and became very popular in many countries. Several countries
introduced e-voting system in their election process. Although it provided a
number of advantages like increased voter turnout, auditability, low cost,
convenient and accessible elections, etc. but there were several important
challenges and issues associated with it.
33
electoral administrators to decide electoral policy, generate voting, register
rules, opening and closing of voting. Identification of voters is done by other
applications like biometric readers. To test and check the results of election
TallydApp is used. This NetVote reinforce three kinds of elections: private
election, open election, Token holder elections.
There are many problems in current e-voting system which acts as a
hindrance in accomplishing the accurate results like:
a. Prone to hacking.
b. Inefficient auditing
c. Misinterpretation of voter intent.
d. Political biasness on behalf of the manufacturer.
e. Tempering of software programs.
f. Inefficiency in securing the casted votes.
g. Hardware malfunctions, etc.
3. Proposed System
The proposed system utilizes several tools namely ganache, truffle framework,
npm and metamask. Truffle imports the smart contracts on the blockchain
while as ganache operates the internal blockchain and it will be accessed by
using metamask. With some Ether i.e. Ethereum’s cryptocurrency is required
by a user for an account with wallet address. To write the transaction to
blockchain, user needs to pay a certain transaction fee which is called as gas.
Once votes are cast the process is completed by a number of nodes on the
network called as minners. These miners compete with each other to complete
34
the transaction. The miners who succeed in this transaction is awarded ether
paid by users to vote. Instead of node we will be using ganache software for
mining purpose.
Preliminaries:
Our proposed model can be implemented by using 64-bit hardware/ machine,
windows 7 onwards, NMP dependencies, Truffle framework, Metamask,
solidity toolkit and Ganache.
35
Truffle framework:
Truffle is a powerful tool to work with ethereum smart contracts. It is used for
compilation, deploying and linking of smart contracts, provides testing
platform for automated contracts, manages networks and packages, etc. [12].
Ganache:
It was previously known as Testrpc and comes in both forms command line
and UI. A virtual blockchain establishes ten standard Ethereum addreses with
all and private key preloading them with simulated hundred ether each. With
ganache there is no mining rather it automatically confirms every transaction.
It is convenient for operating systems like windows, Linux and mac [13].
Metamask:
Metamask is an open source, user friendly tool having a graphical user
interface for doing transactions in ethereum. Ethereal Dapps can run without
having a complete ethereum node running your system browser. Metamask is
essentially a bridge between browser and blockchain ethereum [12].
Solidity:
Solidity is a high-level language with JavaScript style syntax for contracts. It
is a method for generating EVM machinelevel code and converts it into simple
instructions. It has four value types namely: Boolean, Integer, Address and
String but has same operators as that of JavaScript [14].
Working:
The voter can log on to the voting website, then he has to log in with the
Chrome Extension of Metamask to connect with the local blockchain. Once
the user is connected, the page is refreshed and the user can see the candidates
and the current votes. Below that is the option to select the candidate to vote,
the voter selects the candidate and click on vote, a metamask pop-up comes up
which tells the Ethereum transaction that has to be made, once the user clicks
on Vote, the vote is given to the selected candidate provided that the voter
hasn’t voted before. If the user has already voted and attempts to vote again, a
failed transaction will occur and vote will not be accounted.
36
A local blockchain is deployed using Ganache and metamask is set up to
connect with it. Truffle framework allows to migrate the smart contracts
created on solidity to the local blockchain. When the user clicks to vote,
metamask allows to move Ether from one account to another. Every user is
given a unique ID that is Ethereum Address and a private key and exact
amount of Ether is distributed to all the voters’ accounts. Once the user votes,
the Ether is transferred from the voter’s account to the Candidate’s account,
and all the transactions goes through the blocks, all the transactions will be
visible to everyone once we launch the project. This will give voters complete
transparency and they can cross-check their votes. Once the user has voted,
the address will not contain the same amount of Ether, therefore if the user
attempts to vote again, the transaction won’t be completed and the vote will
not be accounted. Mining is performed by all the other nodes but here, we
have given Ganache the power to auto-mine on behalf of other nodes. The
flowchart below explains the voter side of the process.
37
Figure 4. Flow model of the E-voting system based on blockchain
4. Implementations and Results
1. Setting up:
The first thing that we need to do is run local After setting up ganache there
will be not any transaction as blockchain by starting up Ganache. we have
not done any transaction yet. As we can see from the snapshot below there
is no transaction.
38
Figure 5. Screenshot of Setting up Ganache.
39
Figure 7. Snapshot of Command Line for
Truffle Framework.
40
Figure 8. Command Line of
NPM Directory
2. User Interface-
User interface is through
which users can interact
with the e-voting system.
The picture below is how
user will see the interface.
The loading screen will
continue to display
loading until the electorate
login through metamask.
41
Figure 9. Snapshot of Loading Screen.
42
After the user has logged in, main screen comes up with zero The private key is
given in advance to the user that will look vote, the user cannot vote until they
import their account by like Figure 12. entering private key.
43
Figure 13. Snapshot of Importing Account.
44
publicly to provide the user with
convenience to tally their votes
respectively. The users can check
their votes given by them by looking
into the transaction list. An entire
transaction list will be like one given
in fig 16.
45
Figure 16. Snapshot of Transaction List.
4. Conclusion attainable. Our proposed system
provides convenience to the
The recent development in the area of voters by allowing them to
voting system includes Blockchain connect to the system having
technology, which not only proved to easy-to-use user interface,
be time and cost efficient but is also through which they can cast
safe and secure, hence is more their vote by importing their
reliable and precise than the earlier account and can easily review
approaches. In this paper we have their vote. It creates a sense of
used blockchain based e- voting using trust among voters, that there
smart contract which includes a set of vote is being computed and kept
rules governing the communication in a safe custody.
and decision on the contract between
parties. Various tools like Ganache,
Truffle framework, NPM and
metamask were used for
implementation purpose. As
blockchain technology is
decentralized due to which tempering
and alteration in such system is quite
46
the norwegian electronic
voting protocol. Annals of
Telecommunications:1–9.
doi:10.1007/s12243-016-
References 0509-8
[1] [Link] [6] Budurushi J, Renaud K,
economy-book/ [2] Zhang, S., Volkamer M, Woide M
Wang, L. & Xiong, H. Int. J. (2016) An investigation
Inf. Secur. (2019) into the usability of
Chaintegrity: electronic voting systems
blockchainenabled large-scal for complex elections.
e-voting system with Annals of
robustness and universal Telecommunications pp
verifiability. International 1–14.
Journal of Information doi:10.1007/s12243-016-
Security. 0510-2
[Link] [7] Neumann S, Volkamer M,
-019-00465-8 Jurlind B, Prandrini M
[3] E. Elewa, A. AlSammak, A. (2016) Secivo: a
AbdElRahman, T. ElShishtawy, quantitative security
"Challenges of Electronic assessment model for
VotingA Survey", Advances in internet voting schemes.
Computer Science: an Annals
International Journal, vol. 4, no. Telecommunication pp 1–
6, pp. 98-108, 2015. 14
[4] Aranha DF, Ribeiro H, Paraense [8] Ayed, A.B. (2017). A
ALO (2016) Conceptual Secure
Crowdsourced integrity Blockchain Based
verification of election results. Electronic Voting System.
Annals of International Journal of
Telecommunications:1–11. Network Security & Its
doi:10.1007/s12243-016-0511-1 Applications (IJNSA)
[5] Gjøsteen K, Lund AS (2016) An Vol.9, No.3, May 2017
experiment on the security of
47
[9] Hsiao JH, Tso R., Chen CM., Engineering, vol 474.
Wu ME. (2018) Decentralized Springer, Singapore.
E-Voting Systems Based on the [10] Jonath Alexander, Steven
Blockchain Technology. Lander and Ben Howerton
Advances in Computer Science (2018). Netvote: A
and Ubiquitous Computing. Decentralized
CUTE 2017, CSA 2017.
Lecture Notes in Electrical
Voting Network Available at:
[Link] io/wp-
content/uploads/2018/02/Netvot
[Link]
[11] [Link]
manager
[12] [Link]
truffle
[13] [Link] ng-for-ethereum-
getting-started-with-ganachel6abwh62j
[14] [Link]
48