Post
Topic
Board Gambling
Re: [LOTTERY] ★ Brakoo ★ The simplest bitcoin game ✔ Provably Fair
by
Brakoo-Lottery
on 20/07/2016, 17:01:38 UTC
I think brakoo is set out like this, so if someone who plays alot deposits without changing their bitcoin address regardless of the amount that has been sent to the pot then he should have a easier chance of winning because you always mention that it's provably fair and i hope this is not a fixed game where you actually choose the winner otherwise you'll just be misleading us so you can market your website.

As I said, I'm providing you now a framework to verify yourself the drawings.
Using this methodology, you can easily verify any of the past drawings.

Here is the code:
Code:
    var jackpot = CalculateCurrentJackpot(currentTransactionInGame);
    var randomNum = hash.Substring(hash.Length - 16);
    var ranseed = HexLiteral2Long(randomNum) % jackpot + 1;

    long isWinnerCpt = 0;

    var orderedTrans = currentTransactionInGame.OrderBy(x => x.PlayerAddress);
    foreach (var ct in orderedTrans)

    {
        isWinnerCpt += ct.ValueGame;
        if (isWinnerCpt >= ranseed)
        {
            return ct;
        }
    }


Let's verify yesterday's drawing, the game of 2016-07-19.

First, you need the first block that has been mined on 2016-07-20, which is the block #421477

The hash of this block is 0000000000000000050ae5575d800bffc7d73c0399187a2812b1183690cdbc00
the 16 last characters of the bloc are: 12b1183690cdbc00

Then you need the sum of the values of the transactions: 0.34642218BTC = 34642218 satoshis.
Note that the value of the jackpot is 1% less than the sum of the values of the transactions, this is our margin.

In order to manipulate the figures, I transform 34642218 into hexadecimal: Ox210992A
I can now use the calculator (mode programming), in order to perform the modulo: 12b1183690cdbc00 % 210992A = E0ECBC
this makes 14740668 (in base 10) + 1 => 14740669 = ranseed

Now let's look at the transactions, ordered by the player address:

PlayerAddress
|
Game Value
|
Cumulative Value
|
Is More than seed?
|
16eNR9db9UsuE3afTcZsjiWqWk5NbUtJYV|329127|329127|0|
1BXVDjiWQCX9oFaLBxk6djirtrXFwLk5Bc|22304169|22633296|1|
1GfXepAbYXsiATy6hAe4V8QKJfGFtDwTEU|1191718|23825014|1|
1GkKcNLTkF3fxRqYYxVEgDsTBy9wi19fGy|742799|24567813|1|
1LzEG4c9MiqD6qkjuu6pUBhLYoEicmLv1s|74405|24642218|1|
1Np3mwWYnPxH5g6Hj3SQ1RN6JX3WZdavj5|10000000|34642218|1|


On the second line, the cumulative value of games is exceeding the value of the seed: the winner is 1BXVDjiWQCX9oFaLBxk6djirtrXFwLk5Bc

If you have any question about any other game, please let me know.

Cheers.