ipfs / notes

IPFS Collaborative Notebook for Research
MIT License
401 stars 30 forks source link

Voting and consensus on IPFS #98

Open jbshirk opened 8 years ago

jbshirk commented 8 years ago

The purpose of this entry is to document ideas on voting and consensus via a static website, and hopefully, collect some projects moving in that direction. There a bajillion articles on the subject that maybe someone post here. I am simply going to explain at a basic level what little I know for interested parties who may not even be familiar with IPFS by giving a little overview of the state-of-the-art. Corrections and contributions are welcome.

I was asked: "Can a static website hosted on IPFS handle voting?" Basically it would be handled by plugins to handle voting via another site or server. Examples: PayPal button; GoogleMaps; Disqus comments. These are services handled cross-domain by other servers.

In the above cases, they are just a small snippet of html code embedded in your site, whether it is static or hosted on a server. Facebook, twitter, Wikipedia handle likes, comments, discussions on their own sites, in their own database servers.

Static sites can already integrate Disqus comments by having their pages registered at Disqus and this is built into Hugo websites that can easily be hosted on IPFS. But most people understand that these databases are not private, and can be hacked, leaked, or altered. There is no guarantee that Disqus comments could not be censored. There is also no guarantee that comments are not made by fictitious accounts operated by government-intelligence sock-puppets, trolls, etcetera. The CIA has at least once actually bragged that they have operatives in every news agency that matters, and that there is a vast army of disinformants in their employ.

So a more fundamental problem of voting has always been a question of authenticating identity. How to prevent from someone from voting more than once under different identities? Governments have attempted to solve this by having official employees verify a person's ID and voter registration. They do this with bureaucracy and dividing up regions into precincts. People are required to vote at their designated precinct and show their ID, and voter registration card as "proof" of their address. It's not really bullet-proof, as after my wallet was stolen, I was able to recreate a complete set of credentials on the basis of one fancy piece of paper in a single day - and the voter registration card was the easiest - had for the asking.

Of course there are other problems.

One is: can we trust the electronic voting machines not to be manipulated behind the scenes? The answer is NO WAY! The code for those machines is proprietary, and actually, secret. No one knows what they are programmed to do. No one knows what happens to the data they produce and there have been famous scandals where it was obvious that some elections (Texas and Ohio) were manipulated - because certain districts had actually registered 'negative' vote tallies as a result of a dumb algorithm hidden in the machines' code, or in the collating system, to skew the count to a designated candidate.

This is the rationale for movements to demand going back to paper ballots so that if there are doubts about the accuracy of a tally (and there will be), people, presumably trustworthy, can go back and manually re-count the zillions of slips of papers. This is a huge step backward into the Victorian age, and nullifies the capabilities of the Information age.

Another big problem is that many people of a certain demographic are excluded from voting by labyrinthine rules designed to skew elections toward another demographic. This is, of course, predicated on the unreliability of those people's proof of identity.

So, if you wanted to create an "online congress" - how would you do it? How would you be able to assure that only eligible people - residents - can vote on a particular issue? How do you know a person is who they say they are? How do you know they are where they say they are? Everyone knows that it is easy to create as many email accounts as one wants, and it is very easy to mask their location by changing their IP address. Many very smart people have thought about how to solve these problems for quite some time.

These are problems known as authentication and consensus. Solutions proposed are web-of-trust or reputation systems.

In meat-space, the solution is you can watch Congress live on C-SPAN. You can see who is there, how many Yeahs and Nays are registered, and the whole thing is documented and the fact is (practically) unalterable.

An analogy of this online might be to share a web page or a document on Google Docs and ask people to cryptographically sign it with PGP, then send the signature by email to an official address. Those emails could certainly be counted and even authenticated, but unfortunately, most people don't know how to do this and so it is not really a viable solution. The fact that a tiny percentage of the population actually use encryption is proof enough. Furthermore, emails can still be spoofed, so although they are a semi-permanent record of responses, it is a lot of work to authenticate them and determine that each email is the response of one unique human being only.

A voting application on IPFS might work a little better, since everything there is "write-once" - much like burning a CD. A static site can have a page for a particular issue, and two sub-pages with headers "YES" and "NO." A voter uses an application that generates a unique cryptographic hash of that page with metadata about that person's identity, and perhaps, "vouched" by another person who is a member of the same constituency, and a shared secret that is distributed live on say, google hangouts or something similar. Each person in the live hangout uses the voting app to post their vote to IPFS, "burning" it into the registry. Another system knows where to find all these votes on IPFS and performs the talley, and this result is posted, after the deadline, to a page appended to the issue page. This would not be easy to devise, but it is certainly possible.

There are probably other, better, simpler ideas out there, but hopefully this gives a little background on how it might be done.

jbshirk commented 8 years ago

related: https://github.com/ipfs/notes/issues/47

Kubuxu commented 8 years ago

Problem with real electronic voting is that it is supposed to be anonymous but veritable.

In case anonymity is not necessary voting can be easily solved using Ethereum.

Bigger problem I've noticed is aggregation. To show comments from the network they have to be aggregated. It also can be solved using Ethereum but in the case it is not optimal (requires money, chain grows, data important for fraction is stored everywhere).

IPNS could be integrated with some Web of Thrust and some very smart caching to offer place for people to search for content left by others, and thus aggregate. I have no idea how well it could work.

Problems you mention, in my opinion, is part of grater problem which is aggregating voices from the network.

jbshirk commented 8 years ago

@Kubuxu yes, you're right. A lot of smart people have expended a lot of energy trying to figure this out. I can barely wrap my head around it. I've read that IPFS can do what any blockchain can do without growing out of control, so I wonder whether it's ethereum's smart contracts that make the difference. As I try to think of a database as a flat file system and IPFS' append-only property, my gut feeling is that there must be a way to do this on IPFS.

jbenet commented 8 years ago

I've read that IPFS can do what any blockchain can do without growing out of control

IPFS is not a consensus system. It is not a blockchain. It can do much of what a blockchain can, and more. But it's not a superset.

I wonder whether it's ethereum's smart contracts that make the difference.

?? ipfs does not use ethreum contracts... people write ethereum apps that use ipfs.

jbshirk commented 8 years ago

Just to clarify my previous notes: I am not saying or implying that IPFS is a blockchain. But I have seen @jbenet explain in lectures that the MerkleDAG can store anything a blockchain can but with deduplication. Kind of the opposite of bitcoin's blockchain, which is growing geometrically and currently stands at 52 GB per node. I stopped hosting bitcoin blockchain on my mac a long time ago because I really don't want to give up all that disk space for an experiment that is socially and economically flawed that is apparently now doomed.

void4 commented 8 years ago

I have been observing Ethereum for some time now, and while the project and its applications are very impressive, it isn't in all ways generalised enough to become a universal consensus layer. I previously hoped that this project would utilise libp2p and IPFS at some point and maybe it will happen in the future.

I'm not really qualified to say this, but many EthDevs seem to have a "top-down" perspective on the implementation - the clients and the protocols are just a very special case of the specification. And although they are trying to make the specification more flexible, I fear that the importance of the project will block radical generalisations in the future (self modifying contracts, blockchain rent, distributed computation and storage, changes in the EVM) because backwards compatibility must be maintained.

The most flexible all-in-one solution which combines multiple consensus methods that I know of is Eris, but that is more a collection of different software rather than an abstract, unified solution to the problem.

Filecoin needs to be another chain as well, because it cannot be implemented on top of Ethereum (at least not directly).

Convention over configuration for distributed consensus, that would be great. multi-consensus ;)

jbshirk commented 8 years ago

Web of Trust reference

Lapin0t commented 8 years ago

I forgot to reference my issue here but it might be related: #138. Indeed, IPFS is not at all a consensus algorithm but it could be complementary to a well designed consensus algorithm.

fdietze commented 8 years ago

Related:

http://phrack.org/issues/69/11.html#article

http://security.stackexchange.com/questions/46709/can-a-zero-knowledge-proof-of-voting-be-made-using-a-trusted-auth-server-withou