Distributed generation of random numbers
The commit-then-reveal approach above is not secure as it allows an attacker to bias the output by forcing the protocol to restart. For an overview on generation of distributed unbiasable randomness, checkout our research paper: https://eprint.iacr.org/2016/1067.pdf 

A Golang prototype of RandHound, one of the protocols proposed in the above article, is available in the DEDIS cothority project of EPFL: https://github.com/dedis/cothority/tree/master/randhound