# Zero-Knowledge Proof of a number being generated "randomly" (similar to a dice roll)

If party1 asks other parties to give a random number, for simplicity, say in a range from 1 to 6 (like in a dice). Is it possible for party1 to ensure that the number received is in a given range and is chosen randomly by the providing party without revealing the number? Something like a dice roll. Providing party commits to the number. The commitments are opened at the end of the game.

How to prevent all/malicious parties to simply always giving the same number, say 1, or a sequentially increasing number, say 1, 2.. claiming the number is between the asked range.

The received number should ensure following (1) number is in a given range (2) number is chosen randomly

Is there a way to enforce and to verify that the number is chosen randomly?

• I don't think that it can be insured by party1 receiving a number from party2 that it has been generated uniformly at random, unless party1 is part of the generation (see mental poker) and trusts their own ability to generate numbers somewhat at random and secretly; or party1 relies on another party3 that they trust for that task and can authenticate.
– fgrieu
Commented Jun 21 at 5:13
• If you involve quantum cryptography. It is possible for a classical verifier to ask a quantum prover to generate randomness that is provably close to uniform and independent, under some cryptographic assumptions. See for example this paper. Commented Jun 21 at 14:20
• In general, I don't think you can have such a proof that is 1- non interactive and 2- where the prover learns the dice toss. Otherwise, it can just generate new proofs whenever it doesn't like the outcome. Commented Jun 21 at 14:21
• Can Verifier somehow attest a function say $rand(1..6)$ which can be used to generate a random number? And let Prover prove in zero knowledge that the number indeed is the output of the fresh run of the attested function!! Commented Jun 22 at 15:45