E-Voting on a blockchain using smart contracts


Project maintained by noamgot Hosted on GitHub Pages — Theme by mattgraham

Introduction

This is a final project done in the course “Introduction to Cryptographic Currencies” in the Hebrew University of Jerusalem. The project was done together with Gili Lior.

In this project we designed and implemented an e-voting system which is based on a dedicated blockchain, and using an Ethereum smart contract. The system is simulated via a python script that connects to a local Etherum blockchain running using Ganache. The smart contract was written in Solidity.

Here’s a presentation describing the protocol and the general design choices we’ve made:

A more detailed paper about this work can be found here.

About this demo

This demo contains 3 basic scenarios:

Installation

In order to run this project, use python 3.7 (although probably most python 3.x version will work as well). You also must have Ganace installed on your machine. No matter which operating system you use, make sure that:

These 2 demands can be changed with corresponding changes in the code:

In order to make sure that you have all the needed packages, create a new virtual environment, and install the packages in the relevenat reuirements_*.txt file:

# choose either windows or linux
pip install requirements/requirements_<windows/linux>.txt

Usage

Windows

Launch a new local blockchain using Ganache (we used Ganache GUI). In windows, the default listening port is 7545, so you probably don’t need to change anything. Then, simply run one of the main*.py, e.g:

python main.py

and watch the output

Linux

In a separate shell, launch a new local blockchain using Ganache:

module load ganache-cli
ganache-cli -a 100 -p 7545

Notice that we use 100 accounts (-a 100) and are listenting on port 7545 (-p 7545) as stated earlier.

Then, in a different shell, simply run one of the main*.py, e.g:

python main.py

and watch the output

License

MIT

About the Authors