Jump to content

How to verify the ligitymity of the Fisher–Yates shuffle algorithm


dvdx1995

Featured Comment

Posted

Hello.

Im trying to understand how we can verify and be 100% sure that the randomly generated numbers were actually generated by this algoritm and not by any other script, also even if' its genereated by the algoritm how we can prove that the 1st result was taken as the output ?


I give you an example, 
 

I have the array of 24 keys 

array(24) { [0]=> float(5.855056189466268) [1]=> float(9.660093035548925) [2]=> float(21.161670287605375) [3]=> float(9.999232469126582) [4]=> float(17.168411565944552) [5]=> float(10.711458823643625) [6]=> float(12.54911195463501) [7]=> float(9.535071277990937) [8]=> float(0.5667173166293651) [9]=> float(0.8397210277616978) [10]=> float(8.69413630105555) [11]=> float(5.504395409021527) [12]=> float(11.218626164831221) [13]=> float(5.910484543070197) [14]=> float(8.925932434853166) [15]=> float(5.103768634144217) [16]=> float(3.7276027528569102) [17]=> float(2.792498841881752) [18]=> float(5.16907269670628) [19]=> float(5.409418664406985) [20]=> float(3.6189489834941924) [21]=> float(3.931887786835432) [22]=> float(0.47040061256848276) [23]=> float(1.0569788194261491) } 

this is the output of the bytes of the hash string for mines on my example game.

HMAC_SHA256(95a4ff12c902c09e5890a0a1e3bc330e3c33c9b3bffa44335088923f24a874ec,LvELbntXTg:69071:0)
3b    f4    ad    b2    67    0a    7e    7a    eb    89    e1    1a    74    5a    cd    f4    d1    4a    86    58    89    1b    4e    eb    a9    15    30    85    87    9c    22    94
59    244    173    178    103    10    126    122    235    137    225    26    116    90    205    244    209    74    134    88    137    27    78    235    169    21    48    133    135    156    34    148

HMAC_SHA256(95a4ff12c902c09e5890a0a1e3bc330e3c33c9b3bffa44335088923f24a874ec,LvELbntXTg:69071:1)
08    88    ba    85    0d    6f    7f    51    94    61    42    d8    64    a6    dc    7b    dc    eb    ae    f4    7e    17    20    52    cf    bb    15    22    82    a8    0e    e1
8    136    186    133    13    111    127    81    148    97    66    216    100    166    220    123    220    235    174    244    126    23    32    82    207    187    21    34    130    168    14    225

HMAC_SHA256(95a4ff12c902c09e5890a0a1e3bc330e3c33c9b3bffa44335088923f24a874ec,LvELbntXTg:69071:2)

6a    07    93    2c    59    5c    26    88    bd    0a    55    e1    e6    cd    46    e5    b9    4a    49    c2    fb    a4    0c    ac    28    24    0e    e5    87    4b    14    fb
106    7    147    44    89    92    38    136    189    10    85    225    230    205    70    229    185    74    73    194    251    164    12    172    40    36    14    229    135    75    20    251

 


function fisher_yates_shuffle($items) {
    for ($i = count($items) - 1; $i > 0; $i--) {
        // Generate a random number between 0 and $i
        $j = rand(0, $i);
        // Swap the items at indices $i and $j
        $temp = $items[$i];
        $items[$i] = $items[$j];
        $items[$j] = $temp;
    }
    return $items;
}


Now if i generate a numbers in a Fisher–Yates shuffle algorithm on that result it can generate me compleately RANDOM Output, as this algorithm is random!

Can anyone explain it to me, maybe im getting something wrong, but for me seems like the OUTPUT may be whatever stake determine! because there is now provably-fair of the output generated by Fisher–Yates shuffle algorithm from their side.

How i can be sure that the RESULT i received from STAKE in the Provably Fair generator is not manipulated by their internal code??

 

Posted

Impossibile verification... My esperence to other 500.000 hands in all site is:

Low bet = + fairness and really randomly +/-

High bet = - fairness and rigged software 

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...