Codemonkey is still working on releasing a packaged version of our bet verfier for players so they can verify bets themselves easily.
For now, I shall paste our script for you and others to check and confirm.
It works fine, code monkey just wishes to make it more user friendly and package it as an exe for windows users.
confirm_bet.pl
#!/usr/bin/perl -w
# bet_verify.pl
use Digest::SHA qw(hmac_sha512_hex);
if(!$ARGV[0] || $ARGV[0] eq "--help" || $ARGV[0] eq "-h" || $ARGV[0] eq "/?")
{
print "usage: confirm_bet.pl";
}
$highest_number=$ARGV[0];
$secret=$ARGV[1];
$tx=$ARGV[2];
# create a hash using bet txid and secret
$number = hmac_sha512_hex($tx, $secret);
# Grab the 1st 4 digits of the hash (0000 - FFFF)
$number =~ s/^(.{4}).*$/$1/;
# this converts 0000 - FFFF to 0 to 65535
$number = hex($number);
# convert 0-65535 to 1-N (for roulette its 37)
$number = int( ($number/ 65536) * ($highest_number))+1;
print "Result: $number\n";
This is yesterdays secret:
http://satoshiroulette.com/secrets/btc.secret.20120923.000001.txt
Todays secret which will change in the next 8h, this is a sha512sum of it.
satoshi@KVMSERVER:~$ sha512sum super_satoshi/data-btc/secret.txt
a8a3096db1b50b14603c05afac553bae3a5a235809952eefd395cded9eab36540a5726a59e9a35fc21dcc987e9ea601ed1de48dfe67d5556eaeeefe2b18df0eb super_satoshi/data-btc/secret.txt
I shall task code monkey with uploading sha's of the current secret as well.
We announce in our live logs secrets when the secret is changed at Midnight GMT 0.
To use our verify program, you must have 3 user inputs.
perl bet_verify.pl TOTAL_OUTCOMES SECRET TXID
To verify a roulette game you would run:
perl bet_verify.pl 37 SECRET TXID
For example, lets verify the last bet made before the secret was changed, still visible in the logs currently.
Log:
2012/09/22 22:14:11: roulette-2nd12 : 24 txid: c20627067823cb97e6d39bccbe8ea27d2c52e9a39999c957bee8119d08b256bd
2012/09/23 00:00:08: Secret changed OLD SECRET: a5ae751f40a1d957129b9b6060aa7b97b63f17a25e8d5b5906ebba450f29fc907a7cf8598aa686002f917baf1c9311343093af0cc0bb132abe9c56be277e26ab
Shell:
perl confirm_bet.pl 37 a5ae751f40a1d957129b9b6060aa7b97b63f17a25e8d5b5906ebba450f29fc907a7cf8598aa686002f917baf1c9311343093af0cc0bb132abe9c56be277e26ab c20627067823cb97e6d39bccbe8ea27d2c52e9a39999c957bee8119d08b256bd
Result: 24
Now to verify dice games, its the same concept but we need a map to lookup random result --> dice result.
http://satoshiroulette.com/dice.map.txt
Again taking the last SicBo bet made before the secret change:
Log:
2012/09/22 19:18:58: sicbo-4XX : 2 5 4 txid: 3d086b5827a237d32995d498027df64ef6535d97809d8aa8c7e052866f9fdbf5
Shell:
perl confirm_bet.pl 216 a5ae751f40a1d957129b9b6060aa7b97b63f17a25e8d5b5906ebba450f29fc907a7cf8598aa686002f917baf1c9311343093af0cc0bb132abe9c56be277e26ab 3d086b5827a237d32995d498027df64ef6535d97809d8aa8c7e052866f9fdbf5
Result: 64
Look up 64 in http://satoshiroulette.com/dice.map.txt
64 254
The Dealer Rolled 2 5 4