cryptographydesigndeep-diveElecttechnical

How Elect Protects Your Vote: A Complete Walk-Through

Voter.Care Team
·27 July 2026

This article takes you step-by-step through the privacy and integrity techniques that power Elect — Voter.Care's end-to-end verifiable voting system. You don't need a background in cryptography to follow along. Every concept is explained from scratch. But this is a technical article: we go deep on the why at each step, and we name the threats each technique defends against.

The architecture described here maps directly to the Elect product page, where you can explore each layer interactively. A reference diagram is included in the appendix.


1. Enrolment: Proving Who You Are Without a Central Database

The problem

Every voting system must answer one fundamental question: is this person who they claim to be, and are they eligible to vote? Traditional systems answer this by maintaining a central database of voter information — names, addresses, dates of birth, photographs. That database is a honeypot: a single point of failure that, if breached, exposes every enrolled voter.

Elect takes a different approach. Instead of a central database, each voter holds their own identity proof — cryptographically signed, unforgeable, and stored only on their device.

W3C Verifiable Credentials

A Verifiable Credential (VC) is a digital document — issued by someone you trust (the issuer), held by you (the holder), and presented to whoever needs to check it (the verifier). The format is standardised by the W3C (the same body that standardises HTML and the Web Crypto API). Think of it like a digital passport, except the data never leaves your phone unless you choose to share it.

The magic ingredient is a cryptographic signature. The issuer signs the credential with their private key. Anyone with the issuer's public key can verify the signature is authentic — and that the credential hasn't been tampered with — without calling back to the issuer at all.

Threat defended against: A rogue employee or attacker with access to a central voter database can silently edit or delete entries, removing eligible voters or adding fake ones. With VCs, every voter's credential is individually signed. There is no central record to corrupt — and any tampering breaks the signature.

The enrolment flow

sequenceDiagram
    participant V as Voter
    participant O as Identity Officer
    participant W as Voter's Wallet
    participant IS as Elect (Issuer)
    V->>O: Presents identity documents in person
    O->>O: Verifies documents + liveness check
    O->>IS: Requests credential issuance (maker)
    IS->>IS: Second officer approves (checker)
    IS->>W: Issues signed Verifiable Credential
    W->>W: Stores VC in hardware-protected wallet
    Note over W: Private key never leaves device

What's in the credential?

The VC contains only what is needed to establish eligibility: a member or constituency identifier, an expiry date, and a confidence level. Personal details — name, address, date of birth — are encrypted in the wallet and never transmitted to the Elect server.

When the voter presents their credential at vote time, they use BBS+ selective disclosure: they prove specific claims ("I am a registered member of this union") without revealing any other data in the credential. The verifier learns only what they need to know.


2. Maker-Checker Dual Control: No Single Point of Authority

The problem

What stops a corrupt election administrator from issuing a credential to a fake voter? Or revoking a legitimate voter's credential the night before polling opens?

The answer is the same as in banking: dual control. No single person can complete a sensitive action alone.

How it works

Every credential issuance, revocation, and election parameter change requires two separate authorised officers — a maker who initiates the action and a checker who independently reviews and approves it. The system cryptographically enforces this: an action signed by only one officer is rejected.

sequenceDiagram
    participant M as Maker (Officer A)
    participant S as Elect Server
    participant C as Checker (Officer B)
    M->>S: Proposes action (issue VC to voter X)
    S->>S: Action logged, status = pending
    S->>C: Notifies checker
    C->>C: Independently verifies documents
    C->>S: Approves + signs with own private key
    S->>S: Verifies both signatures
    S->>S: Action executed, audit trail written
    Note over S: Audit trail is write-once

The audit trail is write-once. Neither officer can delete or alter the log of their own actions. Any discrepancy — a credential issued without a matching approval, an approval with no corresponding maker request — is immediately detectable.

Threat defended against: Internal fraud. A single compromised administrator cannot unilaterally add ghost voters, revoke legitimate voters, or alter election parameters. Every sensitive operation leaves two digital signatures on a tamper-evident log.


3. Device-Bound Private Key: Your Vote Belongs to Your Device

The problem

A voter's identity is only as secure as the key that signs their credential presentations and ballot submissions. If that key can be copied, an attacker who steals it can impersonate the voter indefinitely.

Secure Enclave

Modern phones contain a dedicated security chip — Apple calls it the Secure Enclave, Android calls it StrongBox. It is physically isolated from the rest of the processor. A private key generated inside the Secure Enclave cannot be extracted — not by any app, not by the operating system, not even by a sophisticated attacker with physical access to the device.

When Elect generates a voter's signing key, it is created inside the Secure Enclave with extractable: false. The key is tied to the device. It cannot be copied. It cannot be backed up. It can only be used by an operation the Secure Enclave permits — and it requires biometric authentication before each use.

flowchart TD
    A["Voter generates keypair\ninside Secure Enclave"] --> B["Public key sent to Elect server"]
    A --> C["Private key stays in enclave\nextractable: false"]
    D["Vote signing request"] --> E{"Biometric\nauthentication"}
    E -->|pass| F["Enclave signs the vote\nKey never leaves chip"]
    E -->|fail| G["Request rejected"]

Threat defended against: Key theft. If an attacker installs malware on the voter's phone, they cannot extract the private key — they can only make signing requests, each of which requires the voter's biometric to succeed. There is no "copy the key to a different device" attack.


4. Distributed Key Generation: Shamir's Secret Sharing

The problem

Every election in Elect is encrypted with a single key. When the election closes, that key is used to decrypt the tally. But who holds the key? If a single person holds it, they become a target — coerced, bribed, or simply careless. If the server holds it, a server breach exposes every vote.

Shamir's Secret Sharing

Shamir's Secret Sharing is an elegant mathematical technique. A secret (the election key) is split into n shares, distributed to n trustees. The key can only be reconstructed if k of those n trustees cooperate — the threshold. Any fewer than k shares reveal nothing whatsoever about the key.

For example: key split into 7 shares, threshold of 5. Any 5 of the 7 trustees can reconstruct the key. A single trustee — or even 4 acting together — gains zero information about the key from their share alone.

flowchart TD
    K["Election key generated at setup"] --> S["Shamir split\nn=7 shares, k=5 threshold"]
    S --> T1["Share 1 → Trustee 1"]
    S --> T2["Share 2 → Trustee 2"]
    S --> T3["Share 3 → Trustee 3"]
    S --> T4["Share 4 → Trustee 4"]
    S --> T5["Share 5 → Trustee 5"]
    S --> T6["Share 6 → Trustee 6"]
    S --> T7["Share 7 → Trustee 7"]
    T1 & T2 & T3 & T4 & T5 --> R["Any 5 shares reconstruct key\non trustee devices only"]

The shares are distributed immediately after setup and never all exist on the server at the same time. The server holds the encrypted votes and split parameters, but never the key.

Threat defended against: Key compromise. Even if the election server is fully breached, the attacker has no key to decrypt the votes. They would need to compromise at least k trustees — each an independent person, likely in different organisations and jurisdictions.


5. Zero-Knowledge Proof of Eligibility: Proving You Belong Without Revealing Who You Are

The problem

Before casting a ballot, the system must verify the voter is eligible. But if the voter sends their credential to the server for verification, the server can link that credential to the subsequent vote — destroying anonymity.

The solution is to prove eligibility without revealing your identity. This sounds impossible. It isn't, thanks to zero-knowledge proofs.

What is a zero-knowledge proof?

A zero-knowledge proof lets you prove a statement is true without revealing any information beyond the truth of the statement itself.

A classic analogy: imagine a circular cave with a locked door in the middle. Alice wants to prove to Bob she knows the door's password — without revealing the password. Bob stands at the entrance. Alice walks in through one side, says the password, and exits the other side. Bob sees the exit — proof she passed through — and learned nothing about the password.

In Elect, the statement is: "I am in the list of eligible voters for this election". The voter proves this without revealing which voter they are.

The Merkle Tree

The server builds a Merkle tree from all eligible voter identifiers. A Merkle tree is a structure where each leaf node is the hash of one voter's identifier, each parent is the hash of its two children, and the root is a single value that commits to the entire voter list.

graph TD
    R["Merkle Root - public"] --> AB["Hash of A and B"]
    R --> CD["Hash of C and D"]
    AB --> A["Hash of Voter A"]
    AB --> B["Hash of Voter B"]
    CD --> C["Hash of Voter C"]
    CD --> D["Hash of Voter D"]

The root is published publicly. Anyone can verify the tree is correct. No individual voter is identifiable from the root alone.

The Merkle path and ZK circuit

At vote time, the server sends the voter their Merkle path — the sibling hashes they need to prove their leaf is in the tree, without revealing which leaf. The voter feeds this path, their identity secret, and the election's parameters into a Semaphore ZK circuit (built with Circom/Groth16 in the Client Layer).

The circuit outputs:

  1. A proof — a short cryptographic object proving the voter holds a valid leaf in the tree
  2. A nullifier hash — a unique value derived from the voter's identity and the election ID, used to prevent double voting (see section 7)

The server verifies the proof against the published Merkle root. Eligibility confirmed — without ever knowing which voter submitted.

sequenceDiagram
    participant V as Voter's Browser
    participant S as Elect Server
    V->>S: Request Merkle path for my identity
    S->>V: Merkle path (sibling hashes)
    Note over V: identity secret + path fed into Circom circuit
    V->>V: Generates ZK proof + nullifier hash
    V->>S: ZK proof, nullifier hash, encrypted ballot
    S->>S: Verify proof against published Merkle root
    S->>S: Confirm nullifier not previously seen
    S->>V: Vote accepted

Threat defended against: Vote-buyer tracking and coercion. A server that can link votes to voters can sell that data or be breached to reveal it. With ZK proofs, the link never existed on the server — it is mathematically impossible to recover.


6. Homomorphic Ballot Encryption: The Server Counts Votes It Cannot Read

The problem

A traditional encrypted ballot system has a fatal flaw: to count the votes, someone must decrypt them. At the moment of decryption, every individual vote is visible. A corrupt counter could delete votes, add fake ones, or miscount. Encryption protects in transit, but collapses at the counting step.

Elect uses a different kind of encryption that sidesteps this entirely: homomorphic encryption.

What is homomorphic encryption?

Homomorphic encryption allows arithmetic to be performed on ciphertexts such that the result, when decrypted, equals the arithmetic performed on the plaintexts.

In plain terms: you can add together encrypted votes without decrypting them, and the sum — still encrypted — is the encrypted total. The server adds ciphertexts. Trustees decrypt only the final sum. No individual vote is ever decrypted.

flowchart LR
    B1["Encrypt(1) - Voter A"] --> ACC["Homomorphic\naccumulation\non server"]
    B2["Encrypt(1) - Voter B"] --> ACC
    B3["Encrypt(0) - Voter C"] --> ACC
    ACC --> ET["Encrypted Total = Encrypt(2)"]
    ET --> DC["Trustees decrypt\nonly the total"]
    DC --> R["Result: 2 votes"]

ElGamal encryption and ElectionGuard

Elect uses the ElGamal scheme (via Microsoft's open-source ElectionGuard library), which is additively homomorphic. A voter encrypts their selection as 0 or 1 for each option. The server accumulates ciphertexts by multiplication (which maps to addition of the underlying values). After the election closes, trustees cooperate to decrypt only the final accumulated ciphertext — revealing the total count, never individual votes.

Range proofs

A malicious voter might try to encrypt 1000 for their favourite candidate. Range proofs prevent this: each ballot submission includes a zero-knowledge proof that every encrypted value is either 0 or 1. The server verifies the proof before accepting the ballot. Individual vote values are not revealed — only the binary constraint is confirmed.

The Benaloh Challenge

After encrypting a ballot, a voter may request a Benaloh Challenge: the system reveals the randomness used to encrypt, allowing the voter (or verification software) to confirm the ciphertext is correctly formed. Once challenged, that ballot is spoiled and a new one must be encrypted. This lets a voter audit the system's honesty — any cheating in the encryption step becomes detectable. The probability of catching a cheating system rises with each challenge.

Threat defended against: Insider ballot manipulation. A fully compromised server cannot see who voted for whom, cannot delete specific votes, and cannot substitute a fraudulent tally. The final decryption reveals only the aggregate — and the homomorphic accumulation is publicly auditable.


7. Vote Submission and the Nullifier Registry

The problem

A voter who can vote multiple times — even if each individual vote is perfectly private — can overwhelm the result. Every voting system needs deduplication. But in a private system, how do you detect that the same voter voted twice, without knowing who voted?

The nullifier

The ZK circuit (section 5) outputs a nullifier hash — a value uniquely derived from the voter's identity secret and the specific election ID:

  • The same voter in the same election always produces the same nullifier
  • A different voter always produces a different nullifier
  • The server cannot reverse the nullifier to recover the voter's identity

The server's Nullifier Registry is a list of nullifiers seen. Before accepting a vote, it checks the registry. If the nullifier is new, the vote is counted and the nullifier is recorded. If the nullifier already exists, it is a re-vote (the coercion resistance mechanism — see section 8).

sequenceDiagram
    participant V as Voter
    participant S as Elect Server
    participant NR as Nullifier Registry
    V->>S: ZK proof, nullifier hash, encrypted ballot
    S->>S: Verify ZK proof
    S->>NR: Is this nullifier new?
    NR-->>S: Yes — first submission
    S->>NR: Record nullifier hash
    S->>S: Add ciphertext to accumulator
    S->>V: Receipt issued

The receipt is a SHA-256 hash of the nullifier and ballot ciphertext — a public audit token the voter can use to confirm their submission appears in the published ballot set, without revealing which vote is theirs.

Threat defended against: Ballot stuffing. Generating fake votes requires a ZK proof for each, which requires a valid Merkle tree leaf. Adding fake leaves changes the Merkle root, which is public and immediately detectable. The nullifier registry catches any attempt to re-submit an existing proof.


8. Coercion Resistance: What Happens When Someone Forces Your Hand

The problem

Cryptographic privacy protects votes from passive eavesdroppers and server breaches. It doesn't protect against a coercer standing next to the voter, saying: "Vote for X, and show me your screen."

Coercion resistance is arguably the hardest problem in electronic voting. Elect addresses it with two complementary mechanisms.

Revoting

In Elect, a voter can cast multiple votes. Only the last vote counts. The nullifier registry is updated to point to the new submission; the old ciphertext is removed from the accumulator.

This means a voter coerced into voting for a particular option can return later — privately, away from the coercer — and change their vote. The coercer's choice is overwritten. The coercer has no way to know this happened: what they observed was a submitted vote, which looked identical to a genuine final submission.

Paper override

For elections where the coercion risk is highest, Elect supports a paper ballot override. A voter who uses the paper route has their digital vote cancelled and replaced with the paper count. The coercer cannot distinguish a digital-then-paper vote from a purely digital one.

flowchart TD
    A["Voter is coerced into wrong choice"] --> B["Vote accepted\nappears final to coercer"]
    B --> C{"Voter returns\nprivately?"}
    C -->|Yes| D["Re-votes for intended choice\nnullifier registry updated\nold ciphertext replaced"]
    C -->|No| E{"Paper ballot\navailable?"}
    E -->|Yes| F["Paper ballot cast\ndigital vote cancelled"]
    E -->|No| G["Original coerced vote stands"]

Threat defended against: Employer or union boss coercion in a workplace setting — the most realistic threat for the trade union elections Elect is designed for. "Vote for the incumbent and show me your phone" is a real attack vector. Revoting neutralises it; paper override provides a last resort.


9. Homomorphic Tally Accumulation: Adding Votes the Server Cannot Read

After voting closes, the Elect server holds thousands — or millions — of encrypted ballot ciphertexts. It must produce a final encrypted tally without ever seeing the individual votes.

The homomorphic accumulation step is mathematically simple. For each election option, the server multiplies all the corresponding ciphertexts together. In ElGamal arithmetic, multiplication of ciphertexts corresponds to addition of the underlying plaintext values. The result is a single ciphertext per option — the encrypted total count.

flowchart LR
    subgraph A ["Option A — 3 votes for, 1 against"]
        A1["E(1)"] & A2["E(0)"] & A3["E(1)"] & A4["E(1)"]
    end
    A1 & A2 & A3 & A4 --> MA["Multiply → E(3)"]
    subgraph B ["Option B — 1 vote for, 3 against"]
        B1["E(0)"] & B2["E(1)"] & B3["E(0)"] & B4["E(0)"]
    end
    B1 & B2 & B3 & B4 --> MB["Multiply → E(1)"]

The accumulation is performed entirely in public — the ballot set and accumulated ciphertexts are published on a public bulletin board. Any observer can verify the accumulation arithmetic is correct without decrypting anything.

Threat defended against: Selective vote deletion. A server that removes all votes for a particular candidate would alter the published ciphertext set — an operation visible to every independent observer running audit software.


10. Threshold Decryption Ceremony: Only the Collective Can Open the Box

This is the final step — and the most consequential. The election has closed, the tally has been accumulated, and the encrypted totals are published. Now the trustees must decrypt them.

The ceremony

Each trustee holds one share of the election key (recall section 4). For decryption:

  1. Trustees are convened — in person or via a secure multi-party protocol
  2. Each trustee uses their share to compute a partial decryption of the accumulated ciphertext
  3. k partial decryptions are combined to produce the final cleartext totals
  4. The private key shares are never combined — only the partial decryptions are aggregated
sequenceDiagram
    participant T1 as Trustee 1
    participant T2 as Trustee 2
    participant T3 as Trustee 3
    participant S as Elect Bulletin Board
    participant V as Independent Verifier
    Note over S: Election closed. Accumulated ciphertexts published.
    S->>T1: Accumulated ciphertexts
    S->>T2: Accumulated ciphertexts
    S->>T3: Accumulated ciphertexts
    T1->>S: Partial decryption + ZK proof of correctness
    T2->>S: Partial decryption + ZK proof of correctness
    T3->>S: Partial decryption + ZK proof of correctness
    Note over S: Combine k=3 partial decryptions
    S->>S: Final tally computed
    S->>V: Publish tally, all ciphertexts, all proofs
    V->>V: Independently verify the complete result

No single trustee, and no combination of fewer than k trustees, can compute the tally. The ceremony requires genuine cooperation. Each trustee's partial decryption includes its own zero-knowledge proof of correctness — a fraudulent partial decryption is immediately detectable.

Independent verification

The final result, along with every ballot ciphertext, all partial decryptions, all ZK proofs, and the Merkle root, is published in a machine-readable format. An independent verifier — a researcher, a rival union faction, a voter who wrote their own verification script — can check:

  • Every ballot has a valid ZK proof of eligibility
  • Every ballot has a valid range proof (values are 0 or 1)
  • The accumulation arithmetic is correct
  • Each partial decryption is correctly formed from a genuine key share
  • The combination of partial decryptions produces the claimed result

No one needs to trust Voter.Care, the trustees, or any particular piece of software. The mathematics is publicly verifiable.

Threat defended against: Result falsification. A compromised server or a coalition of corrupt trustees cannot alter the final result without producing proofs that fail public verification. The system provides end-to-end verifiability — voters can confirm their vote is counted, and anyone can confirm the count is correct.


The Complete Journey

Here is how a vote travels from a person in a union hall to a verified election result:

sequenceDiagram
    participant V as Voter
    participant W as Wallet (Secure Enclave)
    participant C as Client Layer
    participant S as Elect Server
    participant NR as Nullifier Registry
    participant T as Trustees
    Note over V,W: Enrolment (done once)
    V->>W: In-person identity proofing
    W->>W: Generates keypair (Secure Enclave, extractable:false)
    S->>W: Issues signed Verifiable Credential
    Note over V,S: At vote time
    V->>C: Opens ballot in browser
    C->>S: Request Merkle path
    S->>C: 20-hash Merkle path
    C->>C: ZK circuit generates proof and nullifier
    C->>C: ElGamal ballot encryption + range proof
    C->>S: ZK proof, nullifier, encrypted ballot, range proof
    S->>S: Verify ZK proof against Merkle root
    S->>NR: Check and register nullifier
    S->>S: Add ciphertext to accumulator
    S->>V: SHA-256 receipt token
    Note over S,T: After voting closes
    S->>T: Publish accumulated ciphertexts on bulletin board
    T->>S: k partial decryptions with ZK proofs
    S->>S: Combine to final tally
    S->>S: Publish everything for independent verification

Appendix: Architecture Reference

The techniques in this article map to the following layers in the Elect architecture:

Actors — Voter, Vote Organiser, Election Trustee, Independent Verifier, Identity Officer

Client Layer — React + TypeScript (ballot UI), Web Crypto AES-GCM, Snarkjs ZK Prover, ElGamal Ballot Encrypt, BBS+ Credential Presentation, VC Wallet Bridge

Tech Application Layer — FastAPI REST API, Nullifier Registry, Homomorphic Accumulator, Public Bulletin Board

Cryptographic Services — AES-GCM (W3C), ElectionGuard, Circom / Groth16, BBS+ Signature Library, Shamir SSS, W3C VC / DID SDK

Data Layer — PostgreSQL (ballots, nullifiers, election parameters), Redis (session cache)

Visit the Elect product page for an interactive architecture diagram showing which components are live today and which are in development.


Some components described here are live today in the Poll product (Web Crypto AES-GCM encryption, Nullifier Registry, FastAPI, PostgreSQL). The ElectionGuard, Semaphore/Circom, SSS, and VC components are in development. The Elect product page indicates live status for each component.