I found these 2 great articles on something similar but built on ethereum which comes with its drawbacks eg gas fees and inability for the draw function to be called automatically.
Is random number generation easier on the ICP?
I am wondering how different would such an application look like on ICP written in Motoko or could you run this sample code directly in a canister?
Complicated stuff for a non developer but I think I have a general idea of how it functions on the ICP now, but developing it is another story altogether.
If there were any tutorial’s I’d love to give it a shot. Maybe something that can follow in the future document releases and demo’s.
So blob creates a random hash…how would you match a winner or multiple winners in a case like this? Some comparison of their wallet address compared to the created hash?
Example being , 500 entrants with 10 winners…I can’t wrap my head around how the blob would allow the winners to be verified.
Canister’s would also need to be able to be viewed to verify authenticity.
if you’re familiar with something like minecraft, the blob would be the “seed” the random number generator uses to create random numbers. It’s completely deterministic, but appears random.
Sharing the seed with someone would let them cheat the system, since they’ll always know what number will be pulled.
However, if you share the hash of the seed, it is very very hard to figure out the seed from the hash.
So, you can give them the hash of the seed, which they can later use to verify you used the seed you said you did.
Give them the hash of the seed.
Run the generator.
Give them the seed
User then checks the hash of the seed, and runs their generator with the seed to get the number! Woo!