Professional Documents
Culture Documents
Report With Word
Report With Word
1.2 Motivation
Our motivation for selecting this project is to increase the participation of the citizens in the
voting process, which is their fundamental right, as many of the citizens prefer not to vote as the
traditional physical voting system is difficult and chaotic, and they have a lack of trust in the
government staff at the polling station. Therefore, in order to make the voting process more
transparent, error-proof, safe, and tamper-proof, an electronic voting system is being developed
using blockchain technology But it has certain disadvantages. The traditional single blockchain
is not very efficient to use on a large scale as the number of transactions being processed per
second is very less 7 per second compared to VISA's 1700 per second and the total number of
unprocessed transactions waiting to be mined and validated by validators is huge compared to
the total population who is eligible to vote and has cast his vote. Hence, in order to scale up the
traditional blockchain-based e-voting system which would make it most time efficient by
dividing and assigning the whole process of counting and validation of votes into smaller
blockchains for each individual polling station and finding the local aggregate, and use a
hierarchical design of blockchains, which would communicate the local aggregate of each of the
local blockchains or shards to the main public blockchains to calculate the global voting results,
or use the divide and conquer strategy to calculate the overall voting results in the main public
blockchain.
1.4 Objective
The following are the objectives we need to achieve through this major project. We need to
eliminate the possibility of vote tampering and the casting of ghost votes. We need to remove
central control of the voting process or achieve decentralization. We need to make the voting,
counting, and result declaration systems transparent, secure, tamper-proof, efficient, and
effective. We need to make the voting system resilient to single points of failure. We need to
reduce the time and resources required.
1.5 Scope
The following are the scope of our project hierarchical blockchain design for scaling the voting
system on a large scale, Hybrid blockchain search algorithm using counting bloom filter and
merkle hash tree for fast authentication of voters, implement cross chain routing protocol
between main chain and shards, hybrid consensus that uses POS and POC for layer 2 blockchain
for enhanced security against 51% attack on the network.
1.6 Methodology
The system comprises blockchains at three different levels: levels 0, 1, and 2. Level two
comprise the shards, or independent private blockchains, for each individual polling station.
These shards are independent of each other and will concurrently process vote information, form
blocks in the local blockchain, and find the partial result for the polling station using
holomorphic encryption that intuitively allows doing an aggregate operation on the cipher text
underneath the encrypted ballots without the need to decrypt it first, and the result is also in an
encrypted format. Level 1 comprises a blockchain of router nodes or validator nodes that will be
randomly assigned to one of the shards using cryptographic sortition and will validate the blocks
from level 2 shards and publish them to the main public blockchain using the blockchain
interoperability or cross-chain routing protocol. Level 0 comprises the main public blockchain,
where the partial encrypted results of all the different polling stations are recorded for calculating
the overall aggregate voting results for the entire voting system on vote opening day using the
shared private key of at least t+1 validator nodes of layer 1, and the results can be audited and
verified publically by anyone, thereby increasing transparency and scalability.
1.8 Summary
The chaper 1 talks about an introduction to the overall work that is carried out throughout this
major project semester and an insight to the problem statement, research gaps in the existing
system and what can be a possible solution to scale the existing blockchain electronic voting
systems.
CHAPTER 2
Overview of Blockchain
2.1 Introduction
Blockchain is a peer to peer distributed ledger of history of transactions contained in blocks
which are linked to each other by cryptographic hash which is like a fingerprint of the previous
valid block hence making blockchain unchangeable. Changing data on blockchain is
computationally very expensive will be explained in the blockchain security section.
One way which means we should not be able to reverse the hash value to get what the message
looked like
Deterministic which implies the hash of a file should be same every time we calculate the hash
for the file.
Fast computation which implies calculating the hash for a file or message or data should be fast
and easy to compute and verify.
Avalanche effect which refers to hash functions are designed in such a way that if you change
even a single bit of the data whose hash has to be calculated the entire hash value for the
message changes like a small snowball leads to a large avalanche by triggering more changes in
the later stages of hash calculation. So every time even if you make the slightest change in the
data to be hashed the whole hash changes and looks random every time.
Must withstand collisions: All hashes are of fixed size for example SHA-256 produces 256 bit
hashes. But the number of documents that can be input to hash function is unlimited and only 2n
are possible hashes where n is the number of bits used to hash there is a possibility of collision or
same hash value for two different documents. It is important for n to be sufficiently large so that
finding how to produce a collision deliberately for a slightly changed document is
computationally expensive. This type of attack where the intruder finds a way to modify the
originally signed document without changing the meaning of it which collides with the slightly
modified version of a fake document to be replaced with having the same hash value is called
birthday attack and finding the collision by brute force takes O(√ n) time and space so for 128
bit hashes the birthday attack would take O(264 ) time and space which is not very secure hence
256 bit is used for hash functions.
Now for calculating the hash of the current block these six header data is used to obtain the hash
value if any of these changes the hash of the current block will change .
Each of the peers in the blockchain network are constantly checking their copy of blockchain
ledger state looks same as the blockchain ledger state of the majority of the neighbour peers
connected directly to it. If the peer I say finds that its copy of the blockchain ledger differs from
majority of its neighbour peers then it discards those blocks and copy the majority accepted
blockchain ledger state.
As a result of this if the attacker changes the data of only one peer on the network its attack will
go in vain as the peer would find it out by comparing its ledger copy with its neighbours and
discard the manipulated invalid copy.
So for a successful attack the attacker would have to simultaneously attack 51% of the peers of
the network so that his changed version of the blockchain ledger copy is accepted as valid by all
the peers participating in the network which is computationally very expensive and almost
impossible to achieve.
CHAPTER 3
Software Requirements Specification
The election commission: they are responsible for monitoring the election process checking and
validating the incoming blocks from the local shards and uploading the validated blocks into the
main public blockchain. They have permission to author blocks and validate the blocks.
The voter: they are responsible to cast votes, view results these users have the permission to only
send transactions to the level 2 blockchains.
The auditors: these are the ‘t’ selected users from the election commission who have the
distributed private key that can be jointly used to open the election results on the vote opening
day.
3. Vote Virtually Voter can vote from any part of the world through webapp
4. Vote anonymously Voter will be able to vote anonymously using public key
7. Vote once any authorized voter can only vote once in an election
Windows 7 or higher
4 GB RAM or higher
Security requirements Basic security features like encrypted transactions and password
authentication should be offered by the system. To avoid unauthorised usage, all passwords
created and distributed to users should only be saved on the server in encrypted form for login
management. By establishing a minimal time interval between repeated unsuccessful log-in
attempts, serial attacks should be prevented.
3.3 Summary
In chapter 3 we have discussed and specified the software requirements specification which is
extremely helpful to unambiguously record all the functional and non functional requirements
and helps the developer team understand what are the needs of the stakeholders without making
any assumptions and will be helpful while validating the software.
CHAPTER 4
High Level Design
Agile development process when implementing new features, teams employ the agile
development technique to reduce risk (such as errors, budget overruns, and changing needs).
Teams create software in iterations that include tiny increments of new functionality according to
all agile development methodologies. The agile development methodology comes in a variety of
forms, such as scrum, crystal, extreme programming (XP), and feature-driven development
(FDD).
The waterfall method is frequently regarded as the oldest approach to software development. The
requirements, design, implementation, verification, and maintenance phases of the waterfall
technique each focus on a different objective. Before moving on to the following phase, each
phase must be finished completely. In most cases, there is no procedure for going back and
changing the project or direction.
The system was developed by first studying how the blockchain network is arranged into
different levels of blockchains in the hierarchical design of the system Figure 4 shows the
different nodes that are present in the level 2 and level 1 of the blockchain which submit the
transactions to the relay main chain or level 0 of the blockchain network.
Then following that deciding on what would the different stages in which the election would be
conducted.
After which defining the high level working and what data is stored at each level of the block
chain system.
1. User profiles, needs, tasks, the physical work environment, and unique human factors
issues are the subject of user, task, and environmental analysis and modelling. User
profiles, requirements, tasks, the physical work environment, and unique human factors
concerns are the main areas of analysis.
2. The purpose of interface design is to establish user scenarios, define interface objects and
actions, and take into account design factors including response time, command and
action structure, error handling, and assistance features.
3. The design of a prototype to test various usage situations is the first step in the
implementation process. Next, windows, menus, device interaction, error messages, and
instructions are created using a User Interface toolkit.
4. The practise of verifying an interface to make sure it satisfies user needs and is simple to
use and understand is known as interface validation. It needs to be able to manage a range
of jobs and carry them out correctly.
One way which means we should not be able to reverse the hash value to get what the message
looked like
Deterministic which implies the hash of a file should be same every time we calculate the hash
for the file.
Fast computation which implies calculating the hash for a file or message or data should be fast
and easy to compute and verify.
Avalanche effect which refers to hash functions are designed in such a way that if you change
even a single bit of the data whose hash has to be calculated the entire hash value for the
message changes like a small snowball leads to a large avalanche by triggering more changes in
the later stages of hash calculation. So every time even if you make the slightest change in the
data to be hashed the whole hash changes and looks random every time.
Must withstand collisions: All hashes are of fixed size for example SHA-256 produces 256 bit
hashes. But the number of documents that can be input to hash function is unlimited and only 2n
are possible hashes where n is the number of bits used to hash there is a possibility of collision or
same hash value for two different documents. It is important for n to be sufficiently large so that
finding how to produce a collision deliberately for a slightly changed document is
computationally expensive. This type of attack where the intruder finds a way to modify the
originally signed document without changing the meaning of it which collides with the slightly
modified version of a fake document to be replaced with having the same hash value is called
birthday attack and finding the collision by brute force takes O(√ n) time and space so for 128
bit hashes the birthday attack would take O(264 ) time and space which is not very secure hence
256 bit is used for hash functions.
Digital signature that takes in the message and the private key of the sender to produce a unique
digital signature that can be used as zero knowledge proof for the receiver that you have the
private key for the public key which has been used to sign the message and the message is
authentic.
4.5 Summary
In chapter 4 we have discussed the high level design of the major project discussing the design
considerations, architectural strategies, system architecture and level 0,1,2 data flow diagrams.
CHAPTER 5
Detailed design
distribution of orders among the various participants in the voting process is done correctly. The
integrity and effectiveness of the entire system are crucially dependent on this module. The order
assignment module in hierarchical blockchain design for e-voting system is voter registration
module and ballot casting module.
5.2.2. Order Assignment Configuration Module
The tools and interfaces required to configure the parameters and settings of the Order
Assignment Configuration Module are provided by this module. The rules and criteria used for
assigning orders can be defined and changed by authorised staff or system administrators using
this module. It has features that let you design order allocation algorithms, specify order priority
requirements, and set constraints for distributing orders in accordance with predetermined
criteria. The validate ballot and validate voting process modules provide order assignment
configuration module.
5.3 Summary
In chapter 5 we have discussed the detailed design of the hierarchical blockchain design for e-
voting system with the structure chart, use case diagram, sequence diagram for the modules to
understand in a better way the modules which are order assignment, order assignment
configuration module, master file generation module in our project work.
CHAPTER 6
Implementation
6.1 Programming language selection
C# is a programming language that offers a plethora of benefits to both inexperienced and
seasoned programmers. It is statically typed, simple to read, and places a strong emphasis on
effectiveness. It is a wonderful entry point into the area because it is very simple to learn and
maintain. It is easier to modify and maintain than other languages since it is scalable and simple
to manage. A big community and object-oriented programming are two features of the computer
language C#. Although it is a unique quality for a programming language, there are several
benefits, including efficiency and versatility. The StackOverflow and Meetup.com communities
are largely made up of C# developers, and object-oriented programming has several benefits,
including efficiency and flexibility.
Unmanaged components with the ability to load the CLR into their processes and start the
execution of managed code can host it. To offer managed code a scalable, server-side
environment, ASP.NET hosts the runtime. The runtime to embed managed components or
Windows Forms controls in HTML documents is hosted by Internet Explorer.
Memory, threading, code execution, code safety checking, compilation, and other system
services are all managed by the Common Language Runtime. The common type system (CTS) is
used to enforce code access security and code resilience. This guarantees type fidelity and type
safety while ensuring that any managed code is self-describing and can consume other managed
types and instances. By enabling developers to use their preferred language to create applications
while fully using the runtime, class library, and components created in other languages, the
runtime increases developer productivity. With improved performance and interoperability
between managed and unmanaged code, it also supports applications from today and yesterday.
High-performance server-side apps may host it.
Server application development is the process of developing Web sites and Internet-distributed
objects using managed code. ASP.NET is the hosting environment that enables developers to use
the.NET Framework to target Web-based applications, while XML Web services are distributed,
server-side application components similar to common Web sites. ASP.NET pages are faster,
more functional, and easier to develop than unmanaged ASP pages because they interact with the
runtime like any managed application. XML Web services technology is rapidly moving
application development and deployment into the highly distributed environment of the Internet.
XML Web services are built on standards such as SOAP, XML, and WSDL.
To improve code clarity, the team followed a naming convention that emphasizes descriptive and
meaningful names for variables, functions, and classes. This helps developers understand the
purpose and functionality of different code elements. For example, variables representing votes
could be named "voterChoice" or "candidateVotes," while functions validating the blockchain
could be named "validateBlockchain()".
6.3.3. Declarations
Consistent declaration practices were followed to enhance code readability. Variables were
declared close to their usage, and access modifiers were used appropriately to control
accessibility. Constants were declared using the "final" keyword to denote their immutability.
Class declarations followed standard conventions, specifying access modifiers and implementing
necessary interfaces or extending relevant classes.
6.3.4. Comments
Comments were used strategically to provide explanations and document code functionality.
Method comments described the purpose, parameters, return values, and exceptions of each
method. In-line comments were employed to clarify complex logic or draw attention to important
details. The comments were written in a clear and concise manner, following the project's chosen
natural language style.
By adhering to these code conventions, the project team aimed to foster code consistency,
improve code readability, and facilitate future enhancements or bug fixes. These conventions
contribute to the overall quality of the blockchain-based e-voting system, making it more
maintainable and understandable for developers and stakeholders alike.
1. Vote Duplication:The prevention of vote duplication was one of the main issues we ran
into. To protect the credibility of the election, it was essential to make sure that each
voter could only cast one ballot. We created a transaction locking-based concurrency
control approach to solve this problem. Voters were prevented from simultaneously
altering the same data when a transaction matching to their vote locked the pertinent data
connected with that vote. By using this strategy, the possibility of double voting was
ensured to be eliminated.
3. Scalability: Our concurrency control method was heavily influenced by our concern
about scalability. We needed to make sure the system could effectively handle the rising
workload as there were more voters and transactions. We used sharding strategies to deal
with this issue. We achieved parallel transaction processing by separating the blockchain
network into smaller, independent portions known as shards. Each shard worked
independently, handling a percentage of the total burden. By spreading out the transaction
processing load across several shards, this method increased system scalability by easing
the burden on individual nodes and enabling a greater volume of concurrent transactions.
6.5 Summary
Conclusion, Our blockchain-based e-voting system's concurrency control faced particular
difficulties, such as preventing vote duplication, guaranteeing vote synchronisation, scalability,
and transaction prioritisation. We effectively overcame these difficulties by implementing
transaction locking, the PoW consensus algorithm, sharding approaches, and a priority queue
architecture. These techniques worked together to provide an electronic voting system that was
safe, synchronised, scalable, and fair in a concurrent setting.
Hardware: To accurately evaluate system performance, the test environment's hardware specs
should be comparable to those of the production environment.
Software: The test environment should be set up with all relevant software components, such as
the blockchain platform, smart contract code, and any additional modules or libraries.
Network: To provide realistic network latency and bandwidth limits, the test environment's
network configuration should be similar to that of the production environment.
Data: To imitate real-world scenarios, a realistic set of data should be developed or imported into
the test environment. This provides test scenarios with various inputs, election data, and sample
voter profiles.
Security: To protect sensitive data and stop unwanted access or alteration, adequate security
measures should be put in place in the test environment.
Monitoring and logging: To watch system activity, find problems, and examine performance
metrics, the test environment should be furnished with monitoring tools and recording systems.
The purpose of test cases should be to cover a variety of scenarios, including validating the
assignment process, resolving edge circumstances, and assigning orders to diverse participants.
To ensure that each procedure or method in the Order Assignment module behaves as intended
and produces the desired outcomes, each function or method should be tested separately.
To make sure that invalid inputs are processed correctly and the right error messages or
exceptions are created, input validation should be thoroughly tested.
To separate the module being tested from other dependencies and enable focused testing and
quicker issue discovery, stubs or mock objects can be employed.
Different configuration possibilities should be covered by test cases, such as changing thresholds
and weights and assessing the effect on the assignment process.
To ensure proper handling and interaction with other system components, each configuration
setting should be evaluated.
Boundary testing can be used to confirm how the configuration module behaves when unusual or
extreme values are supplied.
7.2.3. Unit Testing of Order Assignment:
The integration and interaction of various modules and components used in the assignment
algorithm are tested as part of unit testing the overall Order Assignment process. The following
factors can direct the Order Assignment process's unit testing:
The order assignment process should be covered end-to-end in the test cases, including input
data, algorithm execution, and output validation.
In order to evaluate the reliability and correctness of the assignment process, several input and
data set combinations should be examined.
To guarantee proper data flow and interaction, integration testing with pertinent dependencies,
such as the blockchain platform or database, should be taken into account.
Different integration situations should be covered by test cases, such as communication with a
blockchain platform, database, or external APIs for voter identification or verification.
During the assignment process, data flow and integrity should be checked to make sure that the
assigned orders are appropriately saved and linked to the appropriate participants.
It is important to test boundary cases and extraordinary circumstances, such as network outages
or inconsistent data, to make sure the system can manage them gracefully.
Test cases ought to include situations when the configuration module is used by other
components, such the Order Assignment module or user interfaces.
Check to see if configuration setting changes are implemented properly and reflected in the
assignment process.
In order to retrieve or save configuration data, check the integration of the configuration module
with any external systems or databases that may be used.
To ensure accurate data and information transmission, test the integration between the Order
Assignment and Master File Generation modules.
Examine the resulting master file to make sure it is formatted as required and contains proper
data about the allocated orders.
Test the master file generation or exportation process' integration with any external systems or
APIs.
Test the Order Assignment system's whole process, including data input, assignment algorithm
execution, storage of assigned orders, and master file production.
Verify the Order Assignment module's connection with the configuration module and other
pertinent parts.
To evaluate performance and scalability, test the system behavior under heavy load or concurrent
access.
Test the e-voting procedure from beginning to end, taking into account all possible
circumstances, from voter registration through vote submission and order assignment.
To assess performance and robustness, test the behavior of the system under various stresses,
such as heavy user traffic or network congestion.
To find weaknesses, maintain data privacy, and stop tampering or illegal access, do security
testing.
Verify the system's operation and compliance with any applicable rules or standards for e-voting
systems.
7.5. Summary
The blockchain-based e-voting system can be comprehensively assessed for functionality,
performance, and security by adhering to a complete testing approach that includes unit testing,
integration testing, and system testing.
CHAPTER-8
Experimental Results and analysis
CHAPTER 8
Experimental Results and analysis
8.1. Evaluation Metrics
In order to assess the performance and effectiveness of our blockchain-based e-voting system,
we have defined a set of evaluation metrics. These metrics serve as quantitative measures to
evaluate various aspects of the system's performance. The evaluation metrics considered are:
Accuracy: This metric measures the correctness of the voting results generated by the system. It
compares the number of correctly recorded votes with the total number of votes cast to determine
the accuracy rate. A high accuracy rate indicates the system's ability to record votes correctly and
generate accurate results.
Security: This metric evaluates the level of security provided by the blockchain-based e-voting
system. It assesses the system's resistance against tampering, manipulation, and unauthorized
access. We employed cryptographic mechanisms, such as digital signatures and encryption, to
ensure the integrity and confidentiality of the voting process.
Efficiency: This metric quantifies the efficiency of the system in terms of processing time and
resource utilization. It measures the speed at which the system handles various operations, such
as vote recording, order assignment, and master file generation. We considered the
computational complexity of the algorithms used and implemented optimization techniques to
improve efficiency.
Scalability: This metric assesses the system's ability to handle a large number of voters and
maintain performance under increased load. It measures how well the system can scale with an
increasing number of participants without compromising its performance. We analyzed the
system's performance and resource utilization as the number of voters increased, identifying any
potential bottlenecks and scalability limitations.
Usability: This metric evaluates the user-friendliness of the e-voting system. It assesses factors
such as ease of use, intuitiveness of the interface, and user satisfaction. We conducted user
feedback surveys and usability testing to gather insights on the system's usability and made
improvements based on the feedback received.
The dataset aimed to capture the diversity of potential voters in a real-world election. It included
different age groups, geographical locations, and political affiliations. Additionally, variations in
the number of voters allowed us to assess the system's scalability and performance under
different voter loads. The dataset was carefully anonymized to ensure privacy and data
protection.
The execution time of the order assignment algorithm was measured to assess its efficiency. We
employed optimization techniques to improve the algorithm's performance and reduce processing
time.
To evaluate the fairness of the order assignment, we calculated the variance in the assigned
orders across different demographic groups. A lower variance indicated a more equitable
distribution of orders, ensuring that no specific group was favored or disadvantaged.
The execution time of the master file generation algorithm was measured to assess its efficiency.
We implemented optimizations to reduce the time required to aggregate and encrypt the cast
votes.
To verify the integrity of the master file, we compared it with the individual cast votes. This
verification ensured that all votes were accurately included in the master file. We also verified
the encryption and decryption process to confirm that the votes remained secure and confidential
during the generation phase.
8.4. Summary
In chapter 8 by evaluating the performance of the order assignment and master file generation,
we gained insights into the efficiency, reliability, and fairness of these crucial components of the
blockchain-based e-voting system.
CHAPTER-9
Conclusion and future enhancement
CHAPTER 9
Conclusion and future enhancement
9.1. Limitations of the Project
The trilemma of the blockchain i.e. achieving the three scalability, decentralization, and security
concurrently is not possible we can achieve any of the two with a compromise on the third one.
Here in this project true sense of decentralization cannot be achieved as the level 1 of blockchain
has more authority than the voter nodes at level 2 and the system is not fully automatic the
election commission is responsible for uploading the encrypted candidate list and eligible voter
list though it is made random using cryptographic sortition but the system is not fully automatic
and decentralized in the true sense there is some compromise over here to achieve scalability.
9.3 Summary
In the chapter 9 we have discussed the limitations of the hierarchical blockchain design of e-
voting system and the possible future enhancements in detail.