Could WASM be used to build a simple voting system?


I struggled with C++ and Rust looks like a steep learn too - but I am interested in what I might be able to do with Rust-derived WASM.

A WASM voting app would only need some sort of DB back end?

As long as you don't delude yourself into thinking it'll be a safe way to vote*, and as long as you include a server component to tally the votes, then yes it can technically be done.

*It remains to be seen whether a secure voting system can, even in principle, be engineered at all. The current consensus seems to be that it isn't possible.


Are you saying that, as a technologist, that you think that the only safe method of voting is by paper ballots?

It's a whole area of research, but that is a common viewpoint among those familiar, myself included.


Interesting . . I would have guessed that blockchain and other techs would be hopeful options . .

Got a good link for the theory?


I don't have anything off-hand, and I'm on mobile, but feel free to DM me and I'll get back to you later.

Will do!

I'm replying just to back up that affirmation. I'm also of that opinion, and that opinion seems like a common one among people who have had interest in that particular topic. For actual political elections : just use paper. Combined with a better voting model than simple majority like Condorcet or others.

Edit : that xkcd really captures a lot of understanding under a pretense of humor.

Edit 2: requirements for a political voting system would be to be understandable by a not-too-clever 8-10 year old from the first step to the last step without skipping steps, if you can't explain electricity, logic gates, processors, micro-architecture, and not to mention cryptography to them you can't use computers at any conceptual steps. But for a voting/election system not used for public policy, politics, polling, just some internal stuff, you can go wild.


Love it! - another classic . .

As the rest of the replies already indicate, my answer is a firm yes. The xkcd posted above makes the point rather well :grin:

I think the easiest way to explain it is that in order to make elections secure, you need complicated cryptographical methods. This is in direct conflict to the requirement that election systems have to be comprehensible to the people participating in these elections, otherwise they're not safe.

So, there might be a way to do it securely in the cryptography department of a mathematical facility at university, but not outside.


Even if you'd have the perfect blockchain design and implementation there's still the issue of endpoint security, which is a difficult problem to solve.


I know of a case where a corporation won a public procurement deal in which the requirements turned out not to be sufficiently strict, allowing them not to live up to the spirit of the contract. This was for a system which is meant to hold classified data. The corporation implemented external security, and completely ignored internal security. For a system which holds classified information, there are strict requirements on internal security as well. They only solved the "easy" part, because they knew that they couldn't solve the hard parts with the budget they had promised to stay within.

This sort of thing happens when talking to proponents of "blockchain for voting", imho: They tend to only see the blockchains and don't want to touch to problems outside of it, because they are hard problems. Those who are serious about voting systems don't have the luxury of being able to ignore the parts they don't want to solve.

I would recommend reading what Matt Blaze (the guy who brought down the clipper chip) has written on electronic voting systems.


You DO NOT NEED blockchain (as in a decentralized ledger book, not a Merkle chain) for electronic voting. It simply does nothing and anyone who tries to argue otherwise (to my best knowledge) simply tries to ride the hype train. Honestly, I am sick hearing about blockchains in e-voting context.

With voting you have a central authority which controls who can and can not vote, which also organizes and controls a voting process (this authority can be represented by several governmental agencies, but it's not important for the overall architecture). The thing is, without fundamentally changing the "one citizen, one vote" principle, we have to trust this authority for the first role (one possible alternative here is to have voting power to be proportional to a number of blockchain tokens owned by an agent, in this model we do not need any authentication of voting agents, it may work for a corporation, but I highly doubt you want to apply this principle to state elections). We have only a very limited control over it, effectively in the form of comparing number of votes and population. Smaller the scale on which we do this comparison, less anonymity we get (note that anonymity is not a binary property, but a probabilistic one), in the limit we will get a simple public voting. Also we rely on the hope that massive injection of fraudulent IDs is too risky and dangerous for the authority.

Now, we can have more control over the second role and it's where various cryptographic protocols try to improve the current paper-based status quo. But in the inevitable presence of the central authority, blockchains simply do not have any role to play. Yes, we can use Merkle chains (as in git) to give an illusion of immutability, but effectively it does not add anything useful compared to a simple publication of accepted "votes" by the central authority, which are signed by it. And even before that, such chains are not blockchains in my book.

Acceptance of votes also depends on the central authority, not only via the authorization procedure, but also via control of a central registry of accepted votes (after all, you don't want a bunch of correctly signed votes to appear 10 days after election). If the authority has accepted your vote, then in any protocol worth its salt, you can get a cryptographic "receipt" signed by the authority. And if your vote will not appear in the central registry, then using this "receipt" you can prove that the authority has unlawfully interfered with the voting process.

1 Like

This is a fascinating research field but it's getting rather off-topic for this forum. For discussion of general issues around electronic voting, you might want to browse archives of the “voting” category at Princeton University’s Freedom To Tinker blog.

If there are specific questions about building web applications in Rust, let's create new threads for those.