Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not safe to generate random number with a simple entropy on chain. #265

Open
piux2 opened this issue Jun 27, 2022 · 0 comments
Open

Comments

@piux2
Copy link
Contributor

piux2 commented Jun 27, 2022

https://github.com/gnolang/gno/blob/master/examples/gno.land/p/rand/rand.gno
I think we should not include a random number generator in the package until we have a proper solution.

Blockchain is determinstic. Generating a random number with an entropy is not safe, because all nodes need to have the same entropy and it becomes public information.

To use random numbers in smart contracts, we need to use the random numbers generated through VRF (Verifiable Random Function) from an off-chain oracle, which potentially could be a good feature provided by the cosmos hub or a dedicated oracle zone.

@moul moul added this to the 💡Someday/Maybe milestone Oct 20, 2022
@moul moul moved this to 🔵 Not Needed for Launch in 🚀 The Launch [DEPRECATED] Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

2 participants