Voting using blockchain and smart contracts

Sam Kelly
The Startup
Published in
8 min readJun 13, 2019

The Issue with Current Voting Systems

Voting has always been a complex procedure, in which immense levels of trust are placed in the hands of a small number of powerful individuals. As long as democracy has existed voting has been centralised, over time people’s trust in the system has been eroding, which has led to an apathetic view from voters in many different cultures. In Economically developing countries such as many African nations, as well as some from Asia and South America, government actions surrounding voting are often dubious at best. A new way of implementing voting could see huge improvements to quality of life for residents and fairer outcomes for all — Nigeria is a prime example of such a nation that would benefit from improved voting systems.

An oft-overlooked aspect of elections are the tremendous associated costs. An Australian federal election took place in 2017 which cost a total of 227 million AUD, or 15 AUD per person1. In Britain the cost of a general election per person works out to be £8.66, amounting to approximately £482 million of tax payers money2. Almost half a billion pounds spent in the U.K. on elections is a staggering sum of money that quite simply needs to be reduced. One main cause for the huge cost of current voting systems is due to the way in which votes are counted. Tallying votes is a tremendously inefficient process that relies upon humans, manually counting ballot papers to decide which party or candidate has secured the most votes. It almost seems absurd with the technology currently at our disposal that votes are still counted such a way. Manual counting is not only open to significant levels of human error but is also clearly an easy target for those with malicious intent. In addition, counting is exceptionally slow, as multiple checks must be made to ensure as few errors as possible are made. Digital systems have been around for years that are capable of tallying votes in real time giving an immediate result which is much more likely to be error free. Clearly, we are at a stage where governments are looking to overhaul these archaic processes.

The proposed solution using blockchain

Advances in technology

As with most aspects of the 21stcentury we look for digital solutions to these aforementioned problems. Electronic online voting has been piloted in several countries such as the UAE, the Philippines and Australia, but these experiments revealed that more research and development is required to improve security, confidentiality, integrity and validity of votes. Blockchain is able to address all of these issues, therefore it is unsurprising that several groups around the world are looking into succinct solutions using a distributed ledger, predominantly based on the Ethereum blockchain. One such group from RMIT University, Melbourne believes they have developed the first self-tallying voting system using a smart contract deployed on Ethereum3. Other efforts have been made to incorporate blockchain technology, using it as a public bulletin board to store the vote data, FollowMyVote4and TIVI5are just two examples of such voting systems. Both FollowMyVote and TIVI achieve voter privacy, but still require that votes be counted externally from the blockchain and are as such not the most efficient use of the technology. The most significant result from their paper, is that the time taken to tally and reveal votes has been reduced from many hours to a matter of seconds3. While this technology has shown great promise in terms of transparency and voter privacy, they admit that further work is required for the technology to be employed in real elections.

A team at MIT Have also developed what they call a “decentralised personal data management system” which directly permits secret online voting6. The technology, which was originally proposed back in 2015, is an excellent framework that ensures the protection of individual’s data (an example of a secret contract designed for voting can be found on their blog page). This year has seen Enigma grow into its own network, after receiving $45 million from over 5000 contributors7. However, Enigma are still very much in the development stage and are yet to be fully deployed in any significant setting.

Horizon State

Whilst the technology discussed above has great potential, an Australian start-up company called Horizon state appear to be making the most significant headway into changing the way we vote. The company deliver a secure digital ballot box, that would be near impossible to hack. Votes are cast transparently and so can be tallied in real time by anyone in the world. Due to the immutable and irreversible nature of the blockchain, the votes remain present and are able to be tallied whenever it is necessary and as many times as required. Despite the fact that voter privacy is maintained Horizon State also manage to permit individuals to verify that their vote has been successfully cast while maintaining their anonymity. The use of Smart contracts gives greater functionality to the voting system, wherein people are able rank a set of candidates as opposed to simply voting in a binary way. Arguably, the greatest selling point is their ability to reduce the cost of voting by more than an order of magnitude. According to their white paper, the Horizon state system can cost as little as 0.5 AUD per voter,

Although the contracts are not able to be viewed, the technology clearly shows the greatest promise of its kind. Several different countries have employed the voting platform in real world settings in various ways. Indonesia, New Zealand and South Australia have all conducted elections, albeit on a relatively small scales, using the Horizon State platform. It appears that the added security provided from the benefits of blockchain could eventually see global adoption for the technology.

The role of Proof of Trust

As discussed above, both blockchain and smart contracts have critically important roles to play in the improvement of electronic voting systems. It is, however, well documented that smart contracts alone can be fraught with bugs, negating any of the added security that their use was designed to provide. Professional auditing company Hoshohave reviewed smart contracts that have amounted to $1 bn in transactions. They claim that 60% of contracts have at least one security issue, and that 1 in 4 have bugs that would prove critical9. Proof of Trust stands to dramatically improve the odds in favour of correct contract execution. Even in the worst-case scenario, in which it is assumed that each of the Delegates and Superdelegates have the same 25% error rate, the chance of invalid contract execution falls from 1 in 4 to less than 1 in 1000. It should be noted that the numbers discussed in this section are a worst-case scenario. In reality we would hope that all those employed to design the smart contract and those elected to be Delegates and SuperDelegates have an error rate closer to 5% or less, in this case we reduce the probability of invalid contract execution from 1 in 20 to less than 1 in half a billion.

There are several publicly available smart contracts already designed to facilitate a voting system, albeit only ever tested on a small scale. One such example of a smart contract10, was developed my Mahesh Murthy — founder of blockchain developer website Zastrin.com, and can be accessed here. In a series of tutorials, Murthy describes in detail how a smart contract can be designed to permit voting, whilst incrementing the vote count for a particular candidate. This neat contract looks well designed and secure, but it has certainly not been tested for bugs and scaled to any great extent. Methods to improve security must be imposed, with the PoT protocol serving as a great assurance measure. PoT Delegates with extensive relevant coding knowledge would act as independent arbitrators on the smart contract. The validity of the contract can be determined by each member of the Delegate and SuperDelegate pools independently. Only after a verdict is given from each of the Delegates and subsequent SuperDelegates may the contract be deployed onto the blockchain. Within a voting system this process would occur before voting takes place, such that any incurred delay would have no direct impact upon the election itself. Furthermore, the Delegates should be chosen from a trusted independent body, with no direct connection to the vote itself and no connection to one another (or no means of discussing their outcomes). It would be entirely possible to outsource the role of delegation to a professional body of people who were well suited to the task, this is perhaps an avenue for future thought. Provided all the above conditions are met, the highest probability of creating a powerful, bug-free smart contract will be achieved.

Finally, to a ensure the smart contract is ready to be deployed within a given time frame, restrictions can be placed on the Delegates in terms of reduced rewards for exceeding a given deliberation period, which would also serve to limit potential interaction between Delegates. The PoT auditing process will happen before the voting commences, such that the impact on the speed of casting and tallying votes will be negligible.

Conclusion

Current voting systems, like many aspects of industrial and governmental processes, is heavily outdated. Blockchain is a clear and obvious solution to many of the problems with the way we currently vote. The immutability, and transparency allows for voter anonymity while making it exceptionally difficult for any individuals or groups to illegally leverage control of an election. The low gas cost and added automation of the entire process reduces associated costs and increases tally speed. The use of smart contracts adds greater functionality and permits more voting options. Yet as is always the case, where smart contracts are present, there is still the vulnerability that they may be laden with bugs and this would destroy the security and integrity of the vote. In future, a PoT layer could be added such that any government or industry wishing to employ a secure voting system could have a thorough security check of the contract, before the contract is deployed. In this way, once voting commences the added security layer would not significantly slow down the overall process as the contract would have been verified before the voting begins.

References

1. (n.d.). Election could cost $227 million: Election Watch — Australia 2016. Retrieved September 3, 2017, from http://electionwatch.unimelb. edu.au/australia-2016/articles/2016-federal-election-to-cost-$227-million.

2. (2009, October 27). 25_ECE rev — UNSD — the United Nations. Retrieved September 3, 2017, from http://unstats.un.org/unsd/censuskb20/ Attachment459.aspx?AttachmentType=1

3. Yang X., Yi X., Nepal S., Han F. (2018) Decentralized Voting: A Self-tallying Voting System Using a Smart Contract on the Ethereum Blockchain. In: Hacid H., Cellary W., Wang H., Paik HY., Zhou R. (eds) Web Information Systems Engineering — WISE 2018. WISE 2018. Lecture Notes in Computer Science, vol 11233. Springer, Cham.

4. Followmyvote.com. Introducing a secure and transparent online voting solution for the modern age: Follow My Vote (2016). https://followmyvote.com/ .

5. Business Wire. Now you can vote online with a selfie. Business Wire (2016). http:// www.businesswire.com/news/home/20161017005354/en/Vote- Online- Selfie .

6. Zyskind, Guy & Mohamed Seifeddine Zekrifa, Djabeur & Alex, Pentland & Nathan, Oz. (2015). Decentralizing Privacy: Using Blockchain to Protect Personal Data. IEEE. 180–184.

7. Palepu, Aditya. “Secret Voting: An Update & Code Walkthrough.” Enigma, 9 Nov. 2018, blog.enigma.co/secret-voting-an-update-code-walkthrough-605e8635e725.

8. Project, Enigma. “2019: The Year of Enigma.” Enigma, Enigma, 10 Jan. 2019, blog.enigma.co/2019-the-year-of-enigma-cef8d10366a1.

9. Sedgwick, Kai. “25% Of All Smart Contracts Contain Critical Bugs.” Bitcoin News, 29 Aug. 2018, news.bitcoin.com/25-of-all-smart-contracts-contain-critical-bugs/.

10. Murthy, Mahesh. “Full Stack Hello World Voting Ethereum Dapp Tutorial — Part 1.” Medium, Medium, 18 Jan. 2017, medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1–40d2d0d807c2.

--

--

Sam Kelly
The Startup

I have a keen interest in blockchain and smart contract technology. I love to show how these technologies will reshape the global economy