what you say makes no sense. I don't understand , Why should we make the result 1 second early or late?
Let's use your provably fair demo:
const ROUND_CREATED = "6/20/2023, 10:31:12 PM"; // Timestamp when round was created.
const ROUND_HASH = md5(ROUND_CREATED); // MD5 of Timestamp.
const SECRET = "vo1Ee1o11CSv"; // A 12-characters string randomly generated.
const ROUND_ENDED = "6/20/2023, 10:31:32 PM"; // Timestamp when round has ended.
const GEN_OUTCOME = hexdec(sha256(`${ROUND_HASH}-${SECRET}-${ROUND_ENDED}`).substr(0, 8)) % 15;
console.log("Outcome is", GEN_OUTCOME);
That prints:
But let's say the round ended 1 second earlier:
const ROUND_ENDED = "6/20/2023, 10:31:31 PM";
it would print:
Because we have no way of verifying when the round should have ended, or started, there's no way to know if you have manipulated the result or not.
A malicious site operator could easily cheat by picking secrets, start or end times to lead to what ever result they wanted. Therefor it's not provably fair.
round duration 30 seconds. Look at the time of the previous round and add +30 seconds. simple.
If you check the provably fair section, the round is always finish every 30 seconds and the time is written.
here is the proof for you
last round: 10:43:11
when will the next round be over?
of course , 10:43:41
i think everything is fair
I mean, the user will notice it when they check it out.
Let's create a scenario from what you said
const ROUND_ENDED = "6/20/2023, 10:31:32 PM"; // Timestamp when round has ended.
That prints:
so the result is red.
"6/20/2023, 10:31:23 PM" The user placed a bet before it drawn at this time. and think you're betting on black. and we don't know the result because time is not up. would actually lose the bet.
i interestingly drawn 1 second early or later.
const ROUND_ENDED = "6/20/2023, 10:31:31 PM";
it would print:
> 13 - black
and the user won.
So I roll the dice without knowing the result. user won because of me.
and When you check it, it will ask why the round ended 1 second late or early.
So our system is fair.
I never know the result. why would i make it 1 second late or early. If I knew the result 30 seconds ago, what you said is true.
I am confused
https://replit.com/@steampoweredgj/RosybrownIntrepidDebugger You can verify the rounds with nodejs. just test and check everything.
Hussein is right. The provably fair system on this site is completely obsolete, as the "Secret" string you are using for roulette can be cherrypicked once bets are placed - meaning the entire round result can be swayed in the house's favour if a large bet is placed on a certain spot. Taking a quick look at your Duels game mode, it also seems to have a faulty provably fair system.
Consider using a hash chain for your roulette, with the client seed being picked via seeding event, and using EOS block hashes for your Duels.