VoteUp is a decentralized voting platform built on the Ethereum blockchain that supports end-to-end verifiable elections. It ensures transparency, integrity, and voter privacy through a commit-reveal voting scheme. The system supports role-based permissions (admin, voters, candidates), on-chain result validation, and real-time frontend interactions β all in a trustless, decentralized environment.
Watch the full demo on YouTube:
Click the thumbnail above or watch it here
- Features
- Tech Stack
- Architecture
- Smart Contract Overview
- Installation and Running Locally
- Usage Flow
- Commit-Reveal Voting Explained
- Benefits
- File Structure
- Contributing
- License
- Contact
-
πΏ Candidate & Voter Registration Users can request registration; election admins must approve to ensure legitimacy.
-
π End-to-End Verifiable Voting Uses a commit-reveal scheme to keep votes private and later verifiable.
-
π§ Election Lifecycle Management Admins can create elections, approve users, start/end elections, and fetch results.
-
π Responsive React Frontend Built with React, Tailwind, and Framer Motion for smooth UX.
-
β‘ Real-Time Feedback Users get live election updates, success/failure toasts, countdowns, and more.
-
βοΈ Automatic Smart Contract Deployment Each election triggers a fresh contract deployment on Sepolia via
ethers.js.
| Layer | Tools / Frameworks |
|---|---|
| Frontend | React 18, TypeScript, Vite, Tailwind CSS, Framer Motion, React Router DOM |
| Blockchain | Solidity, Ethereum (Sepolia), Ethers.js |
| Tooling | Foundry (smart contract testing), Dexie.js (IndexedDB), Canvas Confetti, XLSX |
| Web3 | MetaMask, Wallet API via Ethers.js |
Browser UI (React + Tailwind + Framer)
|
|---> Web3 Provider (MetaMask)
|
|---> Web3Context & Contract Utility Layer (ethers.js)
|
Smart Contract Layer (Solidity on Sepolia)
|
|---> Voting.sol (deployed per election)
- Frontend: Fully interactive UI for elections, voting, results, and admin actions.
- Contract Deployment: Done dynamically from the frontend using a deploy function in
contract.ts. - Storage: Temporary frontend state stored using IndexedDB (
dexie). - Interaction: Ethers.js handles commitVote, revealVote, and other contract interactions.
File: contracts/Voting.sol
| Function | Description |
|---|---|
createElection() |
Deploys new election contract |
requestCandidateRegistration() |
Candidate applies for a role |
requestVoterRegistration() |
Voter applies for a role |
approveCandidate() |
Admin approves candidates |
approveVoter() |
Admin approves voters |
commitVote(bytes32 hash) |
Voter commits a hashed vote (hash of candidateId + salt) |
revealVote(candidateId, salt) |
Reveals original vote during reveal phase |
getResults() |
Returns election results after reveal period ends |
git clone https://github.com/Het2239/VoteUp.git
cd VoteUpnpm installnpm run devNavigate to: http://localhost:3000
π You do not need to manually deploy contracts. The app auto-deploys a new smart contract to Sepolia testnet whenever a new election is created. The actual port/URL may vary; check your terminal after starting the server.
- Admin creates an election via frontend.
- Contract is deployed to Sepolia dynamically.
- Users apply via the frontend.
- Admin views pending requests and approves them on-chain.
- Voter casts a hash of
(candidateId + salt)usingcommitVote.
- Voter reveals original
(candidateId, salt)usingrevealVote. - Contract verifies:
keccak256(candidateId + salt) === committedHash.
-
After reveal deadline, results are computed and displayed.
-
Frontend shows:
- π Winner(s) (with tie handling)
- π Vote breakdown
- β Reveal status per voter
What is Commit-Reveal Voting?
Commit-reveal is a two-phase voting scheme:
- Commit Phase: Voters submit a hashed version of their vote (typically
hash(vote + secret)), committing to their choice without revealing it. - Reveal Phase: Voters later disclose their vote and secret. The system verifies that the original hash matches.
This ensures:
- Privacy: Votes remain hidden during the election.
- Verifiability: Everyone can later verify each vote.
- Fairness: No early reveals influence others.
- Votes are hidden during the commit phase.
- Prevents vote buying or coercion since votes arenβt visible.
- Each voter can verify their vote via their hash.
- Anyone can audit if results match committed and revealed votes.
- Elections arenβt controlled by a central authority.
- Contracts enforce rules in a censorship-resistant way.
- All votes are revealed at the same time, or none.
- Prevents influencing voters based on early disclosures.
| Aspect | Contribution of Commit-Reveal Voting |
|---|---|
| Immutability | Contracts can't be modified post-deployment |
| Vote Secrecy | Hash prevents early knowledge |
| Integrity | Reveal must match prior commitment |
| Double Voting | Tracked per voter address |
| Transparency | All logic is on-chain and inspectable |
- Gas-efficient: only a hash is stored during commit.
- Minimal on-chain data usage.
- No need to store full vote data on-chain.
β οΈ Requires users to interact twice (commit + reveal)
-
Deterministic: Results are final once reveals are done.
-
Robust: Cannot be taken down or altered.
-
Graceful Failure Handling:
- Votes not revealed can be skipped.
- Reveal reminders and auto-enforced deadlines can help.
| Feature | Traditional Voting | VoteUp (Commit-Reveal) |
|---|---|---|
| Transparency | Low | High |
| Tamper-proof | No | Yes |
| Privacy | Medium | Strong (commit phase) |
| Cost | High | Low (post-deployment) |
| Accessibility | Limited | Global (Web3 wallet) |
| End-to-End Verifiability | No | Yes |
VoteUp delivers a secure, decentralized, and verifiable voting experience through commit-reveal logic.
| Property | Strength |
|---|---|
| Security | β β β β |
| Efficiency | β β β |
| Reliability | β β β β |
| Privacy | β β β β |
| Transparency | β β β β |
Itβs ideal for:
- DAOs
- Campus/University elections
- Local and community decision-making
VoteUp/
βββ contracts/ # Voting.sol smart contract
βββ src/
β βββ components/ # UI components (Cards, Modals, Voting UI)
β βββ contexts/ # Web3 & Theme context
β βββ utils/ # Ethers interaction, deployment, vote logic
β βββ App.tsx # Root React component
β βββ main.tsx # Entry point
β βββ index.css # Global styles
βββ public/
βββ index.html # Base HTML
βββ tailwind.config.js
βββ vite.config.ts
βββ tsconfig.json
βββ package.json
βββ README.md
We welcome contributions from the community! If you'd like to contribute:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Submit a pull request with a clear description.
Whether it's bug fixes, feature additions, or documentation updates β all contributions are appreciated.
This project is licensed under the MIT License. See LICENSE for more details.
Created with β€οΈ by Het Chavadiya
- π§ Email: hetchavadiya@gmail.com
- π©βπ» LinkedIn: linkedin.com/in/hetchavadiya
- π GitHub: @Het2239
If you use this project or find it helpful, feel free to β the repo!
