Report StudentVotingProject
Report StudentVotingProject
Web3 Approach
Submitted in Partial Fulfillment of Requirements for the Award of Degree of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted by
M.DHARMATEJA (20501A05B9)
J. MANOJ KUMAR (20501A0568)
M.HARI PAVAN GOPI KRISHNA (20501A05C2)
K. RAMU (21505A0510)
(An NBA & NAAC accredited and ISO 9001:2015 certified institution)
2023-24
1
PRASAD V POTLURI SIDDHARTHA INSTITUTE OF TECHNOLOGY
(Permanently affiliated to JNTU:Kakinada, Approved by AICTE)
(An NBA & NAAC accredited and ISO 9001:2015 certified institution)
CERTIFICATE
This is to certify that the project report titled “Student Voting on ICP Blockchain: A
Decentralized Web3 Approach” is the bonafied work of Mr. M. Dharmateja (20501A05B9),
Mr. J. Manoj Kumar(20501A0568), Mr. M. Hari Pavan Gopi Krishna (20501A05C2), Mr.
K. Ramu (21505A0510) in partial fulfilment of the requirements for the award of the graduate
degree of BACHELOR OF TECHNOLOGY in Computer Science and Engineering during the
academic year 2023-2024.
2
ACKNOWLEDGMENT
We take this opportunity to express our sincere gratitude and respect to Prasad V Potluri
Siddhartha Institute of Technology, Kanuru for providing us a platform to pursue our
studies and carry out our final year project.
It is our privilege and pleasure to express profound sense of respect, gratitude and indebtedness
to our guide Dr. K. Koteswara Rao, Associate Professor, Dept. of Computer Science and
Engineering, Prasad V Potluri Siddhartha Institute of Technology, for his indefatigable
inspiration, guidance, cogentdiscussion, constructive criticisms and encouragement throughout
this dissertation work.
We express our sincere gratitude to Dr. A. Jaya Lakshmi, Professor & Head,
Department of Computer Science and Engineering, Prasad V Potluri Siddhartha Institute of
Technology, for her suggestions, motivations and co-operation for the successful completion
of the work.
We extend our sincere thanks to all the teaching faculty of Department of CSE, whose
suggestions during reviews helped us in accomplishment of our project.
M Dharmateja (20501A05B9)
J Manoj Kumar(20501A0568)
M Hari Pavan Gopi Krishna (20501A05C2)
K Ramu (21505A0510)
3
DECLARATION
We, the students of Computer Science and Engineering, to Prasad V Potluri Siddhartha
Institute of Technology, Kanuru declare that the work entitled " Student Voting on ICP
Blockchain: A Decentralized Web3 Approach" has been successfully completed under the
guidance of Dr. K. Koteswara Rao, Associate Professor, Computer Science and Engineering
Department, Prasad V Potluri Siddhartha Institute of Technology, Kanuru. This dissertation
work is submitted in partial fulfilment of the requirements for the award of Degree of Bachelor
of Engineering in Computer Science and Engineering during the academic year 2023 - 24.
Further the matter embodied in the project report has not been submitted previously by anybody
for the award of any degree or diploma to any university.
Team Members:
M Dharmateja (20501A05B9)
J Manoj Kumar(20501A0568)
M Hari Pavan Gopi Krishna (20501A05C2)
K Ramu (21505A0510)
Date:
4
TABLE OF CONTENTS
Page No.
Certificate 2
Acknowledgement 3
Declaration 4
Abstract 7
List of tables 8
List of figures 8
5
3.3 Feasibility Study 15
3.3.1 Technical Feasibility 15
3.3.2 Operational Feasibility 16
3.3.3 Economic Feasibility 16
6. Implementation 29
29
6.1 Modules
6.2 Description of Sample code of Each Module 30
7. Testing 39
7.1 Testing Strategy 39
40
7.2 Test Cases
6. Results 41
6
ABSTRACT
This project introduces a transformative approach to educational institute governance through the
implementation of a blockchain-based voting system. Leveraging the Internet Computer Protocol (ICP)
blockchain and React, we have developed a decentralized application (DApp) that empowers students to
engage in the decision-making processes of their educational institutions securely and transparently.
The core features of our system revolve around a token-based governance model. Upon enrollment, each
student receives tokens that represent their voting power. This innovation brings transparency and fairness
to the governance system as students' votes are proportionate to their academic performance and
participation in extracurricular activities.
The DApp offers a seamless and intuitive user experience with a dedicated interface for both students and
administrators. Students can view their token balances, track academic achievements, and actively
participate in voting processes. Administrators access an exclusive admin panel, enabling them to manage
token distribution, review voting statistics, and maintain student records.
The project's unique features also include the use of orthogonal persistence within the ICP blockchain,
safeguarding essential student data and academic records from tampering or loss. The security of the system
is further enhanced through a custom authentication system, eliminating the need for Internet Identity and
ensuring secure logins for students and administrators.
7
LIST OF TABLES
Chapter 2:
LIST OF FIGURES
Chapter 5:
Chapter 8:
8
CHAPTER 1: INTRODUCTION
1.2 Motivation
Our project is motivated by the imperative to modernize and enhance the governance processes
within educational institutes. By incorporating blockchain technology, we aim to address the
longstanding challenges of traditional voting systems, such as transparency, security, and
efficiency. This innovation empowers students and administrators, creating a more inclusive
and reliable environment for decision-making and encouraging academic excellence and active
participation.
Problem: Traditional educational institute voting systems suffer from issues of transparency,
security, and efficiency, hindering effective governance.
Solution: Our project offers a blockchain-based Voting Management System (VMS) that
leverages the Internet Computer Protocol (ICP) blockchain and React to create a secure,
transparent, and efficient voting process, empowering students and administrators for improved
educational institute governance.
9
1.4 Objectives
The general objective of the work is to develop a secure and efficient blockchain-based Voting
Management System (VMS) using the Internet Computer Protocol (ICP) blockchain and React,
enhancing the governance of educational institutes through transparent and decentralized
voting processes.
The specific objectives of the work is to implement a token-based voting system that allocates
tokens to students, enables secure voting, and ensures transparency within the educational
institute.
This work can be developing a blockchain-based voting system for an educational institute. It
encompasses system design, smart contract development, front-end interface, and secure
authentication.
Our project introduces an innovative blockchain-based voting system for educational institutes,
enhancing transparency and security. It empowers students, encourages academic excellence,
and ensures tamper-proof record-keeping. By leveraging blockchain technology, our work
offers a forward-thinking solution to the long-standing challenges of traditional voting systems
in educational governance.
10
CHAPTER 2: BACKGROUND AND LITERATURE REVIEW
The following table demonstrates the literature survey conducted to propose this
work:
11
"TRUSTWORTHY VOTING WITH The study examines the The proposed system
BLOCKCHAIN TECHNOLOGY" trustworthiness of voting integrates blockchain to
BY B. SHAHZAD AND J. systems using blockchain ensure trustworthy voting.
CROWCROFT. technology. It reviews It focuses on
previous work and introduces decentralization and
a blockchain-based voting immutability, addressing
approach. security and transparency
in the voting process.
"A PROPOSAL FOR The study presents a proposal The proposed system
BLOCKCHAIN-BASED for blockchain-based harnesses blockchain
ELECTRONIC VOTING" BY C. K. electronic voting systems. It technology to ensure
ADIPUTRA, R. HJORT, AND H. reviews existing research and secure and transparent
SATO. introduces a blockchain- electronic voting. It
powered approach for secure focuses on
and transparent elections. decentralization and
tamper resistance,
enhancing voter trust in
the electoral process.
"SECURING DIGITAL VOTING The research explores the use The proposed system
WITH BLOCKCHAIN" BY K. M. of blockchain technology to leverages blockchain to
KHAN, J. ARSHAD, AND M. M. secure digital voting systems. enhance the security of
KHAN. It reviews relevant work and digital voting. It focuses
introduces a blockchain- on decentralization and
based approach for secure immutability, ensuring
voting. tamper-proof elections.
12
The study investigates the The proposed system
"BLOCKCHAIN-POWERED
potential of blockchain for integrates blockchain
VOTING SYSTEM" BY S.
transforming voting technology to enhance
SHAH, Q. KANCHWALA, AND
systems. It reviews the security and
H. MI.
previous work and transparency of voting
introduces a blockchain- processes. It aims to build
powered voting system. trust among voters while
ensuring efficient
elections.
13
"BLOCKCHAIN TECHNOLOGY - The report explores the The study highlights
BEYOND BITCOIN" BY N. M. broader applications of blockchain's potential to
CROSBY, P. PATTANAYAK, S. blockchain technology, enhance security and
VERMA, AND V. emphasizing its trust in various systems,
KALYANARAMAN. significance beyond including voting. It offers
cryptocurrencies. It a foundation for
provides insights into understanding
blockchain's diverse use blockchain's
cases. transformative impact.
14
CHAPTER 3: SYSTEM ANALYSIS
Our proposed solution introduces a direct interaction model with the voting DApp deployed on
the Internet Computer Protocol (ICP) blockchain. Unlike traditional methods with multiple
intermediaries, ICP allows users to directly communicate with the DApp using HTTP requests
and responses. This direct approach enhances efficiency and security in the voting process.
In this phase, the feasibility of the project is analyzed and a business proposal is presented with
a very general plan of the project and some cost estimates. As part of the system analysis, a
feasibility study of the proposed system will be conducted. This is to ensure that the proposed
system does not burden the company. Some understanding of key system requirements is
essential for a feasibility analysis.
The economic feasibility of our project is favorable. The use of ICP and open-source
technologies reduces infrastructure and licensing costs. Furthermore, the cost savings achieved
by eliminating intermediaries contribute to the economic viability of our solution.
In conclusion, our idea demonstrates strong technical, operational, and economic feasibility,
making it a viable and promising solution for modernizing the voting process.
16
CHAPTER 4: SOFTWARE REQUIREMENT SPECIFICATION
Input:
- User registration and authentication: The system should allow users (students and administrators)
to register and log in securely.
- Student data input: The application must support the input of student information, such as
academic records and extracurricular activities.
- Decision creation: Administrators should be able to propose decisions and set voting options.
- Voting process: Students should have the ability to cast their votes for different decisions and
options.
- Decision results: The system should calculate and display the results of each decision after the
voting period ends.
- Token distribution: The application must distribute tokens to students based on academic
performance and participation.
- User interactions: The system should capture interactions like voting and proposing decisions.
Output:
- Student information display: The system should allow students to view their token balances,
academic achievements, and voting history.
- Decision results display: The application must display the results of each decision, showing the
winning option and the vote count for each.
- Admin panel: Administrators should have access to a dedicated panel to view voting statistics,
manage token distribution, and administer the system.
- Alerts: The system should issue alerts in cases where a student tries to vote twice for the same
decision or in response to significant events.
User Interface:
- Web interface: The application should provide a user-friendly web interface accessible via
standard web browsers. The interface should allow users to interact with the system, propose
decisions, cast votes, and access relevant information.
17
4.2 Non-Functional Requirements
Non-functional requirements are quality requirements that the system must meet according to
the project contract. The extent or priority to which these elements are implemented will vary
from project to project. Also called the no-behavior requirement.
Performance:
- Efficiency: The system must perform efficiently, ensuring that operations such as user
authentication, token distribution, and vote counting are executed promptly.
- Scalability: The system should be able to accommodate a growing number of students and
decisions without significant performance degradation.
- Response Time: The web interface should provide quick response times for user interactions,
ensuring a seamless voting experience.
Usability:
- User-Friendly Interface: The web interface must be intuitive and user-friendly, requiring
minimal training for students and administrators.
- Accessibility: The interface should be designed to be accessible to a wide range of users,
including those with varying levels of technical expertise.
Compatibility:
- Operating Systems: The system should be compatible with a variety of operating systems,
including Windows and Linux, to ensure broad accessibility.
- Browser Compatibility: The web interface should work seamlessly on popular web browsers,
such as Chrome, Firefox, and Edge, to accommodate a wide range of users.
Security:
- Data Privacy: The system should ensure the privacy and security of student data, protecting
sensitive information from unauthorized access.
- Authentication Security: User authentication should be robust and secure to prevent
unauthorized access to the system.
- Data Integrity: Measures must be in place to maintain data integrity, including ensuring the
accuracy and reliability of voting results.
Reliability:
- Uptime: The system should maintain a high level of availability, minimizing downtime to
ensure users can access it consistently.
- Error Handling: Robust error handling mechanisms should be in place to provide informative
error messages and prevent system crashes
18
CHAPTER 5: DESIGN AND METHODOLOGY OF
PROPOSED SYSTEM
1. Blockchain Network (ICP): The core of the system is built on the Internet Computer
Protocol (ICP) blockchain. ICP provides a decentralized and tamper-proof ledger for storing
and securing voting transactions. Unlike traditional databases, the ICP blockchain ensures the
immutability of data once recorded, reducing the risk of manipulation. Data is stored in
canisters on the ICP blockchain, eliminating the need for centralized storage.
2. React Front-End: The user interface is developed using the React framework. This web-
based front-end provides an intuitive platform for students and administrators to access and
interact with the voting system. The React front-end enables users to cast their votes, verify
their voting status, and participate in the governance process.
3. Motoko Smart Contracts: Smart contracts, written in the Motoko programming language,
play a crucial role in ensuring the security and integrity of the voting process. These contracts
manage user authentication, vote recording, and verification. They interact with the ICP
blockchain and the React front-end to facilitate secure and transparent voting operations.
This architecture ensures a secure, transparent, and efficient voting system for educational
institutes. The ICP blockchain stores and secures voting data, while smart contracts manage
the logic of the system. The React-based front-end provides a user-friendly interface, allowing
users to participate in the governance process seamlessly.
19
By adopting the Internet Computer Protocol (ICP) blockchain and Motoko smart contracts, our
decentralized app (DApp) enhances the trustworthiness and efficiency of voting in educational
institutes, addressing the limitations of traditional voting systems.
The entire process, from login to voting, operates within a secure environment that ensures user
authentication and integrity. Upon completion, the voting data is securely stored within canisters,
employing the ICP (Internet Computer Protocol) blockchain's decentralized framework to preserve vote
transparency, immutability, and data integrity. This architecture integrates a user-friendly front-end, a
robust authentication layer, decision creation features for administrators, and a secure, blockchain-based
storage system for transparent and immutable vote recording.
20
Fig 5.3: Proposed Model Architecture
The goal of UML is to become a common language for modeling object-oriented computer
software. UML in its current form consists of his two main components: the metamodel and
21
the notation. Some form of method or process may also be added in the future. or associated
with UML.
22
Activity Diagram:
Activity diagrams tell about how different activities are interconnected with each other. This
can be at various levels of abstraction. Events usually need to be accomplished by some
operation. Especially if the operation is intended to accomplish many different things that
require coordination, or how the events relate to each other in a single use case, especially if
the activities overlap and coordinate is required. It is also useful for modeling how a set of use
cases can be coordinated to represent a business flow. The activity diagram is illustrated in Fig
5.6.
1. Requirements Gathering:
- Identify and document the specific requirements of the educational institute's voting
system.
23
- Define the roles and permissions of users, such as students, faculty, and administrators.
- Determine the voting categories and processes to be supported.
2. System Design:
- Develop the architectural design, specifying the components and their interactions.
- Choose the Internet Computer Protocol (ICP) blockchain as the core technology for data
storage and security.
- Design the React-based user interface for an intuitive voting experience.
- Create the structure and logic of Motoko smart contracts to manage voting operations.
3. Blockchain Integration:
- Set up the Internet Computer Protocol (ICP) blockchain and configure it for the voting
system.
- Create canisters on the ICP blockchain to store data and smart contracts securely.
5. Front-End Development:
- Build the user interface using the React framework.
- Design web pages for user registration, voting, and verification.
- Implement a secure authentication system to verify the identity of voters.
6. Testing:
- Conduct thorough testing to verify the functionality of the system.
- Perform unit tests for smart contracts and front-end components.
- Execute end-to-end testing to validate the entire voting process.
7. Deployment:
- Deploy the decentralized app (DApp) on the Internet Computer Protocol (ICP) blockchain.
- Ensure the smart contracts are correctly deployed and can interact with the blockchain.
24
8. User Training:
- Provide training to users, including students, faculty, and administrators, on how to use the
blockchain-based voting system.
25
5.3.1 Tools and Techniques
1. Internet Computer Protocol (ICP) Blockchain:
The Motoko programming language is a new, modern and type safe language for
developers who want to build the next generation of distributed applications to run on the
Internet Computer blockchain network. Motoko is specifically designed to support the
unique features of the Internet Computer and to provide a familiar yet robust programming
environment. As a new language, Motoko is constantly evolving with support for new
features and other improvements.
3. React Framework:
4. JavaScript:
HTML and CSS are two of the most important languages used in web development. HTML
(Hypertext Markup Language) is used to create the structure and content of a webpage,
while CSS (Cascading Style Sheets) is used to define the visual style and layout of a
webpage. Together, HTML and CSS allow developers to create functional and visually
appealing websites. HTML provides the framework for the page, while CSS provides the
styling and layout. By separating the content from the presentation, HTML and CSS make
it easier to maintain and update the design of a website.
- HTTP is used for communication between the React-based front-end and the ICP
blockchain, allowing data exchange and interaction with the smart contracts.
- We have use IDE Visual Studio Code writing, testing, and debugging code in Windows
Subsystem Linux Environment (WSL-Ubuntu).
9. Security Tools:
27
10. Data Storage and Canisters:
- Canisters on the ICP blockchain are used for storing voting data securely, eliminating
the need for centralized storage solutions.
These tools and technologies are carefully chosen to create a robust, user-friendly, and
secure blockchain-based decentralized voting app that addresses the unique requirements
of educational institutes.
28
CHAPTER 6: IMPLEMENTATION
6.1 Modules
29
6.2 Description of Sample code of Each Module
Description:
Token management involves handling the creation, transfer, and modification of tokens
representing some value within a system. It includes functionalities like transferring tokens
between accounts, checking balances, updating student information, and more.
Code:
public func transfer(to: Text, amount: Nat): async Text {
if (Text.equal(to, owner)) {
return "Cannot transfer tokens to the owner.";
};
let fromBalance = await balanceOf(owner);
if (fromBalance >= amount) {
let newFromBalance: Nat = fromBalance - amount;
let fromStudentOpt = balances.get(owner);
let toStudentOpt = balances.get(to);
switch (fromStudentOpt) {
case (null) {
return "Owner's account not found.";
};
case (?fromStudent) {
switch (toStudentOpt) {
case (null) {
return "Receiver's account not found.";
};
case (?toStudent) {
let ownerYear = fromStudent.year;
let toStudentYear = toStudent.year;
let toStudentName = toStudent.name;
balances.put(owner, { name = fromStudent.name; balance = newFromBalance; year
= "0" });
let toBalance = await balanceOf(to);
30
let newToBalance: Nat = toBalance + amount;
balances.put(to, { name = toStudentName; balance = newToBalance; year =
toStudentYear });
return "Success";
}
}
}
}
} else {
return "Insufficient Funds";
}
};
public func updateStudent(to: Text,newName: Text, newYear: Text): async Text {
if (Text.equal(to, owner)) {
return "Cannot update the owner.";
};
let toBalance = await balanceOf(to);
balances.put(to, { name = newName; balance = toBalance; year = newYear });
return "Success";
};
public func deleteStudent(id: Text): async Text {
if (Text.equal(id, owner)) {
return "Cannot delete the owner.";
};
let delReq : ?StudentInfo = balances.get(id);
switch(delReq){
case(null){
return "Student doesn't exist";
};
case(_){
ignore balances.remove(id);
return "Student data has been deleted";
};
};
31
return "Success";
};
public func replenish(): async Text {
balances.put(owner, { name = "ADMIN"; balance = totalSupply; year = "0" });
return "Success";
};
public func addStudent(to: Text,newName: Text, newYear: Text): async Text {
if (Text.equal(to, owner)) {
return "Cannot add the owner.";
};
let toBalance = await balanceOf(to);
balances.put(to, { name = newName; balance = 100; year = newYear });
return "Success";
};
public func promoteStudent(to: Text, newName: Text, newYear: Text): async Text {
if (Text.equal(to, owner)) {
return "Cannot promote the owner.";
};
32
case "2" { "3" };
case "3" { "4" };
case "4" { "graduated" };
case _ { currentYear };
};
let updatedBalance: Nat = studentInfo.balance - 100;
balances.put(to, { name = newName; balance = updatedBalance; year = nextYear });
return "Promoted successfully to year " # nextYear;
}
}
};
Description:
SHA-256 calculation involves generating SHA-256 hashes for given data or text inputs. This
functionality is often used for cryptographic purposes, data integrity verification, and
security-related operations.
Code:
public func sha256(data: [Nat8]): async [Nat8] {
return Sha256.sha256(data);
};
public func calculateSHA256(input: Text): async [Nat8] {
return SHA256.sum256(Blob.toArray(Text.encodeUtf8(input)));
};
Description:
Decision making involves proposing decisions, casting votes for different options, and
finalizing decisions based on the voting results. It's typically used in voting systems,
governance models, and other scenarios where collective choices need to be made.
33
Code:
public func proposeDecision(decisionID: Text, options: [Text]): async Text {
let newDecision: Decision = {
decisionID = decisionID;
options = options;
votes = HashMap.HashMap<Text, Text>(1, Text.equal, Text.hash);
};
decisions.put(decisionID, newDecision);
return "Success";
};
public func castVote(decisionID: Text, option: Text, voter: Text): async Text {
let decision = decisions.get(decisionID);
switch (decision) {
case (null) {
return "Decision not found.";
};
case (?existingDecision) {
let optionExists = await optionExistsInArray(existingDecision.options, option);
if (optionExists) {
let voterVote = existingDecision.votes.get(voter);
switch (voterVote) {
case (null) {
let voterStudentInfo : StudentInfo = await getStudentInfo(voter);
existingDecision.votes.put(voter, option);
34
return "Vote cast successfully.";
};
case (?existingVote) {
return "You have already voted for this decision.";
};
}
} else {
return "Invalid option for the decision.";
}
};
};
};
public func getDecisionOptions(decisionID: Text): async [Text] {
let decision = decisions.get(decisionID);
switch (decision) {
case (null) {
return [];
};
case (?existingDecision) {
return existingDecision.options;
};
};
};
public func makeDecision(decisionID: Text): async Text {
let decision = decisions.get(decisionID);
switch (decision) {
case (null) {
return "Decision not found";
};
case (?existingDecision) {
let votes = existingDecision.votes;
var voteCounts = HashMap.HashMap<Text, Nat>(1, Text.equal, Text.hash);
for (voter in votes.keys()) {
35
let voteOption = votes.get(voter);
switch (voteOption) {
case (null) {
};
case (?existingVote) {
let currentVoteCount = switch (voteCounts.get(existingVote)) {
case (null) { 0 };
case (?count) { count };
};
voteCounts.put(existingVote, currentVoteCount + 1);
};
};
};
var winningOption: Text = "No decision finalized";
var maxVotes: Nat = 0;
for (option in voteCounts.keys()) {
let voteCount = switch (voteCounts.get(option)) {
case (null) { 0 };
case (?count) { count };
};
if (voteCount > maxVotes) {
maxVotes := voteCount;
winningOption := option;
};
};
ignore decisions.remove(decisionID);
return winningOption;
};
};
};
36
6.2.4. Data Management
Description:
Data management involves maintaining and manipulating data structures like HashMaps to
store and retrieve information efficiently. It ensures proper organization and access to data
within the system.
Code:
private var decisions = HashMap.HashMap<Text, Decision>(1, Text.equal, Text.hash);
public system func preupgrade() {
balanceEntries := Iter.toArray(balances.entries());
};
public system func postupgrade() {
balances := HashMap.fromIter<Text, StudentInfo>(balanceEntries.vals(), 1, Text.equal,
Text.hash);
if (balances.size() < 1) {
balances.put(owner, { name = "Admin"; balance = totalSupply; year = "ADMIN" });
};
};
Description:
Helper functions provide auxiliary functionalities to support main operations. They streamline
code, improve readability, and facilitate common tasks.
Code:
public func optionExistsInArray(arr: [Text], option: Text) : async Bool {
var found = false;
for (i in Iter.range(0, arr.size() - 1)) {
if (arr[i] == option) {
found := true;
};
37
};
found
};
public query func getDecisionIDs(): async [Text] {
var decisionIDs: [Text] = [];
for (decision in decisions.entries()) {
let (decisionID, _) = decision;
decisionIDs := Array.append(decisionIDs, [decisionID]);
};
return decisionIDs;
};
public query func getVotesForOption(decisionID: Text, option: Text): async Nat {
let decision = decisions.get(decisionID);
switch (decision) {
case (null) { return 0;};
case (?existingDecision) {
let votes = existingDecision.votes;
var count: Nat = 0;
for (voter in votes.keys()) {
let voteOption = votes.get(voter);
switch (voteOption) {
case (null) {
return 0;
};
case (?existingVote) {
if (existingVote == option) count += 1;
}
}
};
return count;
};
};
return 0;
};
38
CHAPTER 7: TESTING
We conducted extensive testing of our project on the ICP's Interchain Platform v1.0 Testnet. This
platform operates on the formidable Augusteum Consensus, representing a significant advancement
in blockchain connectivity. The implementation allows for interchain transfers between CVM and
non-CVM chains, marking a pivotal shift towards a more interconnected and efficient blockchain
ecosystem.
During the testing phase, developers were able to access all modules present inside the canister via
the command-line interface (CLI) while evaluating the Decentralized Application (Dapp). Through
simulation, we replicated scenarios involving multiple users accessing the Dapp concurrently to
gauge its performance.
2. Concurrency Testing: We simulated scenarios with multiple users accessing the Dapp
simultaneously to assess its ability to handle concurrent requests and maintain stability under
varying loads.
Conclusion:
The rigorous testing conducted on the ICP's Interchain Platform v1.0 Testnet, powered by the
Augusteum Consensus, demonstrated the robustness and reliability of our Decentralized
Application. By leveraging interchain transfers and embracing a more connected blockchain
ecosystem, we are poised to deliver seamless and efficient solutions to our users.
39
7.2 Test Cases
7.2.1 Queries:
1. Number of Users: 1
- Description: Single user accessing the Dapp to perform queries.
- Expected Outcome: Measure response time for query operation under minimal load.
2. Number of Users: 10
- Description: Ten users simultaneously accessing the Dapp to perform queries.
- Expected Outcome: Assess response time for query operation under moderate load.
7.2.2 Updates:
1. Number of Users: 1
- Description: Single user accessing the Dapp to perform updates.
- Expected Outcome: Measure response time for update operation under minimal load.
40
2. Number of Users: 10
- Description: Ten users simultaneously accessing the Dapp to perform updates.
- Expected Outcome: Assess response time for update operation under moderate load.
These test cases are designed to evaluate the performance and scalability of the Decentralized
Application (Dapp) under various user load scenarios for both query and update operations.
41
CHAPTER 8: RESULT
Generated line plot to analyze the performance of our decentralized application (DApp) in
relation to the number of queries made to it.
As the graph shows, on the x-axis, we have the "Number of Queries," which represents the
quantity of interactions or requests made to our DApp. On the y-axis, we have "Time Taken
(seconds)," which indicates the amount of time it takes for our DApp to respond to these
queries.
42
Analysis of the performance based on the graph:
1. Consistency: One notable aspect is the consistency in response time. Even as the number of
queries increases from 1 to 1000, the response time remains relatively stable. This suggests that
our DApp maintains a consistent level of performance, which is a positive sign.
2. Scalability: Our DApp seems to handle an increase in the number of queries quite well. The
slight increase in response time as the number of queries grows suggests that our system is
scalable, which is essential for accommodating more users or transactions in the future.
3. Efficiency: The response times, ranging from 0.026 to 0.029 seconds, indicate that our DApp
is responding quickly to user queries. This efficiency is crucial in providing a smooth and
responsive user experience.
4. Reliability: The consistent response times across different query quantities reflect the
reliability of our DApp. Users can rely on it to perform consistently, regardless of the workload.
Overall, based on this analysis, our DApp demonstrates good performance in terms of
consistency, scalability, efficiency, and reliability. This bodes well for providing users with a
seamless and dependable voting experience.
43
Time taken Vs Number of updates
Generated line plot to analyze the performance of our decentralized application (DApp) in
relation to the number of updates made to it.
In this graph:
- On the x-axis, we have "Number of Updates," representing the quantity of updates or changes
made to our DApp.
- On the y-axis, we have "Time Taken (seconds)," indicating the time it takes for our DApp to
process these updates.
44
Analysis of the performance based on the graph:
1. Incremental Time Increase: As the number of updates increases, we can observe a gradual
and incremental increase in the time taken for these updates. This suggests that our DApp's
performance remains relatively stable as the update load grows. The increase in processing
time is consistent and predictable.
2. Predictable Scalability: The predictable and incremental nature of the time increase
indicates that our DApp is scalable. It can accommodate additional updates without
experiencing sudden spikes in processing time, which is vital for maintaining a smooth user
experience during periods of high activity.
3. Consistency: The performance of our DApp is consistent, which is a positive sign for users.
They can expect a uniform experience regardless of the number of updates, as there are no
sudden spikes or dips in processing time.
4. Stability: The stable and gradual increase in processing time suggests that our DApp is stable
and capable of handling a growing number of updates without causing disruptions.
In summary, this analysis indicates that our DApp exhibits consistent and predictable
performance when dealing with various numbers of updates. It demonstrates scalability,
maintaining stable processing times as the update load increases. This reliability ensures that
users can rely on our DApp for efficient and consistent interactions, which is crucial for the
success of a voting application.
45
RESULTS AND SCREENSHOTS:
The landing page of our project offers a seamless and secure gateway for both students and
administrators. Students can conveniently log in to access the voting system, ensuring their
engagement in the democratic process. Administrators, on the other hand, gain access to essential
tools for overseeing and managing the platform, guaranteeing smooth and efficient operation.
46
Fig 8.2: Admin Page: Add, Update Student data
Our project incorporates a robust student data entry system facilitated by a secure student and
admin login. Students can easily access the platform, providing essential data securely, while
administrators have privileged access for monitoring and managing the system efficiently. This
streamlined process ensures that student data is seamlessly integrated into the blockchain-based
voting system, enhancing the overall user experience and data security.
48
In our blockchain-based e-voting system, we have implemented a "Make Decision" functionality
that empowers administrators to finalize decisions based on the maximum number of votes
received. This feature enhances the efficiency and transparency of the decision-making process,
allowing administrators to make informed choices while upholding the principle of majority rule.
49
CHAPTER 9: CONCLUSION AND FUTURE WORK
9.1 CONCLUSION
This project also builds upon and extends the existing body of research and initiatives in the
field of blockchain-based voting systems, aiming to provide a comprehensive solution that
encompasses security, transparency, and voter trust. By adopting a decentralized and tamper-
proof ledger, we ensure the immutability of voting transactions, reducing the risk of
manipulation and fraud. The elimination of intermediaries and the adoption of cost-efficient
canisters for data storage further optimize resource utilization.
Moreover, the project's feasibility, including its technical, operational, and economic aspects,
has been assessed, demonstrating the viability of the proposed solution. The inclusion of both
functional and non-functional requirements ensures that the system performs at high speed,
maintains user-friendliness, and is compatible with various operating systems.
The system architecture, comprising the ICP blockchain, React front-end, and smart contracts,
plays a pivotal role in ensuring the reliability and transparency of the voting process. The
inherent advantages of the ICP blockchain, such as decentralization, consensus mechanisms,
and immutability, enhance the integrity of the system.
As with any technological innovation, this project serves as a stepping stone, and further
50
development and refinement will be necessary. However, the foundation laid by our research
and implementation is a promising start towards a brighter future for voting within educational
institutes. We look forward to the potential application of this system in various educational
contexts, contributing to fair, secure, and efficient elections.
While the blockchain-based decentralized voting system for educational institutes presented in
this report represents a significant leap forward in modernizing and securing the voting process,
there are several areas for potential future work and improvements:
1. Enhanced Security: Continuous research into improving the security of the system is
crucial. This includes further evaluation of potential vulnerabilities and the development of
countermeasures to protect against emerging threats.
4. Mobile Accessibility: Adapting the system for mobile access, including the development of
mobile applications, can enhance accessibility for users who prefer to vote using their
smartphones or tablets.
These future work areas are indicative of the ongoing commitment to improving and expanding
the blockchain-based decentralized voting system for educational institutes. By addressing
these aspects, the system can continue to evolve and adapt to meet the ever-changing needs and
expectations of educational institutions and their voting processes.
51
REFERENCES & BIBLIOGRAPHY
[1] S. -V. Oprea, A. Bâra, A. -I. Andreescu, and M. P. Cristescu, "Conceptual Architecture of a
Blockchain Solution for E-Voting in Elections at the University Level," in IEEE Access, vol. 11, pp.
18461-18474, 2023, doi: 10.1109/ACCESS.2023.3247964.
[2] M. S. Farooq, U. Iftikhar, and A. Khelifi, "A Framework to Make Voting System Transparent
Using Blockchain Technology," in IEEE Access, vol. 10, pp. 59959-59969, 2022, doi:
10.1109/ACCESS.2022.3180168.
[5] B. Shahzad and J. Crowcroft, "Trustworthy electronic voting using adjusted blockchain
technology," IEEE Access, vol. 7, pp. 24477–24488, 2019, doi: 10.1109/ACCESS.2019.2895670.
[7] N. Mohd. Suki and N. Mohd. Suki, "Decision-making and satisfaction in campus e-voting:
Moderating effect of trust in the system," J. Enterprise Inf. Manage., vol. 30, no. 6, pp. 944–963, Oct.
2017, doi: 10.1108/JEIM-08-2016-0151.
[8] C. Culnane, A. Essex, S. J. Lewis, O. Pereira, and V. Teague, "Knights and knaves run elections:
Internet voting and undetectable electoral fraud," IEEE Secur. Privacy, vol. 17, no. 4, pp. 62–70, Jul.
2019, doi: 10.1109/MSEC.2019.2915398.
[9] M. A. Specter, J. Koppel, and D. Weitzner, "The ballot is busted before the blockchain: A
security analysis of Voatz, the first internet voting application used in U.S. federal elections," in Proc.
29th USENIX Secur. Symp., 2020, pp. 1535–1552.
[10] K. M. Lewis and T. W. Rice, "Voter turnout in undergraduate Student government elections,"
PS, Political Sci. Politics, vol. 38, no. 4, pp. 723–729, 2005.
[11] T. Haines, S. J. Lewis, O. Pereira, and V. Teague, "How not to prove your election outcome,"
in Proc. IEEE Symp. Secur. Privacy (SP), May 2020, pp. 644–660.
52
[12] B. Albertson and K. Guiler, "Conspiracy theories, election rigging, and support for democratic
norms," Res. Politics, vol. 7, no. 3, Jul. 2020, Art. no. 205316802095985, doi:
10.1177/2053168020959859.
[13] S. Shah, Q. Kanchwala, and H. Mi. (2016). Block Chain Voting System. Economist. [Online].
Available: https://www.economist.com/sites/default/files/northeastern.pdf.
[14] D. Chaum, A. Essex, R. Carback, J. Clark, S. Popoveniuc, A. Sherman, and P. Vora, "E-voting
40 scantegrity: End-to-end voter-verifiable optical-scan voting," IEEE Secur. Privacy, vol. 6, no. 3, pp.
40–46, May 2008. Accessed: Feb. 14, 2021. [Online]. Available: https://www.computer.org/security/.
[15] P. McCorry, S. Shahandashti, and F. Hao, "A smart contract for boardroom voting with
maximum voter privacy," in Financial Cryptography and Data Security. Sliema, Malta: Springer, 2017,
pp. 357–375, doi: 10.1007/978-3-319-70972-7_20.
[16] M. Pawlak, A. Poniszewska-Maraśda, and N. Kryvinska, "Towards the intelligent agents for
blockchain e-voting system," Proc. Comput. Sci., vol. 141, pp. 239–246, Jan. 2018, doi:
10.1016/j.procs.2018.10.177.
53