Blockchain Elections: Smart Contract Electoral System Design and Implementation
Total Page:16
File Type:pdf, Size:1020Kb
BLOCKCHAIN ELECTIONS: SMART CONTRACT ELECTORAL SYSTEM DESIGN AND IMPLEMENTATION A Thesis by NATHANIEL PATRICK HERNANDEZ Submitted to the Graduate School Appalachian State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE May 2021 Department of Computer Science BLOCKCHAIN ELECTIONS: SMART CONTRACT ELECTORAL SYSTEM DESIGN AND IMPLEMENTATION A Thesis by NATHANIEL PATRICK HERNANDEZ May 2021 APPROVED BY: Cindy Norris, Ph.D. Chairperson, Thesis Committee E. Frank Barry Member, Thesis Committee R. Mitchell Parry, Ph.D. Member, Thesis Committee Rahman Tashakkori, Ph.D. Member, Thesis Committee Rahman Tashakkori, Ph.D. Chairperson, Department of Computer Science Michael J. McKenzie, Ph.D. Dean, Cratis D. Williams School of Graduate Studies Copyright© Nathaniel Patrick Hernandez 2021 All Rights Reserved Abstract BLOCKCHAIN ELECTIONS: SMART CONTRACT ELECTORAL SYSTEM DESIGN AND IMPLEMENTATION Nathaniel Patrick Hernandez B.S., Appalachian State University M.S., Appalachian State University Chairperson: Cindy Norris, Ph.D. Proponents of Internet-based voting systems suggest that it might offer solutions to alleviate some of the shortcomings previous democratic institutions have fallen vic- tim to: gerrymandering, election fraud, malicious ballot-box zoning, etc. This has become especially relevant as governments and societies wrestle with the COVID-19 pandemic, state-sponsored election interference, and claims of election fraud. How- ever, Internet voting systems are fraught with risks and there is a wealth of research and real-world incidents which demonstrate the plethora of issues one would face in implementing such a system. Voting systems are well-understood to have noto- riously difficult to fulfill requirements, which are often at odds with one another, including security, privacy, and verifiability requirements. The rise in popularity of blockchain-based technologies has renewed interest in such systems, and although it is unlikely that publicly available blockchain-based solutions can meet the re- quirements demanded of large-scale elections, there is potential utility in having iv on-chain electoral systems available for lower-stakes decision-making. This research investigates blockchain-based decision-making through electoral system design and implementation using the Ethereum blockchain and Solidity programming language. This research demonstrates that secure and verifiable small-scale voting systems can be built using “off-the-shelf” blockchain technologies when privacy constraints are loosened. This research further demonstrates that the costs associated with operat- ing such voting systems are steep, likely rendering such systems impractical in most circumstances and therefore an inappropriate foundation for large-scale elections. Fi- nally, this research identifies which electoral systems and features are viable within these blockchain environments and the associated costs of supporting and operating these electoral systems and features. v Acknowledgements I would like to thank first and foremost, my thesis advisor, Dr. Cindy Norris, for the all of the help, encouragement, advice, personal support, and patience she has afforded me throughout this experience. I am sure we both have a few new gray hairs to show for it. I cannot thank you enough. I would also like to thank Dr. James Fenwick for all of the help provided which has enabled me to finish this work. Thank you both for all of the generosity and hospitality you have shown me, I would not have made it if not for both of you and I am forever grateful. To my committee: • Dr. Mitch Parry, thank you for all of your instruction over the years. Your presence has always motivated me to work harder and challenged me to be mindful of the things I am working on. • Frank Barry, you are a fountain of knowledge with more experience than seems possible to contain. I always find your words and our conversations memorable. Thank you as well for everything you have taught me over the years. • Dr. Rahman Tashakkori, words really cannot express enough how much of an influence you have had on my life and how grateful I am to have met you. You have been like a father to me and helped me to grow in more ways than I ever vi imagined I could. I aspire to be as good a person as you one day. Thank you. I would like to thank Google, for providing me with the opportunity to attend the USENIX conference in San Fransisco and meet with significant members of this field. And finally, I would like to offer a huge thank you to the NSF S-STEM scholarship program which made my undergraduate and graduate studies possible at Appalachian State University. vii Contents Abstract . iv Acknowledgements . vi List of Figures . xi List of Tables . xii List of Listings . xiii List of Abbreviations and Symbols . xiv 1 Introduction . 1 1.1 Overview of Materials .......................... 6 2 Background. 9 2.1 Elections .................................. 9 2.1.1 A Taxonomy of Electoral Systems ................ 13 2.1.2 Evaluating Electoral Systems .................. 20 2.2 Blockchain Technologies ......................... 27 2.2.1 Bitcoin ............................... 29 2.2.2 Ethereum ............................. 38 3 Literature Review. 50 3.1 Internet Voting .............................. 50 3.1.1 Survey of Internet Voting Systems ................ 51 3.2 End-to-End Verifiability ......................... 67 3.2.1 Requirements ........................... 67 viii 3.2.2 Architecture ............................ 76 4 Methods . 82 4.1 Requirements ............................... 83 4.1.1 Technical Requirements ..................... 85 4.1.2 Non-Functional Requirements .................. 87 4.2 Assumptions and Objectives ....................... 87 4.3 Tooling ................................... 89 4.3.1 Frameworks ............................ 90 4.4 Architecture and Design ......................... 94 4.4.1 Authorization Components .................... 95 4.4.2 Election Components ....................... 103 4.4.3 Delegation Components ..................... 110 5 Results . 114 5.1 Test Results ................................ 114 5.1.1 Election Components ....................... 116 5.1.2 Authorization Components .................... 126 5.2 Analysis .................................. 127 5.2.1 Requirements ........................... 127 5.2.2 Objectives ............................. 131 6 Conclusion . 133 Bibliography . 138 A Appendix Software Documentation . 147 A.1 Authorization Components ........................ 148 A.1.1 Primitive Contract Ownership .................. 149 A.1.2 Generalizing Contract Access Control .............. 154 A.1.3 Access Control Lists ....................... 160 A.1.4 Registries ............................. 174 A.2 Election Components ........................... 179 A.2.1 Election Contracts ........................ 179 A.3 Delegation Components ......................... 182 A.3.1 Delegation Contracts ....................... 183 ix Vita . 184 x List of Figures 2.1 A chain of linked Bitcoin blocks. [35] .................. 31 2.2 A single Bitcoin block and its internal representation. [35] ....... 32 2.3 A chain of signatures representing an electronic coin. [35] ....... 34 3.1 VOI System Architecture [22] ...................... 54 3.2 SERVE System Architecture [49] ..................... 58 3.3 SERVE Voting Protocol [49] ....................... 59 3.4 DVBM System Architecture [50] ..................... 64 3.5 A specification of the possible variants for an E2E-VIV system. [16] . 77 4.1 The Embark dashboard and application state. ............. 92 4.2 Testing an election contract using the Truffle framework. ....... 94 4.3 Authorization dependency graph modeling. ............... 98 A.1 Authorization dependency graph modeling. ............... 149 A.2 Contract ownership dependency graph modeling. ............ 150 A.3 Generalized contract access control. ................... 155 A.4 Generalized contract access control by way of access control lists. .. 161 A.5 Simplified election registry. ........................ 175 xi List of Tables 2.1 Electoral systems organized by families and characteristics. [39] .... 14 2.2 Electoral Criteria Compliance [44,39,20,31,36] ............. 21 2.2 Electoral Criteria Compliance [44,39,20,31,36] ............. 22 2.3 The contents of a block [2]. ........................ 32 2.4 The contents of a block header [2]. .................... 33 2.5 Ether Denominations [3] ......................... 39 2.6 Fee Schedule [51] ............................. 48 4.1 Requirements targeted for fulfillment. .................. 83 4.1 Requirements targeted for fulfillment. .................. 84 5.1 Simulated gas consumption by contract function. ........... 117 5.1 Simulated gas consumption by contract function. ........... 118 5.2 Requirements targeted for fulfillment. .................. 128 xii List of Listings 4.1 Guard Usage Example .......................... 99 4.2 Delegation Structure ........................... 111 4.3 Vote Delegation .............................. 112 5.1 RangeVoteConfiguration ......................... 122 A.1 contract RestrictTo ............................ 151 A.2 interface Ownership ............................ 152 A.3 contract Owned .............................. 153 A.4 interface Authority ............................ 156 A.5 interface Authorization .......................... 157 A.6 contract Guarded ............................. 158 A.7 interface AccessControlList ........................ 162 A.8 contract BasicACL ...........................