• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hääl - Anonymous Electronic Voting System on Public Blockchains

Node.js CI

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. No access control layers implemented in this PoC to avoid overhead, implement it as your needs. All contributions are welcome.

Installation

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

Manual installation (for debugging purposes)

Install and set the correct version of NodeJS.

$ apt-get install node npm
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash 
$ nvm install 8
$ nvm use 8

Download third-party dependencies.

$ curl -o /usr/bin/solc -fL https://github.com/ethereum/solidity/releases/download/v0.4.25/solc-static-linux
$ chmod u+x /usr/bin/solc

Get https://github.com/trufflesuite/ganache/releases/download/v1.2.2/ganache-1.2.2-x86_64.AppImage
$ chmod +x ganache-1.2.2-x86_64.AppImage

Run

$ npm install -Wno-cast-function-type 2> debug.log
$ node ./node_modules/truffle/build/cli.bundled.js build
$ ./ganache-1.2.2-x86_64.AppImage (on a new terminal)
$ node ./node_modules/truffle/build/cli.bundled.js test

Compiler 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,
        ^-----^
[...]

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

Apache License https://www.apache.org/licenses/LICENSE-2.0

More Repositories

1

youtube-clips-automator

MARCELO: an AI powered bot to automate the editing and thumbnail creation for your Youtube clips channel
Python
101
star
2

openxrypt

OpenXrypt: Secure and Private Direct Messaging for Social Media
JavaScript
35
star
3

reels-clips-automator

Reelsfy is an advanced, AI-powered tool that automates the process of creating Instagram Reels from longer videos.
Python
32
star
4

OBS-live-translation

A bot to add a live translation into your live stream in OBS
HTML
29
star
5

bip39-bruteforce

Python
18
star
6

truffle-mercado-pokemon

Exemplo didático de smart-contracts Ethereum utilizando truffle.
JavaScript
17
star
7

nostr-stealth

Built on top of the Nostr protocol, specifically designed to ensure sender and receiver metadata full anonymity. Leveraging the concept of channels (or mixers), Nostr-Stealth ensures that individual messages between users cannot be distinguished or differentiated, thus enhancing user privacy.
JavaScript
8
star
8

twitter-sentiment-analysis

Twitter Sentiment Analysis in pt-BR
PHP
7
star
9

RSA-primes-resolution

Recover a Private Key from a given Public Key using the Right Triangle-based Constant time mathematical solution method.
Python
6
star
10

lmstudio-webpage-summarizer

JavaScript
5
star
11

workshop-1hackathon-BC-2016

Material didático para o Workshop no 1 Hackathon BC - 7-Set-2016
JavaScript
5
star
12

549-personal-dx-blog

A decentralised, unstoppable, privacy-by-design and censor-proof blog.
JavaScript
3
star
13

uEscrow

This is a prototype for an anon and trusty escrow service for trading digital assets, powered by smart-contracts.
HTML
2
star
14

liblinear-php

Liblinear-PHP is a PHP module to interface predicts over PHP. It try to solve predicting over big data, using cloud and Internet.
C++
2
star
15

youtube-transcripts

Download all transcripts from a Youtube channel, prepare a sqlite db to be used on a searxng customized engine (search.eddieoz.com)
Python
2
star
16

bloco

Conteúdo open-source do BLOCO
1
star
17

nostr-blokitos-sats

JavaScript
1
star
18

workshop-rootstock-labitconf2016

Workshop: A DEX and an NFT Marketplace for Pokemon trading - presented on LaBitConf 2016 - Buenos Aires
JavaScript
1
star
19

ethereum-whisper-messenger

Ethereum Whisper Messenger PoC
JavaScript
1
star
20

PhD-HCI-Proposal

PhD proposal for Cultural Influence on Building Trust in Human-Computer Interactions research approved in Tallinn University
1
star