Git Product home page Git Product logo

go-astris's Introduction

Astris e-voting

This is a proof of concept software implementation of the Astris e-voting scheme, designed for a minimal trust voting platform as part of an MSc project.

Uses github.com/ncw/gmp for large integer support. To build you will need libgmp-dev or equivalent.

Performance

We need the performance to be reasonable such that this could be used for a large scale election. I simulated a 5 trustee, 1 million voter election. The ballots were cast randomly (hence the fairly even spread of votes). Then the auditor mode of the election validates the entire chain to ensure the cryptographic integrity of the data and computes the result. This was performed on an Intel i7-8550U clocked at 4.000GHz. The CPU has 4 cores (8 threads) but there has been no effort to parallelize any operations, so it is effectively bound by single core performance.

$ ./run.sh auditor validate --data-dir=sim --election-id=AAB6zJrFJZK_Bx0aWhxQDsp7-jSj2swiewTWk-m5ikk
make: 'build/astris' is up to date.
11:40:19.001 INF Astris Voting license=GPLv3+ protocol=1.0 version=v0.0.0
11:40:19.002 INF Starting Election Auditor Process
11:45:52.546 INF Chain reverse pass complete, starting forward validation pass1_ms=321513.684706
2000015 / 2000015 [-----------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 93 p/s
17:42:25.635 INF Chain forward pass complete pass2_ms=21393092.132859 total_ms=21714605.817565
17:42:25.636 INF Blockchain Validation Success chain=AAB6zJrFJZK_Bx0aWhxQDsp7-jSj2swiewTWk-m5ikk depth=2000015 head=LHw6TS0DreYljVpvQf7n1vJsxdMA0x2SOSKSBB8m568 ms=21714605.817565
{
  "NumVoters": 1000000,
  "VoterTurnout": 1000000,
  "NumRepeatVotes": 0,
  "TalliesSubmitted": 5,
  "TalliesRequired": 3,
  "Results": [
    {
      "Candidate": "C1",
      "Count": 199597
    },
    {
      "Candidate": "C2",
      "Count": 199497
    },
    {
      "Candidate": "C3",
      "Count": 199759
    },
    {
      "Candidate": "C4",
      "Count": 200484
    },
    {
      "Candidate": "C5",
      "Count": 199684
    }
  ]
}

The full validation pass took ~21,715,000ms (just over 6 hours - the first time I did this it was closer to 10hours, but then I switched out the Go "math/big" BigInt for a wrapper around the GNU GMP library and performance increased significantly). There has been little optimisation and everything runs serially, so further improvement is certainly possible. This should scale fairly linearly with respect to voters, as vote registration/ballot blocks outnumber all others massively. In this example we have 2,000,015 blocks and 15 are not voter blocks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.