Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eddieoz/haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
https://github.com/eddieoz/haal
blockchain blockchains dapp digital-signatures e-voting electronic-voting ethereum ganache homomorphic-encryption proof protocol smart-contracts stealth-wallets votes voting-system whitepaper zero-knowledge-proofs zk-snarks
Last synced: 3 months ago
JSON representation
Hääl - Anonymous Electronic Voting System on Public Blockchains
- Host: GitHub
- URL: https://github.com/eddieoz/haal
- Owner: eddieoz
- License: apache-2.0
- Created: 2019-01-05T15:40:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T13:45:31.000Z (about 2 years ago)
- Last Synced: 2024-10-24T21:32:04.698Z (3 months ago)
- Topics: blockchain, blockchains, dapp, digital-signatures, e-voting, electronic-voting, ethereum, ganache, homomorphic-encryption, proof, protocol, smart-contracts, stealth-wallets, votes, voting-system, whitepaper, zero-knowledge-proofs, zk-snarks
- Language: JavaScript
- Homepage:
- Size: 1.42 MB
- Stars: 107
- Watchers: 16
- Forks: 17
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Node.js CI](https://github.com/eddieoz/haal/workflows/Node.js%20CI/badge.svg?branch=master)
# Hääl
# Anonymous Electronic Voting System on Public BlockchainsHää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 whitepaperWorking 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/solcGet 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](https://www.apache.org/licenses/LICENSE-2.0)