Content pfp
Content
@
0 reply
0 recast
0 reaction

Noah Bragg ๐Ÿ”ฅ pfp
Noah Bragg ๐Ÿ”ฅ
@nbragg
Reading into how to create random numbers on the blockchain. Seems like commit/reveal schemes can be a great solution if you are ok with having a centralized actor a part of it. This is probably fine for most games that want to add some randomness. If you have bigger value at stake then ChainLink VRF is probably the way to go.
2 replies
0 recast
4 reactions

Corbin Page pfp
Corbin Page
@corbin.eth
If you're ok being your own centralized actor, which I think is ok for most games, you can generate a random number offchain and sign it. Then verify the message onchain to get the random number. This is what we do for King of the Degens.
1 reply
0 recast
1 reaction

Noah Bragg ๐Ÿ”ฅ pfp
Noah Bragg ๐Ÿ”ฅ
@nbragg
Does this take 1 tx onchain?
1 reply
0 recast
1 reaction

Corbin Page pfp
Corbin Page
@corbin.eth
Client calls backend to get a signed random value, and then user submits that message with a function call onchain.
1 reply
0 recast
0 reaction

Noah Bragg ๐Ÿ”ฅ pfp
Noah Bragg ๐Ÿ”ฅ
@nbragg
So I think that could be front-run but probably not a huge issue at this point.
1 reply
0 recast
1 reaction

Corbin Page pfp
Corbin Page
@corbin.eth
front run or simulated...so sophisticated users could know the outcome by simulating the tx and decide whether to submit it. We cached random values per user so they couldn't retry until they got a value they liked. 99% of users won't do it but we def had users that did. ๐Ÿ˜‚๐Ÿ˜…
1 reply
0 recast
1 reaction