alexcambose / provably-fair-example

Provably fair implementation done in javascript.
https://medium.com/@alexcambose/provably-fair-system-in-javascript-6457e028d2aa
MIT License
36 stars 18 forks source link

Confusing typo #4

Open PerryGraham opened 1 year ago

PerryGraham commented 1 year ago

https://github.com/alexcambose/provably-fair-example/blob/master/routes/api.js#L19

 * It doesn't return the hashed serverseed in advance, because that would
 * allow the client to generate all the rolls in advance.

Should be:

 * It doesn't return the *unhashed* serverseed in advance, because that would
 * allow the client to generate all the rolls in advance.
PerryGraham commented 1 year ago

Hey @alexcambose,

I read everything. I understand the algorithm of provably fair. There is one part that defeats the entire purpose for me. After the bet is over, the client now has the unhashed serverseed, nonce, and original clientseed. Without knowing the combination method, or the method used to calculate a result from the hashed combination, how can the client trust that the endpoint is using the same method as what was used during the bet. Couldn't I (the developer of the server) make the verify route tell the client that those seeds honestly calculated the outcome? How does this ensure fairness to the client?