3

Context: Ethereum based voting system

Let's say a user a user can cast a vote. The user has to choose 1 item out of 10. I believe it is possible to create a smart contract supporting such an election.

However: The participants should not be able to determine the winning item during the voting round, because this can influence the result. I am aware that using encryption on-chain is not possible.

I believe a possible solution is to create a voting system consisting of 2 rounds:

  1. In the first round, the voters commit a hash of their preferred option. Their a part of their private key is used as 'salt', because otherwise people can still figure out what has been voted. Note: This hash is calculated off-chain!
  2. In the second round, the voters commit their preferred choice, including the salt used in the first round. The smart contract only accepts the vote if the hash of these items matches the hash in the first round.

My question is: Would this work? Or are there better solutions?

2 Answers 2

3

You can use the implementation described here which actually uses the exact same idea you suggest here. https://blog.colony.io/token-weighted-voting-implementation-part-1-72f836b5423b

0

What you described is the commit-reveal voting scheme. There is an implementation called Partial-Lock Commit Reveal, where your tokens get converted to the number of votes you're allowed to use, and your tokens are locked up during the entire voting poll.

We're using the PLCR voting model for our Ethereum application to have the community curate a registry by voting in or out applicants.

You can check out the project on github for examples:

https://github.com/AdChain/AdChainRegistry

ConsenSys has also open-sourced a PLCR implementation in Solidity:

https://github.com/ConsenSys/PLCRVoting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.