# Revealing vote after time

Imagine we have 5 different parties, all of these parties test if a particular thing is true or false over the course of 24 hours. The network needs to come to a consensus about the majority outcome of these parties votes.

The 5 different parties need to submit their votes onto a blockchain, however if within the 24 hour time-frame one of the parties submits their vote early there comes potential for one of the other party members to look at the early submitted vote and copy that vote skewing the real result.

What is the way to prevent copying in this situation, can a hash time locked contract be opened that collects the encrypted votes from each party and then after the 24 hours reveal the result to the network?

Or is there something simple im missing, the basic idea is I want to cryptographicaly hide something and then reveal it at a certain block height?

• The security of these systems tend to depend on the precise set of behaviors that should be allowed. You may be able to find a simpler system, depending on the behaviors. For example, it may make more sense to have the 5 provide cryptographic commitments for their vote during the 24 hour period. Then, when 5 commitments are seen or 24 hours has passed, each one reveals their vote. This handles the specific issue you mention of skewing the results, but does demand that the parties broadcast 2 messages at different times, rather than just one message. Mar 1 '18 at 0:27

## 1 Answer

Based on @Cort Ammon suggestion and some additional consultation i think the below will work

Each of the 5 parties could publish Hash(vote || random bytes), because of the random bytes it would not be possible to find the vote by hashing guesses. Then after all commitments are published or 24 hours has passed each party would publish the plaintext = (vote || random bytes), and all other parties could hash that to verify that it is equal to the original commitment.

• So, what keeps one of the parties from copying someone else's hash, waiting for them to reveal their vote and also copying the random value? You should include the voter's identity in the committed value. Also, what you are trying to construct here in an ad-hoc fashion is called a commitment scheme. What you have there is binding assuming collision resistance, but to be hiding, you will need to use the random oracle model. Mar 2 '18 at 1:50
• I think Tor Project did something similar to this using what they call the Shared Random Protocol. Jun 30 '18 at 7:08
• update your solution please. Sep 28 '18 at 9:33