Generate a random number along with a zk proof that it was generated randomly. And no one will know your secret random number until you reveal it.
It's build following this. to be used in mina zkapps
It's simple node.js backend which returns 256 random bits along with a signature, proving that the server generated the randomness. However to be more trustless the single server should be replaced with a decentralized group like chainlink's vrf(MPC), to make it difficult to corrupt.
One can also pass a hash of a random number along with the normal request and the signature in the response will also contain the commit. Then to calculate the random number just simply xor or add both numbers to produce a truly private provably random number !!!
deployed on cyclic