0% found this document useful (0 votes)
34 views11 pages

BT Mini Project Report

Uploaded by

Shubham Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views11 pages

BT Mini Project Report

Uploaded by

Shubham Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Abstract

Blockchain technology presents a promising solution to many of the challenges faced by


traditional voting systems, such as lack of transparency, security concerns, and
inefficiencies. This project focuses on the development of a decentralized e-voting
platform using the Ethereum blockchain. The platform leverages the Ethereum Virtual
Machine (EVM) to deploy smart contracts that securely handle the voting process,
ensuring that votes are immutable and publicly verifiable. The project is deployed on the
Volta testnet using the Hardhat framework, with smart contracts written in Solidity to
govern election logic, including vote casting and tallying. The front end is built using
React, and Ether.js is used to integrate the user interface with the blockchain, allowing
seamless interaction between voters and smart contracts. This report highlights the
architecture of the e-voting system, discusses the advantages and disadvantages of
blockchain-based voting, and demonstrates the potential of blockchain technology to
provide secure, transparent, and efficient election processes. Despite certain limitations
like scalability and gas fees, this project showcases the potential of decentralized voting
systems to improve democratic processes.
Contents
01. Introduction
02. Software and Hardware Requirements
03. System Architecture
04. Advantages and disadvantages
05. Conclusion
06. References
07. Result
Chapter 1

Introduction
Blockchain technology has revolutionized the way secure, transparent, and
decentralized applications are built. In recent years, its adoption in various
industries, including finance, healthcare, and governance, has shown
promising results. One of the critical areas where blockchain can bring a
transformative impact is voting systems. Traditional voting mechanisms are
prone to challenges such as vote manipulation, lack of transparency, and
inefficiency. To address these issues, this project explores the development
of a secure, decentralized, and transparent e-voting system using
blockchain technology.

The system utilizes Ethereum’s decentralized blockchain to store votes and


ensure their immutability, transparency, and accessibility. The project is
deployed using the Hardhat framework on the Volta network, an Ethereum
testnet, with smart contracts written in Solidity. The frontend interface is
developed using React and connected to the blockchain through the
Ether.js library. This allows for seamless interaction between the user
interface and the smart contract backend, providing a robust, secure
e-voting platform.
Chapter 2

Software and Hardware Requirements


Software Requirements:
● Hardhat Framework: Used for smart contract development and
deployment.
● Solidity: Ethereum-compatible programming language for writing the logic
of the voting system.
● Ether.js Library: Integration of the frontend with the blockchain for
interacting with smart contracts.
● React: Frontend framework for building the user interface of the e-voting
platform.
● Node.js and npm: For backend functionality and package management.
● Metamask: A browser extension for managing Ethereum accounts and
transactions.
● Volta Network: Ethereum-compatible testnet for contract deployment and
testing.

Hardware Requirements:
● Minimum Hardware for Development:
○ Processor: Intel i5 or equivalent
○ RAM: 8GB
○ Storage: 256GB SSD
○ Internet connection for blockchain access and testnet deployment.
● For Node Operation:
○ Ethereum nodes can be deployed on servers with similar
specifications or cloud services such as AWS or Digital Ocean to
ensure reliable uptime for transaction processing.
Chapter 3
System Architecture
The e-voting platform follows a decentralized architecture built on blockchain
technology. The main components of the system are:

1. Frontend (React + Ether.js): The user interface allows voters to register, view
the list of candidates, and cast votes. Ether.js connects the frontend with the
blockchain by enabling interaction with smart contracts.
2. Smart Contract (Solidity): The core logic of the e-voting system is written in
Solidity. The smart contract handles the election process, including registering
candidates, casting votes, and recording vote counts in a secure, immutable
manner.
3. Blockchain (Volta Network): All voting transactions are recorded on the Volta
testnet blockchain. This ensures the transparency and integrity of the voting
process, as each vote is publicly verifiable but anonymous.
4. Ethereum Virtual Machine (EVM): The Ethereum Virtual Machine executes
smart contracts, ensuring that the logic of the e-voting system runs securely and
efficiently on the blockchain.
5. Metamask: Metamask is used by voters to interact with the Ethereum
blockchain, allowing them to sign transactions and cast votes through the
decentralized application.

Figure 3.1 System Architecture


Chapter 4

Advantages and Disadvantages

Advantages:
● Security and Immutability:
Blockchain’s decentralized nature ensures that votes are securely recorded and
cannot be altered after submission, protecting against vote tampering.
● Transparency:
All transactions (votes) on the blockchain are publicly verifiable, ensuring
transparency in the voting process.
● Anonymity:
Although votes are recorded on the blockchain, the voter’s identity remains
anonymous, safeguarding voter privacy.
● Decentralization:
The system does not rely on a central authority, which minimizes the risk of
central points of failure or manipulation.
● Efficiency:
With smart contracts automating the voting process, results can be processed
and verified faster than traditional voting systems.

Disadvantages:
● Scalability Issues:
Ethereum’s current infrastructure, especially on testnets like Volta, may not
handle a large number of transactions efficiently, leading to potential delays in
vote processing.
● Gas Fees:
Transaction costs (gas fees) on the Ethereum network can vary, especially during
network congestion, which might be a barrier for mass adoption.
● Technical Barrier for Voters:
Voters must have basic knowledge of blockchain wallets (like Metamask) to
participate, which could limit accessibility.
● Regulatory Challenges:
Legal frameworks surrounding the use of blockchain in voting are still evolving,
and implementing blockchain-based voting systems might face regulatory
hurdles in various jurisdictions.
Chapter 5

Conclusion
The blockchain-based e-voting platform offers a secure, transparent, and
decentralized solution to the challenges faced by traditional voting systems.
By utilizing the Ethereum blockchain and smart contracts, this project
ensures that votes are recorded and counted in a tamper-proof manner.
Despite some disadvantages such as scalability and gas fees, the
advantages in terms of security, transparency, and efficiency make
blockchain an appealing option for the future of voting systems. The project
demonstrates the potential of blockchain technology to revolutionize the
democratic process by enabling trustless, decentralized elections.

Chapter 6

References
1. Zhao, Z., Li, Q., & He, W. (2019). "Blockchain-based electronic voting:
System design and evaluation." IEEE Transactions on Dependable and
Secure Computing.
2. Dhillon, V., Metcalf, D., & Hooper, M. (2020). Blockchain Enabled
Applications: Understand the Blockchain Ecosystem and How to Make It
Work for You. Apress.
3. Li, H., & Wang, W. (2018). "Decentralized voting: Blockchain-based
electronic voting protocol." International Journal of Distributed Systems
and Technologies.
4. Zhu, L., Li, X., & Zhang, C. (2021). "Efficient blockchain-based secure
e-voting platform with auditability." Future Generation Computer Systems.
5. Kshetri, N., & Voas, J. (2018). "Blockchain-enabled e-voting." IEEE Software,
35(4), 95-99.
6. Yavuz, E. A., Koç, Z., & Çabuk, U. C. (2021). "Towards secure e-voting using
Ethereum blockchain." Journal of Information Security and Applications, 58,
102748.
Chapter 7
Result
Code
Smart Contracts Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Voting {
struct Candidate {
string name;
uint256 voteCount;
}
Candidate[] public candidates;
address owner;
mapping(address => bool) public voters;

uint256 public votingStart;


uint256 public votingEnd;

constructor(string[] memory _candidateNames, uint256 _durationInMinutes) {


for (uint256 i = 0; i < _candidateNames.length; i++) {
candidates.push(Candidate({
name: _candidateNames[i],
voteCount: 0
}));
}
owner = msg.sender;
votingStart = block.timestamp;
votingEnd = block.timestamp + (_durationInMinutes * 1 minutes);
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function addCandidate(string memory _name) public onlyOwner {
candidates.push(Candidate({
name: _name,
voteCount: 0
}));
}
function vote(uint256 _candidateIndex) public {
require(!voters[msg.sender], "You have already voted.");
require(_candidateIndex < candidates.length, "Invalid candidate
index.");
candidates[_candidateIndex].voteCount++;
voters[msg.sender] = true;
}
function getAllVotesOfCandiates() public view returns (Candidate[]
memory){
return candidates;
}
function getVotingStatus() public view returns (bool) {
return (block.timestamp >= votingStart && block.timestamp <
votingEnd);
}
function getRemainingTime() public view returns (uint256) {
require(block.timestamp >= votingStart, "Voting has not started
yet.");
if (block.timestamp >= votingEnd) {
return 0;
}
return votingEnd - block.timestamp;
}
}

Screenshots
Login(Connect to Metamask)
Click Next to Connect to Metamask

After Voting Status


Voting by different Voter

You might also like