hey guys, I am wondering is there any way to obtain onchain randomness when developing smart contract?

I saw there is a random function provided by the stdlib. But this can only generate pseudo-random number. So I am wondering if there is alternatives?

Feb 27, 2023, 3:07 AM
There is no way to generate *really* random numbers in computer (maybe only in a quantum one)
Any random that you see in internet and apps is pseudo-random
Feb 27, 2023, 3:12 AM
Is there a way for us to read it somehow? It doesn't have to be "generated". We're ok if there is a way for us to read it from an oracle or other sources.
Feb 27, 2023, 3:13 AM
Then you can just generate the random offchain and pass the result to contract on deployment (as I understood, you need to get random on deployment)
Feb 27, 2023, 3:14 AM
Not just for deployment, we are looking to betting platform which will requires randomness for each game. And we don't want people to be able to predict the result.
Feb 27, 2023, 3:16 AM
https://ton.org/docs/develop/smart-contracts/guidelines/random-number-generation
Feb 27, 2023, 3:16 AM
Nice, thanks!
Feb 27, 2023, 3:17 AM
It's a bad idea to build 100% on-chain casino. It leads to bad experience for users and risks for owners.
Feb 27, 2023, 3:19 AM
We want the part that is related to the result (randomness generation and reward distribution) to be onchain so it's verifiable
Feb 27, 2023, 3:20 AM
Online gambling websites provide verifiable randomness for many years already
You just generate the result before the first bet and show hash to users. But be careful and don't hash some simple kind of results like YES/NO
Feb 27, 2023, 3:21 AM
is there a concrete site that I can take a look or try it out?
Feb 27, 2023, 3:22 AM
I can send you a few links in dm. I don't think sending some casino links in this chat is ok 😁
Feb 27, 2023, 3:23 AM
well received, thank you : )
Feb 27, 2023, 3:27 AM

© 2024 Draquery.com All rights reserved.