Professional Blockchain Voting Platform with Anonymous Authentication and Zero-Knowledge Privacy
This project is organized as a professional modular monorepo with three distinct, focused modules:
evoting-lsag-v2/
├── blockchain/ # Smart contracts, deployment, and blockchain infrastructure
├── voter-portal/ # Voter interface and participation tools
├── government-portal/ # Administrator dashboard and election management
├── docs/ # Centralized documentation hub
├── shared/ # Common utilities and types
└── README.md # This file
- Zero Server Architecture - Only voter's machine + blockchain smart contract
- Anonymous Voting - LSAG (Linkable Spontaneous Anonymous Group) signatures
- Cryptographic Privacy - No vote content stored on blockchain
- Modular Design - Clean separation of concerns
- Developer Experience - Professional tooling and documentation
- Node.js 18+ and npm
- MetaMask wallet extension
- Git for version control
git clone <repository-url>
cd evoting-lsag-v2cd blockchain
npm install
npx hardhat compile# Deploy Secp256k1 library first
npx hardhat run scripts/deploy/deploy-secp256k1.js --network iitbh
# Deploy main EVoting contract
npx hardhat ignition deploy ignition/modules/Evoting.ts --network iitbhcd government-portal
npm install
npm run dev
# Access: http://localhost:3000cd voter-portal
npm install
npm run dev
# Access: http://localhost:3001Location: blockchain/
Purpose: Smart contract infrastructure, deployment, and blockchain utilities
Key Components:
- Solidity Contracts - Core voting logic with LSAG verification
- Deployment Scripts - Automated contract deployment
- Monitoring Tools - Election status and transaction checking
- Configuration - Network settings and contract addresses
Documentation: blockchain/README.md
Location: voter-portal/
Purpose: Complete voter experience from registration to vote casting
Key Features:
- Key Generation - Secure cryptographic keypair creation
- Certificate Upload - Government-signed voter authentication
- LSAG Registration - Anonymous registration with ring signatures
- Vote Casting - Private vote generation and submission
- Vote Tallying - Collaborative result computation
Documentation: voter-portal/README.md
Location: government-portal/
Purpose: Election administration and voter certificate management
Key Features:
- Voter Certification - Generate cryptographically signed certificates
- Election Management - Full lifecycle election control
- Ring Management - Voter ring construction and verification
- Result Monitoring - Real-time election status dashboard
Documentation: government-portal/README.md
Location: docs/
Purpose: Centralized, comprehensive project documentation
Structure:
- Architecture - System design and module interactions
- Protocol - LSAG signature scheme and voting protocol
- Guides - Step-by-step user and developer guides
- Implementation - Technical implementation details
- API Reference - Smart contract and frontend APIs
Location: shared/
Purpose: Common utilities to avoid code duplication
Contents:
- Types - TypeScript interfaces and type definitions
- Constants - Shared configuration and constants
- Utils - Cross-module utility functions
- Deploy smart contracts using blockchain module
- Generate government authority keypair
- Launch government portal for administration
- Voters generate cryptographic keypairs
- Government issues signed voter certificates
- Voters upload certificates to blockchain (ring formation)
- Voters generate LSAG signatures for anonymous registration
- Generate anonymous votes with LSAG proofs
- Submit encrypted vote hashes to blockchain
- Store vote data locally for later tallying
- Voters reveal vote data for verification
- Blockchain verifies vote integrity
- Results computed and announced transparently
# Install all dependencies
npm run install:all
# Build blockchain module
npm run build:blockchain
# Build voter portal
npm run build:voter
# Build government portal
npm run build:gov
# Start development servers
npm run dev:voter
npm run dev:govBlockchain Module:
cd blockchain
npm run compile # Compile contracts
npm run deploy # Deploy to network
npm run test # Run contract tests
npm run verify # Verify on explorerFrontend Modules:
cd voter-portal # or government-portal
npm run dev # Start development server
npm run build # Production build
npm run lint # Code linting
npm run type-check # TypeScript validationBlockchain Module (.env):
PRIVATE_KEY=0x... # Deployment wallet
IITBH_RPC_URL=http://10.10.0.61:8550 # Network RPCPortal Modules (.env.local):
NEXT_PUBLIC_CONTRACT_ADDRESS=0x... # EVoting contract
NEXT_PUBLIC_RPC_URL=http://10.10.0.61:8550 # Blockchain RPC
NEXT_PUBLIC_CHAIN_ID=1337 # Network chain ID - Network: Private IITBH Blockchain
- RPC Endpoint:
http://10.10.0.61:8550 - Chain ID:
1337 - Contract:
0xED8CAB8a931A4C0489ad3E3FB5BdEA84f74fD23E
| Resource | Description | Link |
|---|---|---|
| System Architecture | High-level design overview | docs/architecture/system-overview.md |
| LSAG Protocol | Cryptographic signature scheme | docs/protocol/lsag-signature-scheme.md |
| Deployment Guide | Complete setup instructions | docs/guides/deployment-guide.md |
| Voter Guide | How to participate in elections | docs/guides/voter-guide.md |
| Admin Guide | Election administration | docs/guides/admin-guide.md |
| Smart Contract API | Contract interface reference | docs/api/smart-contract-api.md |
| Legacy README | Original documentation | docs/LEGACY_README.md |
- Identify the appropriate module (
blockchain/,voter-portal/,government-portal/) - Implement feature following module conventions
- Update module-specific README if needed
- Update root README if architecture changes
- Place reusable utilities in
shared/directory - Update TypeScript types in
shared/types/ - Document shared functions thoroughly
- Create feature branch:
git checkout -b feature/description - Implement changes in appropriate modules
- Test thoroughly across affected modules
- Update documentation as needed
- Submit pull request with clear description
- Private Keys - Never commit to version control
- LSAG Signatures - Quantum-resistant elliptic curve cryptography
- Vote Privacy - Only hashes stored on blockchain, full votes stored locally
- Private Blockchain - Controlled network environment
- Contract Verification - All smart contracts auditable
- Frontend Validation - Client-side cryptographic verification
- Environment Variables - Sensitive data in
.envfiles (gitignored) - Certificate Signing - Government authority key protection
- Vote Storage - Local storage for vote privacy
| Metric | Value |
|---|---|
| Modules | 3 (blockchain, voter-portal, government-portal) |
| Smart Contracts | 4 (Evoting, Secp256k1, ECOperations, MessageHashUtils) |
| Documentation Files | 15+ comprehensive guides |
| Supported Networks | IITBH Private Blockchain |
| Frontend Framework | Next.js 16+ with React 19 |
| Blockchain Framework | Hardhat with OpenZeppelin |
Contract Deployment Fails
cd blockchain
npm run compile
# Check network connection and private keyFrontend Build Errors
cd voter-portal # or government-portal
rm -rf .next node_modules
npm install
npm run buildMetaMask Connection Issues
- Ensure MetaMask is installed and unlocked
- Add IITBH network manually:
- RPC:
http://10.10.0.61:8550 - Chain ID:
1337
- RPC:
- Import deployment wallet if needed
- Issues: GitHub Issues for bug reports
- Documentation: Comprehensive guides in
docs/ - Code Examples: Working examples in each module
- Legacy Documentation:
docs/LEGACY_README.md
This project is developed for research and educational purposes. Please refer to the LICENSE file for detailed terms and conditions.
- LSAG Cryptography - Implementation based on academic research
- Elliptic Curve Operations - Optimized for blockchain efficiency
- Hardhat Framework - Professional Ethereum development tooling
- Next.js Framework - Modern React development platform
Built for transparent, private, and secure digital democracy