Skip to content
Hääl - Anonymous Electronic Voting System on Public Blockchains
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contracts correcting smart-contracts path because of debian Mar 16, 2019
migrations correcting smart-contracts path because of debian Mar 16, 2019
src touching the smart contracts for verifying proofs and more Jan 8, 2019
test correcting smart-contracts path because of debian Mar 16, 2019
whitepaper moved whitepaper Feb 25, 2019
zksnarks/circuits
.gitignore Added yarn.lock Feb 25, 2019
LICENSE
README.md
package.json Added ganache-cli Feb 25, 2019
truffle-config.js version pre-push Feb 20, 2019
truffle.js update solc version Feb 25, 2019
yarn.lock

README.md

Hääl

Anonymous Electronic Voting System on Public Blockchains

Hääl means voice in Estonian. Voice means power of people.

This code is a proof-of-concept of the protocol presented on the whitepaper located at the root folder. It describes a full process for an e-voting system, using public blockchains and without a mixnet or an oracle for tallying the votes.

The full protocol makes use of:

  • Zero-knowledge proofs (with zk-snarks verified on-chain)
  • Homomorphic encryption (Paillier protocol + zk)
  • Stealth addresses (as proposed by Peter Todd, but ported to ethereum)
  • Encrypted notes (e.g Zcash, AZTEC)
  • Cryptography challenges (based on Sigma protocol)
  • Digital signatures
  • Ethereum (or another blockchain capable of running dApps)
  • other technologies described on the whitepaper

Working in progress. All contributions are welcome.

Pre-requisites

  • ganache-cli ^6.3.0 or Ganache ^1.2.2
  • Node 8
  • Solidity ^0.4.5
  • Yarn ^1.13.0

Setup

# yarn install && yarn truffle build && yarn ganache-cli

Run

(on a new terminal)
# yarn truffle test

optionally, you can build and run with npm and node

# npm install -Wno-cast-function-type 2> debug.log
# node ./node_modules/truffle/build/cli.bundled.js build
Run ganache (or ganache-cli)
# node ./node_modules/truffle/build/cli.bundled.js test

Compile warnings

Is expected to receive the warning below during contracts compilation:

haal/contracts/HAAL/haal.sol:2:1: Warning: Experimental features are turned on. Do not use experimental features on live deployments.
pragma experimental ABIEncoderV2;
^-------------------------------^

That message appears because we're using an experimental method to fill arrays (bytes[]):

function addVote(
        bytes[] _president, 
        bytes[] _senator, 
        bytes[] _stateGovernor,
        ^-----^
[...]

and

function getVotes(uint _index) view public returns(bytes[], bytes[], bytes[])
                                                   ^-----------------------^

Apache License

You can’t perform that action at this time.