-
Notifications
You must be signed in to change notification settings - Fork 99
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
The term "bets" is introduced without first explaining what it means #560
Comments
I still don't understand: What are "chosen symbols"? What is to "submit" a chosen symbol? How to submit a chosen symbol? I see API to get a So, I still don't understand. |
No worries :-) Imagine you have (implement) a canister for a lottery. You need to define a service definition with a message to receive a sequence of numbers. Then in each drawing round you have to wait for external entities to submit their number combinations ("bets"). At some point you stop accepting bets, and then you obtain entropy (in form of a So for for a lottery game the "chosen symbols" are the submitted numbers, submission happens by receiving the message from your users. The system doesn't provide an API for submitting bets to your canister, instead you define it. The system only provides an API to your canister for obtaining cryptographic entropy (256 random bits). |
Notably the game Wordle is a bad fit for the IC, as it requires the game canister to choose the winning symbols (5 capital letters). The bets are received after that. So (theoretically) a user could eavesdrop on the node machines and obtain the winning combination that way in one try. |
So, what qualifies as a bet? Any inter-canister call to our canister qualifies as a bet, doesn't it? How is it determined how many bets are a enough to obtain entropy? |
You have a non-empty set W of potential winner combinations. You receive (e.g. by inter-canister call) bets (a bet is just an element, or maybe a subset, of W) from players. The game canister then chooses the winner (picks an element of W based on freshly obtained entropy) and then goes through all the bets to assign a winning sum to them. |
Why before? Why not before or after? |
Our cryptographers are the ones to conclusively answer this, but I'll give a try. If you ask for entropy too early, the bit sequence will be manifest in the RAM of the node machine. The decision procedure for picking the winner is also (in form of code) present on the same machine. If you are a sufficiently powerful agency or state actor then you could obtain access to those bits and programs and compute the winner. If the canister still accepts bets you can crack the jackpot :-) If the canister pulls the entropy after all the bets are closed, this eavesdropping scenario is not possible. Of course if there are no values at stake you are completely free to ignore the recommendations. |
So, please, change the wording from
to
|
https://internetcomputer.org/docs/current/motoko/main/base/Random:
The term "bets" is introduced without first explaining what it means.
The text was updated successfully, but these errors were encountered: