Skip to content

Ckayz/iota-voting-system

Repository files navigation

IOTA Decentralized Voting System

A production-ready decentralized voting system built on IOTA Layer 1, using Move smart contracts, IOTA Identity for verifiable credentials, and IOTA Notarization for vote anchoring.

System Architecture

The system consists of three main components:

  1. Move Smart Contracts: Handle voting logic on IOTA Layer 1
  2. Backend Server: Manages identity verification and vote notarization
  3. Frontend UI: Provides user interface for registration, verification, and voting

Key Features

  • Secure voter registration with verifiable credentials using IOTA Identity
  • Identity verification using IOTA Identity framework
  • Anonymous voting with one-vote-per-identity enforcement
  • Vote notarization on the IOTA Tangle for public audit
  • Real-time results dashboard
  • District-based voting support
  • Wallet integration for credential management and vote signing

Prerequisites

  • Node.js (v16+)
  • IOTA Move CLI (for smart contract compilation and deployment)
  • IOTA CLI (for Tangle interaction)
  • Rust (for IOTA SDK compilation)

Installation

1. Install IOTA Move CLI

# Install Rust if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install IOTA Move CLI
cargo install iota-move-cli

2. Clone the repository

git clone https://github.com/yourusername/iota-voting-system.git
cd iota-voting-system

3. Install backend dependencies

cd backend
npm install

4. Install frontend dependencies

cd ../frontend
npm install

Smart Contract Deployment

1. Compile and deploy the Move smart contract

cd ../contracts
./deploy.sh

This script will:

  1. Compile the Move smart contract
  2. Generate a new account if needed
  3. Request funds from the faucet
  4. Deploy the contract to the IOTA testnet
  5. Initialize the voting system with candidates and districts

2. Update the contract address

After deployment, the contract address will be saved to contract_address.txt. Update the backend .env file with this address:

cd ../backend
echo "IOTA_MOVE_CONTRACT_ADDRESS=$(cat ../contracts/contract_address.txt)" >> .env

Running the Application

1. Start the backend server

cd ../backend
npm start

2. Start the frontend development server

cd ../frontend
npm start

3. Open your browser and navigate to http://localhost:3000

Troubleshooting

If you encounter any issues with the application, try the following:

  1. Clear browser cache and cookies:

    • This can resolve issues with localStorage and large request headers
  2. Restart both frontend and backend servers:

    • Sometimes a clean restart can fix connection issues
  3. Check port conflicts:

    • Make sure ports 3000 (frontend) and 3001/3002 (backend) are not in use by other applications
  4. Verify environment variables:

    • Ensure all required environment variables are set correctly in the .env files

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors