Select Page

In this post we describe a high-level design for a voting system resulting from combining two protocols, ipfs and nMix. Ipfs is, from wikipedia:

InterPlanetary File System (IPFS) is a protocol designed to create a permanent and decentralized method of storing and sharing files. It is a content-addressable, peer-to-peer hypermedia distribution protocol.

We also have nMix, which is:

A backend for a mixnet-based, cryptographically secure voting system. nMix is based on the univote specification, developed by the e-voting group at the Bern University of Applied Sciences.

The current implementation of nMix uses git as the backbone of the bulletin board, which is a central component of any secure voting system. The main idea in this design is simply to replace git with ipfs. Because nMix has been designed following a data-centric reactive protocol, the voting crypto workflow is decoupled from the bulletin board implementation. Any implementation which satisfies the nMix bulletin board interface can be plugged in, modulo performance and efficiency considerations.

The result of this combination is a voting system that offers the privacy and verifiability guarantees of the nMix protocol together with the decentralization and immutability characteristics of ipfs. Of course, this high level design and needs to be validated with a proof of concept implementation.

Voting System Components

Below, all the components behave as nodes with respect to ipfs. In particular they all have public keys whose hash gives the node’s peerID. The corresponding private keys are used to publish, update and sign information. Data is updated using the ipns api, producing hash-chains for all stages of updated information[1]. Components that need to talk to each other must be aware of their respective public keys and peerIDs. Because the nMix protocol is data-driven and reactive, components talk by reacting to published information, they do not initiate requests or invocations against each other. This simplifies deployments, that are therefore easier to secure.

Registry

This component handles the authentication and registration of voters. This design is agnostic with respect to authentication mechanism. We simply assume that there exists some secure authentication method by which voters register for a vote. The Registry is responsible for the electoral roll, which is simply the list of ipfs public keys that are authorized to participate in a vote. Just like any other piece of data, the electoral roll is published in ipfs, by the Registry.

Voting Client

The Voting Client encodes voter choices and encrypts the resulting ballots. These ballots are published onto ipfs with the voter’s public key. After a vote is published, the voting client must asynchronously check for the receipt of the ballot on the ballot list. This ballot list is published by the Ballotbox. Voting clients may be run in browsers if ipfs node implementations (or node clients) are available in javascript. Updating ballots is possible, again with ipns.

Ballotbox

The Ballotbox collects votes published by Voting Clients. To do this it resolves peerID’s present in the electoral roll, published by the Registry. It also performs validation on the collected ballots, for example, cryptographic checks on the well formedness of each. The Ballotbox publishes the list of accepted ballots, as well as those that are faulty. This allows notifying the Voting Client of any errors, asynchronously. Once the voting period is over, the ballot list is frozen, ready to be collected by the Bulletin Board.

Bulletin Board

The Bulletin Board maintains the list of information artifacts necessary for the execution of the cryptographic protocol. This includes artifacts related to joint key generation, ballot casting, ballot mixes, and joint decryption, as well as all required mathematical proofs. The Bulletin Board information is maintained by collecting data published and updated by the Ballotbox and Trustees. The trustees in turn retrieve the bulletin board information to execute their part of the protocol. This is done reactively as per the nMix design.

Trustees

Trustees cooperate to execute the voting protocol such that its privacy and verifiability properties are guaranteed. These properties are inherited from the nMix design, which in turn is based on the univote specification. Trustees are custodians of the private keys that safeguard vote secrecy. When executing the protocol, Trustees retrieve information published and collected by the Bulletin Board.

Example artifacts

A few dummy examples of key artifacts that are published and retrieved during the voting process. The random strings represent ipfs hashes.

Electoral Roll
{
"voterIds":
["c59qvpkffp8kqex9", 
"e5htt6j3dw5rhgpy", 
"9vnwulzor64jovwm", 
"w0ysl1exxuydh6jc", 
"qaw28kvuz3o2lzze", 
"00fcrcgyavur7kms", 
"r28heu46pg06n4mp", 
"wrr2m066wej0t394", 
"9nqb3j50jjfec6tt", 
"1pefhwg8u56cvmc7"] 
}

The electoral is simply a list of public key hashes which serve as peerID’s. The bulletin board can retrieve the ballots using the published electoral roll.

Ballot

{
"issue_date":"07/04/2017",
"choices":[
{"alpha":"39919858721616153390121207740700184075477677110291887739439782241337108707850600593897335517877969269363714726532399584056680271194600202899271776149741412527527740142151089660336200449020264421675163180800290976346106759420582980477463333811015910331466124341430408524246498617159198767801363624230109831989050277102463936726359218355339447942673234984251755824732534044453470371158571735665029759137651972724589638640750546644740500907596134236276711951891873826615956404009880288704224078835562856078277599298755044020429353604485245479455942757510277145795626674383087736347620895018173435956987006487303749907903",
"beta":"40125146889062323054303773216347293157402925898916081676958308259638923657828391551315727847349703197492124610063191935448675500586804263349768384900237485556590105982139987398237831826966729516695238087249416295142365848277576555825449404805601979599511978416245327700429870857531078140582332900911530840262151652183324356402048471614144917434799939331780267948504457061922150654233760749512322837403027586972659605999187858799225230816581557799213953809840735899379571603277608966879996380744626241860711174276869545040255538068348410853377014874150226648009679032746476806854812281472882847280982624328465304618027"},
{"alpha":"18828440853798019905940194926535700795676239698495135694632176814815305220986749035730650140162564964230565932147671220073571195430381382347724582766998885771716077874201708030511064239908750070421709491216989519724635937485890101489715950288809829523159811539263139324402496209641551073626765751160741392445363055278318392388466047789294658243659332518048846626477448123742974980435313680289198164997955885132941648028685950037618174735128226850835262720970884507554983628712385722714623117687190299642208019302046622001264407181566012993217618707235771273147079238877360402969208513519248072878285744623700906747474",
"beta":"8009041134044323102122429881003259821395223499607264115428876890373888997371048261696030768212247797647814680157513482066555632928516048179009538278605725206446197881359828052384423517450410232725742826289177480208502718187491625741794214235525943934990112123318547222013355896037512315942806904432201586695327290997293191175038834820049839241042602502658191275933093576006738656487969022301510599919180793935815449970108414288074970025543344825539669455955820385769632845099786371611812091366411935777123196136429958468131721873152898048117176173132314139144118351901790322037046274375031358466306836613730049245716"}
],
"proofs":[
{"challenge":"101645555569875529565996271471373875959472274523498505145983003790219096285849",
"commitment":"752522959335361400753015371891533599058826568085677640070783974169659524749316503578568806609969531474739999391012948166790871099486856617529875000992301268154404277104112658870009920671373821399625231308720781447021814839306145347728727273106731713357381164103661706407900377422418935851604223197476097060940425837271919340867464366768819869279958482970843539355898024536107393689698867301711647796652221248728945743863204081907754323636327758715822311918557536329899813298991856932030519546234945637108212446279453328813916691199198134091371588028617428299383879206083144128969016775881271883874842448427938910754",
"response":"16679239020752616208204594577685811471910081855462848720812989022713959775768854087657980848323498503160866521220515327864223117183558597214449380881548766495580835852430472123617705721431042503810066343992731560733643290397144207755257431824844736144161899377214306452534177908844034825829706481210476036584726481047464952839501538392722055315816688526489104304583572379958012453826285546950225485797889189716275450573516237159164684149696586762080638568879249614246789401926981988150091799319303781538993724667379614719311823411788903305101315771479460337166865538795148953974003438561232620017444538753741505806978"},
{"challenge":"32019705883975027253276183901415545785905568328981238374894257948971926302585",
"commitment":"14948948722820149911137994507457521023332798621269863101480149659406658687864829294816015183242512527444269519072780289258580652639475594733125314087025290629684226058448403749931954118851074380198105638347172383734975226632689842860108637202294223494592677042522185987855440757644139417035353448536502838694939160667396235780429112641151085377230589726288357891732820161914942499717278762962348170777354967270025149276965440362412233683525838298907338182136911860960761995592229815811817367003670099877941693428428653291947725044745863593633784475131780179420925064703777420475986822874353342635078868604539125713884",
"response":"4862071019920502430654333148253056677056326185459016611243278295477045260536509924574875175661235714562645495056872500329781750564406023583407693394386575363001876588294873893298054249783648802060766072571354351293685326814107700211178190327440611202984516923219589098081071990790768143220657879378565302072638900345186053544250966852230489512182218965345202913706205343874292309738848770061128263107135859441662791361865349064025765205299104105154620037592358953993075277543384943191848204883952321755172720276659038974628769573917733770441117101128357239823548284084716789838386371633976634858578765335987118694154"}
]
}

This is an ElGamal encrypted ballot with associated proofs of plaintext knowledge. Ballots are encrypted to protect voter privacy.

Ballot List

{
"c59qvpkffp8kqex9": "wutr35h1lbjyhlx7",
"e5htt6j3dw5rhgpy": "INVALID",
"9vnwulzor64jovwm": "em3zuwvy5tzpcxxy",
"w0ysl1exxuydh6jc": "cucostqjq9n9av9y",
"qaw28kvuz3o2lzze": "3kawkgy14m0ysysh",
"00fcrcgyavur7kms": "b5lo4zjyyuqmazr6",
"r28heu46pg06n4mp": "",
"wrr2m066wej0t394": "c054crvfcv2s5s99",
"9nqb3j50jjfec6tt": "vwg68hcn5yr0asoe",
"1pefhwg8u56cvmc7”: "1muv4qf8x85lyyr6"
}

The ballot list is maintained by the Ballotbox, collecting and validating votes cast by Vote Clients.

Bulletin board

{
  "config": "cbu8cgw1wnf490f9",
  "configSig": "5rfv1d2j4ae5abqo",
  "1": {
    "1": {
      "share": "0hx27vzaqpzy5d76",
      "shareSig": "xjcmrxvs3kkehion",
      "publicKey": "kpza6j3ku57zxua0",
      "publicKeySig": "ktkjqanwq9v073qw",
      "mix": "gcgkbvtlovqhbwa6",
      "mix1Sig": "7hgtaxdscsgz4y27",
      "mix2Sig": "u2ttuft7pkvr5ggc",
      "decryption": "s4mio5lsyrrpd8xm",
      "decryptionSig": "g805zdo0yh6jp3gg",
      "plaintexts": "29r2dl28ud8c2f4i",
      "plaintextsSig": "8khgkx6ca7r4aic4"
    }
  },
  "2": {
    "1": {
      "share": "80hgx9w2e45mm0d9",
      "shareSig": "j5rdzygjrjgzusrm",
      "publicKeySig": "nj6inceb5n2z21w0",
      "mix": "fzr5iuoqgveml957",
      "mix1Sig": "ogi8x08fdq0exyk9",
      "mix2Sig": "oz92902ja8tbm28j",
      "decryption": "aqi9t163nq4f6dfx",
      "decryptionSig": "xeae3j7i3zkzlu0m",
      "plaintextsSig": "7xyx9ux46k9ayq70"
    }
  },
  "bb": {
    "1": {
      "ballots": "dgmj9cno0tphfqk3",
      "ballotsSig": "ptvdkcqyb159eekn",
    }
  }
}

The bulletin board keeps track of all the files necessary to execute the crypto protocol. These files are published by different agents: the (two) trustees use numbered namespaces, “1” and “2”. The Ballotbox uses ‘bb’, which holds the collected ballots published by individual voters. All published information is signed.

What about blockchains/Tahoe-Lafs/Swarm?

If you’re familiar with blockchains you’ve probably noticed that some of the properties achieved with ipfs are shared with blockchains. Indeed, you could probably take this design and substitute a blockchain in place of ipfs provided it had the correct storage and lookup functionalities. Some of these properties are already present with the git implementation used in nMix, for example auditability and tamper resistance. Adding ipfs or a blockchain is an extra step. See here for more on the potential benefits of blockchains for voting. Note also that this design does not require distributed consensus, the nodes responsible for publishing information artifacts are the authoritative source. This is one of the key differences between using ipfs versus a blockchain as a bulletin board.

Open source

The design described here could be implemented fully in open source, as both ipfs and nMix code fall under that class of license. Go to it!


References

[1] This may have to be implemented manually, or will exist when ipns includes it, as mentioned here:

In the future, we may have ipns entries work as a git commit chain, with each successive entry pointing back in time to other values.