ElectionBlock An Electronic Voting System Using Blockchain and Fingerprint Authentication
ElectionBlock An Electronic Voting System Using Blockchain and Fingerprint Authentication
Qusay H. Mahmoud
Dept. of Electrical, Computer and
Software Engineering
Ontario Tech University
Oshawa, ON, Canada
qusay.mahmoud
@ontariotechu.net
Abstract— Voting is the method of choice used to make a large way, previous entries in the chain of blocks cannot be
number of democratic decisions amongst many groups of people. manipulated without causing a cascading effect of
Regardless of whether the method is used in professional or casual inconsistency, thus increasing information security and
scenarios, it provides a fair and efficient way to determine a integrity. The recorded information is stored on a ledger which
decision based on the majority. In smaller groups, keeping track is updated at a central server and distributed to all client nodes
of voter decisions is not a difficult task, however, in situations in the network.
where there are hundreds of thousands of voters, keeping a precise
record of voter decisions becomes important and more difficult. Distributing the data to client nodes introduces another layer
The advancements in blockchain technology provide a potential of validation to the system. In the instance where a node is
solution to the record-keeping problem of contemporary voting compromised, the system can validate records with all other
procedures, as blockchain technology by design, excels in nodes in the system. With the majority of records being
applications where multiple users are working on immutable data. consistent, validation is preserved. This stays true as long as
In this paper we discuss the design and development of 51% of the ledgers remain consistent, as stated by the 51% rule.
ElectionBlock, a voting system that provides its own blockchain, This rule refers to situations where one node can control at least
running on a centralized network of nodes, with the integration of 51% of the hashing power within a blockchain network. This
a biometric scanner, to maintain vote integrity and distinguish situation however is difficult to achieve due to the distributed
between registered and unregistered voters. This scheme allows
nature of the blockchain and the computational power needed to
data immutability while providing the user with security and
control over their ballot. Experimental results demonstrate the
achieve more than 50% of the hashing power, as the hashing
potential for scalability of the system to handle a high volume of computation becomes more computationally intensive with each
votes from multiple servers while maintaining data integrity, added block.
performance, and security. This paper will address the Despite the security and potential versatility in blockchain
considerations taken to develop and implement the centralized technology, it has not been vastly utilized outside the financial
and independent blockchain network for use as a voting platform sector. With features of security, validation, and scalability, it
with the integration of biometrics for the purpose of enhanced user becomes an attractive technology to be adapted to many other
security.
sectors as well. Voting systems powered by a blockchain can be
Keywords—Blockchain, voting, distributed system, publisher- implemented in a secure and optimized manner to maintain the
subscriber, centralized synchronization, SHA-256 integrity of the votes and decisions as well as solving logistical
problems of modern-day elections.
I. INTRODUCTION Voting requires that participants casting a ballot vote are
Blockchain technology has been gaining popularity in recent present in the same location as the polling entity. In situations of
years, influencing various lines of business while proving to be larger-scale elections, such as presidential and federal elections,
versatile yet increasingly secure. In simple terms, the premise of many parties are required to maintain order, privacy, integrity,
the technology is to have information stored on a distributed and synchronization of the voting system to guarantee the
ledger made up of various blocks of information which are all correctness of the outcome. A blockchain voting system
linked to one another. The linking of information from one block provides solutions to these aspects of the traditional voting
to the next occurs when the data of one block is hashed. This is system. Transitioning the medium of voting from the traditional
a property of the blockchain where the resulting hash value of a paper ballot to any online system does however provide some
block is influenced by the hash value of the previous block. This drawbacks. Trust is a large aspect to consider as the voting
124
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on January 21,2025 at 06:39:51 UTC from IEEE Xplore. Restrictions apply.
were not concerned with the aspect of decentralization and communication with the server, a Redis publisher-subscriber
distributed trust, but valued an immutable, tamper-proof ledger (pub-sub) broker is used. The voting stations subscribe to
[12]. blockchain updates published by the central server. The
received updates are checked and validated by recalculating
III. ELECTIONBLOCK hash values based on blockchain data. If all previous blocks in
ElectionBlock is designed to be a practical implementation the blockchain are consistent, the voting station will update its
demonstrating the usability of a centralized and permission- record with the new blockchain file.
based blockchain system. It takes the assumption that the desired
architecture is that of a centralized system, and trust is granted 2) Central Server Station
to the governing body for the use of the blockchain. As The central server is the central point of truth for the
biometrics are also being collected and used for the method of ElectionBlock network. As the ElectionBlock network is
authentication, it is assumed that all parties using the software
centralized, all transactions in the blockchain are sent from the
are in agreement with the collection of this biometric data. In the
voting station’s React application to the Flask server being run
brainstorming process and decision to use the fingerprint sensor,
it did not present itself to be a large issue as many modern-day on the central server. The vote data coming to the Flask server
mobile devices also use fingerprint authentication and face enters the centralized vote queue after which a set number of
recognition as authentication methods. votes are dequeued. Each dequeued vote contains the voter id,
the candidate they voted for, the campaign id, as well as the
A. Architecture timestamp the vote was taken as seen in Fig. 2. This information
The architecture of ElectionBlock is depicted in Fig. 1 and is hashed and processed as a Merkle tree. The root hash of the
consists of the following core components: central and voting tree is then used as the hash of the new block which is added to
stations. the blockchain; this block also contains the vote data. Once this
new block has been appended to the existing chain, it is pushed
to the subscribing voting stations using the pub-sub broker.
125
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on January 21,2025 at 06:39:51 UTC from IEEE Xplore. Restrictions apply.
hashed using a Merkle tree algorithm. In our application, we votes being sent at the same time, creating concurrent writes in
selected a block size of 16. Normally the block size has an the blockchain. In our implementation, sequential consistency
impact on the speed and capacity of the network’s performance, amongst writing is critical, as both the Merkle tree and
where if the block size is too small, blocks are transferred blockchain technology are heavily dependent on the order of
frequently, increasing the load on the network. If the block size the data. To accommodate this, we decided to use a permission-
is too big, it poses delays as the new blocks have to be mined, based blockchain system, where there exists a trusted entity
which is a time-consuming process. As ElectionBlock is a which holds the absolute truth. Since calculations for the
permissioned blockchain, mining is not used, and the block size Merkle tree and the addition of the new block to the blockchain
of 16 proved to be an efficient size to keep a consistent network is a bottleneck of the writing operation, we implemented a
flow and update the blockchain at a regular rate. This block size queue that holds votes that are sent from the voting stations.
can also be efficiently used by the Merkle tree algorithm, where
Once the votes in the queue reach 16, the votes are then
pairs of votes are hashed together, until one final hash remains,
dequeued and processed into a Merkle tree. The tree’s root hash
that consists of all 16 votes. The hashing method utilized in the
Merkle tree is the SHA-256 cryptographic hash algorithm. This is calculated, and a new block is added to the blockchain. Once
is a one-way cryptographic function that is fixed for any source. the new blockchain is ready, the blockchain data is then
This means no two non-identical pieces of data can have the published to the subscribing nodes, keeping them updated.
same hash output, and the resultant hash cannot be decrypted As a distributed system relying on the internet, network
back into the original text. errors are a constant threat to the IoT based system. To defend
As votes are hashed and formed into blocks, the blocks are against the potential network errors and malicious attempts of
linked to the existing blockchain. Updates are published to data tampering, blockchain technology provides validation with
voting stations, using a pub-sub architecture implemented with the use of hash value verification. Once the source of truth
Redis, in order for the distributed nodes to have local copies of blockchain is published to the voting stations, all receivers of
the up-to-date chain. These chains are serialized using the the published blockchain go through blockchain verification.
Python Pickle library and stored locally on each client to allow As the station server validates the individual hash of the block
for recovery from crashes and shutdowns. and the block that came before, if the value calculated does not
The voter’s workflow is represented in Fig. 3. After the match the provided hash value, it will simply not accept the new
biometric validation process, the system must verify the vote yet blockchain. For example, if there was a network error that
to be casted by the voter, therefore preventing voter fraud. The altered the hash value of the block, the entire blockchain will
process’ design accounts for various voter fraud scenarios such be deemed invalid. This causes the subscribing node to simply
as unregistered voters and multiple voting with various timing drop the newest attempt to update the blockchain and waits for
differences. the next publish to resynchronize itself.
A. Scalability
As a voting system with the potential to handle nation-level
voting events, the system handles three main aspects of
scalability;
Extensibility: Discussing methods to increase the
number of voting stations in the system.
Sequential Consistency: How our system is
handling race conditions amongst multiple
different voting stations with potentially thousands
of concurrent vote requests.
Fault Tolerance: How our system defends against
errors in the network or malicious attempts to
tamper with our data.
Our system was built with the extensibility of voting
stations in mind. One of the fundamental aspects of the current
voting system is that there are multiple different voting stations
to provide access to as many voters as possible. Although the
location of the polls may often get surrounded by controversies,
the idea behind having multiple voting stations is a crucial
aspect of voters’ rights. In our system, each voting station is
implemented as an identical copy of one another. Once the
station is set up with internet access, the IP address is
whitelisted to allow for communication with the central server.
Sequential consistency is another crucial factor in the voting
system, as a nation-wide voting event may have thousands of Fig. 3. Voter verification and voting process prevents potential voting fraud.
126
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on January 21,2025 at 06:39:51 UTC from IEEE Xplore. Restrictions apply.
B. Challenges and Solutions amongst the development team that this is a voting system of
Throughout the development process of the ElectionBlock the future and a leap had to be made in order to move forward
application, a couple of problems came to light that had to be in this industry.
tackled early on in development. One of the more significant A challenge in relation to scalability was also faced. As the
challenges that were discussed between the group for many blockchain grows in size, scaling of the blockchain becomes
days, included handling multiple requests concurrently. In a more computationally intensive due to the increased size of the
real-life situation for an election, millions of ballots are being ledger. New nodes that are added to the blockchain at later
cast concurrently from different polling stations. In a paper stages would be required to download large amounts of data
ballot voting system, it may take quite a while for large and load it into memory. To combat this scalability challenge,
quantities of votes to be processed; however, the order is not sharding of the blockchain was implemented [13]. This
important. On the other hand, it is very important to maintain technique splits the blockchain into manageable chunks, where
eventual consistency across the entire network in a blockchain- a shard is composed of ten (10) blocks. With each shard reduced
based voting system. In the event of thousands of votes being in size compared to the full blockchain, this makes writing to
pushed to the blockchain concurrently, it is very difficult to the blockchain shard more manageable as the size of the entire
ensure that the blockchain is updated at every node. Time ledger grows.
consumption will be a significant drawback of the voting
application in this situation. It would require that each node has The final challenge faced in the development of this
an updated version of the blockchain as well as an ordered application was the protection against voter fraud. In a typical
sequence between nodes prior to pushing votes, this would decentralized blockchain system, there would not be much
result in poor implementation of a real-world application. concern if there was malicious intent in manipulating the data
Another possible issue is that data can be lost without proper in the blockchain. However, ElectionBlock has a permission-
data safeguard procedures in place. A solution that was based blockchain system where the central server makes
implemented to counteract the issues regarding a large number changes to the blockchain. One apparent concern was that if the
of votes being pushed concurrently, was to use a voting queue server was attacked, the data could be manipulated quite easily.
at a central server. This centralized server would receive any To prevent this issue from occurring, each node will contain a
votes from nodes which would then place them in a queue. This copy of the blockchain. To ensure that data is not manipulated
would allow for every voting station to concurrently push votes on the central server, nodes can identify if there was an attack
while maintaining eventual consistency and be practical for a and immediately fix the issue. Other methods implemented in
real-life application of a voting system. the application to check against voter fraud include the
fingerprint scanner mentioned above which will prevent voters
Another significant issue that was encountered early on in from casting votes more than once. Whitelisted IP addresses are
the development process was defining how the voters would put into place to ensure that selected devices are being used at
authenticate themselves to be registered. This was a challenge the voting stations, this will help prevent malicious attackers
because there are many ways out there to authenticate a voter's from corrupting the system.
identity. However, it was difficult to think of an idea that would
help the ElectionBlock application stand out from the rest. In V. EVALUATION RESULTS
the standard ballot-based voting system, it is required that one To measure the performance evaluation of the
registers to vote, and that step follows up with a ballot that is ElectionBlock system, the application was deployed and
mailed to your home address. On election day, you can take recorded on our computer with the following specifications:
your ballot with your piece of identification (e.g. driver’s Quad-Core Intel Core i5 with 2GHz of speed, 16 GB of LPDD4
license) and proceed to cast a vote. This procedure was well memory with 3733 MHz of speed.
considered in the implementation of ElectionBlock’s user
authentication as the process is quite similar to the use of voting A. Algorithm Complexity
stations. However, we looked into different options including Our solution was evaluated against the four principles of a
sign-in partners with bank accounts which are widely used on blockchain architecture [14];
websites such as Canada Revenue Agency and Service Canada. Algorithm throughput
This was also considered heavily, however, the development Degree of decentralization
team of ElectionBlock had decided to choose an option that was Consensus algorithm vulnerabilities
out-of-the-box and may even be a little controversial. A Security issues.
fingerprint scanner was determined to be the method of voter ElectionBlock uses two fundamental algorithms in its
authentication. In the event of an election, registered voters hashing tasks; the Merkle tree and the SHA-256 algorithms.
would be assigned a voting station. This particular station Both algorithms have a high throughput as they are able to
would have a database of all the fingerprints for those assigned process all fed data. The SHA-256 algorithm is optimized for
to that specific location. It was well understood that there may use in python through the hashlib library. All data passed into
be concerns with individuals who are against providing their the hashlib.sha256() function is converted into a byte string and
biometrics directly to the government. However, many modern- processed with minimal computational overhead as the SHA-
day mobile devices use fingerprint authentication and it seems 256 algorithm has a time complexity of O(n), where n is the
to be becoming more normal. In the end, it was decided
127
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on January 21,2025 at 06:39:51 UTC from IEEE Xplore. Restrictions apply.
length of the string being hashed. As this algorithm is used there is a single central node. However, with the addition of
within the Merkle tree, for a full traversal of the tree, we get a multiple nodes, a consensus algorithm could be run across the
time complexity of O(n⋅log(n)). A combination of these two nodes and have more of a blockchain consensus approach.
values result in a time complexity of O(n⋅s⋅log(n)), where n is
the total number of votes in the Merkle tree, and s is the length
of the serialized vote string. This translates to our program
being able to run a large number of requests with no notable
effects in performance. This was tested by seeding 1008
random requests with a 0.2-second delay between each request.
The overall system was able to process all requests by hashing
the votes, adding the new block to the blockchain, and
publishing the new blockchain to the subscribers with no
performance degradation.
As ElectionBlock is a permissioned system, there is no
implementation of a mining process. The hashing calculations
are all made on the central node as a source of truth. With this
implementation, the profitability can be disregarded as there is
Fig. 4. Average time taken to add one (1) block when handling different
no need for miners. Likewise, there are no vulnerabilities in quantities of votes stored per block.
consensus algorithms with a single source of truth.
Having a centralized implementation, however, does pose a
possible security risk in that there is one source of failure. In
the implementation used for ElectionBlock, this risk has been
minimized through the comparison of previous blocks before a
node accepts an updated chain. In a normalized operation, all
blocks previous to the newly added block in the chain will
match when comparing the new chain to the local copy of the
blockchain saved at a subscribing node. In the event of
malicious manipulation of the data, it will be detected and Time (hh:mm:ss)
identified during this comparison. Fig. 5. Requests per second measured by locust using 10 simulated users.
B. Performance Measurement
To calculate the average time taken to add a novel block to
the blockchain, 3 different quantities of votes that were to be
stored per block were tested, varying from 1000, 2500 and 5000
votes stored per block (Fig. 4). To calculate the average
duration taken for one vote to be added to a block at each
instance, 10 blocks were added per specific quantities of votes
per block and averaged. The time taken to add a new block
showed a linear trend, where the average time taken to add one
block increased as the number of votes stored per block were
increased as well.
Fig. 6. Response time of requests over time measured by locust using 10
To test the scalability of the ElectionBlock system, Locust, a simulated users. (Green Line: Median Response Time, Yellow Line: 95%
Percentile Response Time).
python load testing framework, was utilized. During testing, 10
users were simulated to send an arbitrary number of requests, TABLE I. LOAD TEST DATA GATHERED FROM LOCUST
mimicking voters casting votes (Fig. 5). The results of the load SIMIALTION USING 10 USERS.
test yielded an average response time of 350 ms with 0% failure
rate (Fig. 6 and Table I).
VI. THREATS TO VALIDITY AND SOLUTIONS
Like most solutions to modern day problems, no solution is
without its flaws and ElectionBlock is no different. The largest The addition of more central nodes would also result in better
area where our solution could use improvement is in the area of security. In the event where one node is compromised and data
fault tolerance. Future iterations of the application would need is manipulated, you can always verify the legitimacy of the vote
to implement an algorithm similar to the Byzantine Fault and hash values across the other nodes. Utilizing multiple
Tolerance to handle instances of crashes to prevent data loss central nodes would help accelerate this product immensely as
[15]. Currently, there is no consensus algorithm in place as it would prepare the voting system for better security and
128
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on January 21,2025 at 06:39:51 UTC from IEEE Xplore. Restrictions apply.
availability. The system will offer better availability in the [4] “Moscow's online voting system has some major vulnerabilities, allowing
votes to be decrypted before the official count,” Meduza, 01-Jul-2020.
event that the main central node is to be compromised. An [Online]. Available: https://meduza.io/en/feature/2020/07/02/moscow-s-
election algorithm would be used to select a new main central online-voting-system-has-some-major-vulnerabilities-allowing-votes-to-
node to keep the system running. In addition, the technique of be-decrypted-before-the-official-count. [Accessed: 13-Feb-2021].
sharding, despite enhancing the ability to scale the blockchain, [5] T. K. Sharma, “Top Countries That Conducted Elections On The
does also pose performance issues and concerns in areas of Blockchain,” Blockchain Certifications, 15-Oct-2019. [Online].
Available: https://www.blockchain-council.org/blockchain/top-
security and data integrity threats [12]. This is primarily due to countries-that-conducted-elections-on-the-blockchain/. [Accessed: 13-
the fact that when sharding the blockchain, each shard acts as Feb-2021].
its own blockchain. In this situation, the corruption of a single [6] Z. Zhao and T.-H. H. Chan, “How to Vote Privately Using Bitcoin,”
shard can prove to be problematic, and states across shards Information and Communications Security, vol. 9543, pp. 82–96, Mar.
2016.
would need to be monitored [12]. Solutions such as inter-shard
[7] H. Tian, L. Fu, and J. He, “A Simpler Bitcoin Voting Protocol,”
communication and other techniques are currently being tested Information Security and Cryptology Lecture Notes in Computer Science,
and will result in improved techniques in this topic. It is pp. 81–98, Jan. 2018.
assumed that inter-shard communication will also improve the [8] T. Dimitriou, “Efficient, Coercion-free and Universally Verifiable
performance; the largest overhead in our solution is caused due Blockchain-based Voting,” Computer Networks, vol. 174, p. 107234, Jun.
to checking all shards during voting to prevent users from 2020.
casting multiple votes. Implementing the ideas mentioned [9] A. Shah, N. Sodhia, S. Saha, S. Banerjee, and M. Chavan, “Blockchain
Enabled Online-Voting System,” ITM Web of Conferences, vol. 32, p.
would uplift the ElectionBlock application and create real 03018, Jan. 2020.
potential to commercialize the solution. [10] J. Frankenfield, “What Is a 51% Attack?,” Investopedia, 28-Aug-2020.
[Online]. Available: https://www.investopedia.com/terms/1/51-
VII. CONCLUSION AND FUTURE WORK attack.asp.
Overall, the development of the ElectionBlock application [11] F. Stacey. “THE BLOCKCHAIN BRIEF.” The Journal of Government
Financial Management, Association of Government Accountants, vol. 67,
results in a functional, centralized, and permission-based no. 4, pp. 24–29, Dec. 2018.
blockchain voting system. The purpose of the application is to [12] B. Pirus, “Amazon Tackles Centralized And Decentralized Blockchain
enhance the current ballot-based voting system used by most Solutions,” Forbes, 23-Jul-2019. [Online]. Available:
large-scale elections. By using the ElectionBlock platform, https://www.forbes.com/sites/benjaminpirus/2019/07/11/amazon-
voter fraud can largely be tackled, with the added benefits of tackles-centralized-and-decentralized-blockchain-
solutions/?sh=7f2c97471d54.
complete transparency and an easy-to-use interface. Vote
[13] M. Salimitari, M. Chatterjee, and Y. P. Fallah, “A survey on consensus
anonymity and security are also largely handled due to the methods in blockchain for resource-constrained IoT networks,” Internet
blockchain platform. We have made the source code of our of Things, vol. 11, p. 100212, 2020.
prototype implementation publicly available to encourage [14] S. M. H. Bamakan, A. Motavali, and A. B. Bondarti, “A survey of
further development of novel ideas into the system. blockchain consensus algorithms performance evaluation criteria,”
Expert Systems with Applications, vol. 154, p. 113385, Sep. 2020.
REFERENCES [15] M. Castro and B. Liskov, “Practical byzantine fault tolerance and
proactive recovery,” ACM Transactions on Computer Systems, vol. 20,
[1] C. O'Brien, “What Estonia could teach us about internet voting in a post-
no. 4, pp. 398–461, 2002.
pandemic world,” VentureBeat, 12-Jun-2020. [Online]. Available:
https://venturebeat.com/2020/06/11/what-estonia-could-teach-us-about- [16] ElectionBlock Repository publicly available on Github. [Online].
internet-voting-in-a-post-pandemic-world/. Available: https://github.com/mibrah42/electionblock.
[2] D. Lohrmann, “Could Estonia Be the Model for Secure Online Voting?,”
Government Technology State; Local Articles - e.Republic, 26-Sep-2020.
[Online]. Available: https://www.govtech.com/blogs/lohrmann-on-
cybersecurity/could-estonia-be-the-model-for-secure-online-voting.html.
[3] “Ballotchain online voting system powered by Blockchain,” online voting
system powered by Blockchain. [Online]. Available:
https://www.reply.com/en/content/ballotchain.
129
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY TIRUCHIRAPALLI. Downloaded on January 21,2025 at 06:39:51 UTC from IEEE Xplore. Restrictions apply.