This may be a bit "back to basics" for this thread, but I am going to give it a shot,and see what responses I get:
I am trying to TEST/SHOW bitZino to be Provably Fair to myself and a friend.
So, without programming, and using available third-party (online) tools, how can I CHECK the sequence of shuffles, and how they get manipulated by the player's secret re-hashing (cutting) of the deck.
Is this even possible?
-----------------------
I hope this is not too complicated. I just want to be able to walk-through, and VERIFY that which you claim is "Provably Fair"
This is a great idea! As you mentioned, Dooglus did write a python script which verifies the secret and outputs the final shuffle of the deck given the Hash(secret), secret and the client_seed. Additionally, we have a javascript hand verifier located at
https://bitzino.com/about/fair. If you are inclined to take a deeper look at the code for our verifier, you can view the source of that page and see the javascript verifier - it's just 100 lines of well-commented code.
However, I understand that you may want to verify on your own without relying on having coding expertise or relying on code that is hosted on our own website. To that end, I've outlined the steps to do this below: (unfortunately, there will be just a little bit of "coding", but it's really just copying and pasting certain commands into a javascript console. This is necessary because there isn't an online implementation that I could find of the Fisher-Yates shuffle algorithm)
Step 1: Verify the Hash(secret) is derived from the secretAfter playing a hand of any game at bitzino, go to
http://www.movable-type.co.uk/scripts/sha256.html, and copy and paste the Secret in to the box. Click on the "Generate Hash" button, and verify that the hash generated on that website matches the Hash(secret) you see on bitzino.
Step 2: Generate the seed from the client_seed and the server_seedWhile still on the same website, copy and paste the client_seed into the box, followed directly by the server_seed (the server_seed is part of the Secret). E.g, if the client_seed is "ABC", and the server seed is "123", the box should have "ABC123" in it. (Also, make sure you're copying the client_seed from "Last hand" on bitZino, not from the "Next hand"). Click on the "Generate Hash" button. Now, keep this page open, because we will be using this Hash later.
Step 3: Set up a javascript console with the Mersenne Twister functionGo to
http://jsconsole.com. This is a javascript console, and it's where we'll be completing all of the following steps.
Copy and paste all of the code from
https://bitzino.com/static/MersenneTwister19937.js into the javascript console. This will initialize the Mersenne Twister function which will be used later on.
If you'd like to verify that the above code is indeed a pristine copy of the Mersenne Twister, you can download the original zip file from
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/JAVASCRIPT/java-script.htmlStep 4: Seed the random number generatorType the following commands into the jsconsole:
var seedString = "";
var seed = parseInt(seedString.substring(seedString.length - 8), 16);
var mt = new MersenneTwister19937();
mt.init_genrand(seed);
Note that the first line of code isn't actually
, you should replace that part with the value you got from step 2.
Step 5: Set up the initial_shuffleCreate a variable in the jsconsole that is equal to the initial_shuffle from bitzino. (The initial_shuffle is part of the Secret).
var initialShuffle = "";
Step 6: Reshuffle the deck using the Mersenne Twister RNG, and the Fisher-Yates shuffling algorithmCopy this code into the jsconsole:
function shuffle(deck_string, mt) {
var tmp, new_deck = deck_string.split('');
for(var i = new_deck.length - 1; i > 0; i--) {
r = mt.genrand_int32() % (i + 1);
tmp = new_deck[r];
new_deck[r] = new_deck[i];
new_deck[i] = tmp;
}
return new_deck.join('');
}
shuffle(initialShuffle, mt);
At this point, the jsconsole will spit out a value that should be identical to bitZino's final_shuffle.
Final thoughtsI really wish there were an online Fisher-Yates/Mersenne Twister card shuffler, so that every step in this process would be as easy as step 1. If anyone does know of one, please let me know so that I can make this process easier! I also recognize that you are still depending on a lot of code that is just copied directly from me, but I think the fact that it's posted here publicly should show that it is honest, and does what it says it does.
I hope this helps!