4 ms·
Here's how to do it: Let's say there are N parties who want to generate a random number between 0 and M-1. None of the N parties trust each other. Each party
by Simon_says 9y ago
Here's how to do it: Let's say there are N parties who want to generate a random number between 0 and M-1. None of the N parties trust each other. Each party individually generates a random number r_1, r_2, ..., r_N and keeps it a secret. Each party generates a hash of this number plus a suitably large salt. These hashes are publicly announced so that everybody can see everybody else's hash. After this, the original random numbers r_1, ..., r_N are published. Add them together modulo M to get R, the resulting random number. All it takes is a single party to randomly generate their number to ensure that the result is random. For extra shits and giggles you can add in a Bitcoin block hash (provided that it's in an appropriate range in order to avoid bias).