Specification for verifying a vote · Scrutalis

Specification for verifying a vote

Version 1 of 28 November 2026, export format “scrutalis-ballot-box-v1”. This page describes, for anyone who wants to write their own tool, how to verify a counted Scrutalis vote from its public data alone, without any secret or any personal data (ANSSI R66). Each check below is performed identically by Scrutalis when counting, and in each voter’s browser by the “Check the count” button.

1. What the verification proves

A tool that complies with this specification establishes, for each answer to each question: that each encrypted ballot contains 0 or 1 vote (disjunctive Chaum-Pedersen proof); that the published encrypted total is exactly the product of all these ballots; and that the published number of votes really is the decryption of this total, each guardian present having proved their part of the decryption without revealing it. No secret is needed: no key, no guardian share, no encryption nonce.

What it does not prove: the rule “at most one answer per question” is checked by the server when each ballot is cast, but the export stores ballots answer by answer, sorted by value, so that the answers of the same voter cannot be linked together; a third party can therefore only check a global consequence of it (step 5). The presence of a given ballot is checked separately, with its vote code, on the vote’s “Check my vote” page.

2. Where to get the data

The ballot box export (JSON file) is downloaded, once the vote has been counted, by the vote’s team from its space and by each guardian from their “Check the vote” link; each download is recorded in the vote’s log. The same content is sealed in the vote’s closing archive (file urne.json). A voter obtains, with their voting link, the encrypted totals, the results and the partial decryptions, without the ballots: they can carry out steps 3 and 4.

3. Group, encodings and hash function

The group is that of the ElectionGuard 2.0 standard parameters (ElectionGuard Design Specification 2.0.0, §3.1.1): p is the 4,096-bit prime of that specification, q = 2^256 − 189, and g = 2^((p − 1) / q) mod p generates the subgroup of order q. A group element is valid if 1 ≤ x < p and x^q mod p = 1; any invalid element makes the verification fail.

In the export, each element (less than p) and each exponent (less than q) is written in hexadecimal, in lower case, without leading zeros.

The hash function is H(He ; e1, e2, …) = HMAC-SHA-256 with the election fingerprint He as key (32 bytes, field extendedBaseHash) and as message the concatenation of the encodings of the elements: a separator on 1 byte; an integer (guardian index) on 4 bytes big-endian; a group element on 512 bytes big-endian; an exponent on 32 bytes big-endian. The 32 bytes obtained, read as a big-endian integer, are reduced modulo q.

4. Encryption of a vote and election key

Each ballot contains, for each answer, an exponential ElGamal ciphertext (α, β) = (g^ξ, K^(ξ + m)) mod p, where m is 1 if the answer is chosen and 0 otherwise, ξ is the encryption nonce and K the guardians’ joint public key (field jointPublicKey). A blank vote is an encryption of 0 for each answer: each answer to a question therefore receives a ciphertext from every ballot.

Each guardian j publishes their commitments K_j,0 … K_j,k−1 (field guardians, coefficientCommitments, k being the quorum). First check: K = Π_j K_j,0 mod p.

5. Step 1: each ballot contains 0 or 1 vote

For each ciphertext (α, β) (fields pad and data of an element of ballots) and its proof (field proof: two pairs challenge c_j, response v_j, for j = 0 then j = 1): check that α and β are valid elements; compute, for j = 0 and 1, a_j = g^(v_j) · α^(c_j) mod p and b_j = K^((v_j − j · c_j) mod q) · β^(c_j) mod p; compute c = H(He ; 0x21, K, α, β, a_0, b_0, a_1, b_1); the proof is valid if (c_0 + c_1) mod q = c.

6. Step 2: the encrypted total is the product of the ballots

For each answer, the encrypted total (field encryptedTally) must equal the component-wise product of all its ballots: A = Π α mod p and B = Π β mod p (with no ballot, A = B = 1). Ballots are given sorted by value: the order in which they were cast is not published.

7. Step 3: each decryption share is proved

For each partial decryption (field decryption: guardianIndex i, share M_i, challenge c, response v): compute the guardian’s share key K_i = Π_j Π_t K_j,t^(i^t mod q) mod p, for all guardians j and t = 0 … k − 1; check that M_i is a valid element; compute a = g^v · K_i^c mod p and b = A^v · M_i^c mod p; the proof is valid if c = H(He ; 0x30, i, K_i, A, B, a, b, M_i).

The indices of the guardians present must be distinct, belong to the list of guardians, and be at least as many as the quorum (field quorum).

8. Step 4: the published result is the decryption of the total

Let S be the set of indices of the guardians present. For each i in S, the Lagrange coefficient is λ_i = Π_(j ∈ S, j ≠ i) j / (j − i) mod q, division being multiplication by the inverse modulo q. The published result t (field result, a non-negative integer) is correct if and only if B = (Π_(i ∈ S) M_i^(λ_i)) · K^t mod p.

9. Step 5: consistency between the answers to a question

All answers to the same question must have the same number of ballots, equal to the number of voters published with the result, and the sum of their results must not exceed that number (the difference corresponds to blank votes).

10. Export format

JSON object: format (“scrutalis-ballot-box-v1”); referendum (public identifier of the vote); exportedAt (date of the export); jointPublicKey (K); extendedBaseHash (He); quorum (k); guardians (list of guardianIndex and coefficientCommitments); questions (list of question, text and answers). Each answer carries: answer (public identifier), label, encryptedTally (pad A, data B), result (t), decryption (list of partial decryptions: guardianIndex, share, challenge, response) and ballots (list of pad, data, proof). A vote counted before decryption proofs were published has no partial decryptions (empty decryption list): steps 1, 2 and 5 remain verifiable, not steps 3 and 4.

11. Expected result and reporting

A vote is verified if all steps succeed for all answers. A failure, even on a single ballot, means that the export has been altered or that the count is wrong: report it to the vote’s organiser and to Scrutalis (Contact page). The code of Scrutalis’s implementation is available on request.