Formally Verified Invariants of Vote Counting Schemes
Total Page:16
File Type:pdf, Size:1020Kb
Formally Verified Invariants of Vote Counting Schemes ∗ Florrie Verity Dirk Pattinson The Australian National University The Australian National University ABSTRACT system is universally verifiable if any member of the general The correctness of ballot counting in electronically held elec- public has means to determine whether all ballots cast have tions is a cornerstone for establishing trust in the final re- been counted correctly. End-to-end verifiability is usually sult. Vote counting protocols in particular can be formally achieved by complex cryptographic methods and generate specified by as systems of rules, where each rule application receipts that voters can use to verify integrity of their bal- represents the effect of a single action in the tallying process lot, without revealing the ballot content. None of the current that progresses the count. We show that this way of formal- voting systems in existence [16, 4, 11, 5] offers universal ver- ising vote counting protocols is also particularly suitable for ifiability of the tallying in elections that rely on complex, (formally) establishing properties of tallying schemes. The preferential voting schemes such as single transferable vote key notion is that of an invariant: properties that transfer used in the majority of elections in Australia. That is, there from premiss to conclusion of all vote counting rules. We is no way for voters or political parties to verify the correct- show that the rule-based formulation of tallying schemes al- ness of the count. lows us to give transparent formal proofs of properties of the This is mediated, for example by the Australian Elec- respective scheme with relative ease. As our proofs are based toral Commission, by publishing both the ballots cast, and on the specification of vote counting protocols, rather than a scrutiny sheets that detail the proceeds of the count, on the program that implements them, we are guaranteed that the web so that individuals (or political parties) can run their property holds for every possible specification-confirming own vote-counting software on the published data. Our ex- implementation of the respective protocol. This in particu- perience indicates that while this is likely to generate the lar includes the vote counting programs that are automati- same election result, it is nearly impossible to generate tal- cally extracted from the specification. We demonstrate this lies that perfectly match those published on the web. The point by means of two examples: the monotonicity criterion reason for this is one of under-specification: the data pub- for majority (first-past-the-post) voting, and the majority lished by the electoral commission is noisy in the sense that criterion for a simple version of single transferable vote. some ballots assign the same preference to more than one candidate, or omit certain preferences altogether and the commission does not specify how votes of this kind are to 1. INTRODUCTION be accounted for. More generally, the specification of the Our trust in traditional paper-based elections largely de- vote counting scheme is usually given in the form of a le- rives from the fact that all stages of the process are wit- gal document which is not always unambiguous, specifically nessed by scrutineers, variously members of the general pub- concerning rare corner cases. lic or delegates nominated by stakeholders that ensure, and The correctness of the implementation of vote counting testify to, proper procedures being followed. In an elec- schemes has therefore been subject to a number of approaches tronic voting context [14], this is replicated by the concept based on formal methods. One generally distinguishes be- of end-to-end verifiability and universal verifiability. End- tween heavy weight and light weight approaches, where the to-end verifiable systems allow the voters to verify that their former involve the use of interactive theorem provers to es- vote has been correctly recorded, not been tampered with tablish mathematical correctness, and the latter rely on au- in (elecctronic) transit to the counting station and has been tomated or semi-automated techniques. In the domain of correctly included in the electronic ballot box. A voting electronic voting, it has been recognised that light-weight approaches are not practical for the task at hand [6, 2] and ∗Coq sources that accompany this paper are available from users.cecs.anu.edu.au/~dpattinson/Software/. heavy-weight methods, i.e. the use of interactive theorem provers, are necessary to give the desired correctness guar- antees. In the context of formal verification, the styles of Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed specifying vote counting schemes vary considerably, and usu- for profit or commercial advantage and that copies bear this notice and the full cita- ally some variant of type theory or higher-order logic is used tion on the first page. Copyrights for components of this work owned by others than to express the desired properties, see e.g. [7]. In contrast to ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re- publish, to post on servers or to redistribute to lists, requires prior specific permission directly encoding vote counting schemes, it has been advo- and/or a fee. Request permissions from [email protected]. cated in [15] that the best way of making the vote counting scheme precise is to give a formal specification by means c 2016 ACM. ISBN 978-1-4503-2138-9. of rules. The rule-based specification of voting protocols DOI: 10.1145/1235 is centred around states of the counting process that may property once counting terminates. We emphasise that we be thought of as photographic snapshots of a (n imagined) do not prove these properties on the basis of having an im- room where counting takes place. More abstractly, a state plementation of a concrete counting scheme (as done e.g. in records all information that are relevant for the counting [9] for plurality voting) but instead are basing our proofs on process at a given point in time. A rule then specifies how a (formal) specification of the scheme. As a consequence, this state may be manipulated by an (imagined) official pro- every implementation that (provably) conforms to the spec- gressing the count. An example of such an action would be ification, including in particular those synthesised from the \take a ballot from the pile of uncounted votes, update the specification itself, can be guaranteed to enjoy this property. tally of the candidate named as first preference, and put In other words: the implementation of vote counting accord- the ballot paper onto the pile of first-preference votes for ing to the FPTP and STV schemes that we have synthesised this candidate". As such, the description of the state invari- from the specification in [15] are automatically guaranteed to ably contains the running tally, a list of uncounted ballot satisfy monotonicity (resp. majority) criterion. papers, and, for every candidate, a list of votes counted in Formal proofs that involve properties of formal specifi- their favour. The count then progresses, in analogy with cations like the two criteria discussed above also serve a the paper-based process, by applying rules that (correctly) function beyond establishing that the criteria in fact hold: manipulate the state of the count, until winners can be de- they provide a basic sanity check of the formal specification. clared. As a consequence, we can understand a (formal) Just as for programs, humans invariably introduce errors specification of a voting scheme as a set of rules that ma- into specifications, rendering the fact that a program imple- nipulate the state of the count. It has been argued in [15] ments a specification virtually useless. Giving formal proofs that this way of specifying voting schemes is both natural that the specification satisfies the expected properties thus and leads to a receipt (the sequence of counting rules lead- increases our trust in the correctness of the specification as ing to the election outcome) that is both precise and can be such. In an area such as electronic voting where we would checked by correctness, i.e. provides a universally verifiable demand that programs conform to formal specification, we receipt of the correctness of the count. see the process of validating specifications as particularly In this paper, we argue that the rule-based approach to important. the specification of voting protocols is also well-suited to es- On a conceptual level, we demonstrate that rule-based tablishing properties of voting protocols specified in this way, specifications can not only capture the specifics of voting and so provides an orthogonal check on the correctness of the protocols in a natural way, but are moreover well-suited to specification. We demonstrate this by re-visiting two pro- their analysis. By giving loose specifications of the protocols tocols, simple plurality voting or first-past-the-post (FPTP) under scrutiny we achieve coverage of more than one variant and a simple version of single transferable vote (STV), both (or implementation) of the scheme. This introduces a very described in detail in Sections 2.1 and 2.2, respectively. In convenient layer of abstraction, as any implementation of a plurality voting, every voter votes for precisely one candi- voting protocol would reasonably be expected to satisfy its date, and the candidate with the highest tally wins. It specification, and our proofs entail that any specification- is known in the literature that this procedure satisfies the conforming implementation will satisfy the criteria under monotonicity criterion: consideration. That is, there is no need to re-establish any criteria that have been established on the level of specifi- If a candidate wins an election, they will still cation, as all implementations (in particular including the win the election if any number of ballot papers one that has been synthesised from the specification) are have been changed in their favour.