Pages:
Author

Topic: FlipSide - Prizes almost 5 million times your bet! (Read 5036 times)

legendary
Activity: 1578
Merit: 1000
May the coin be with you..
What a great game!

Had two goes at it. 1 win and 1 Loss but fun nethertheless. Congrats on making such a fun game and best of luck hope it takes off for you
sr. member
Activity: 294
Merit: 250
This looks pretty cool. I haven't tried it out myself but I see this being a really fun game.

Good luck on it. I plan to try this out shortly. Keep developing games! Don't stop.
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
I just won a game but wasn't paid out.  The payment transaction is "oops..." Smiley

Hey this provable fairness stuff isn't actually fair! I was expected to earn coins with this, not lose them! Cheesy

Code:
$ bitcoind getbalance
0.34425772

I'm sending some funds to the wallet as I type this.

Edit: done!

Nice original game!

BTW, would you mind adding a table with the odds involved in the game on that site?

Cheers!
legendary
Activity: 1974
Merit: 1029
Thanks for the reports, I wasn't aware. It's up again now.
donator
Activity: 3228
Merit: 1226
★Bitvest.io★ Play Plinko or Invest!
Are you aware that the FlipSide web page is down?

I get a "HTTP/1.1 503 Service Temporarily Unavailable" error.

I get *Internal server error*.
legendary
Activity: 2940
Merit: 1333
Are you aware that the FlipSide web page is down?

I get a "HTTP/1.1 503 Service Temporarily Unavailable" error.
legendary
Activity: 2940
Merit: 1333
Hey this provable fairness stuff isn't actually fair! I was expected to earn coins with this, not lose them! Cheesy

It doesn't make the games fair, it just stops cheating.  You could offer 30x payout for any single number on roulette and make it "provably fair", but it wouldn't be fair - the players would end up losing.  All it would prove is that you were spinning the wheel fairly.

I'm sending some funds to the wallet as I type this.

Received, thanks.
legendary
Activity: 1974
Merit: 1029
I just won a game but wasn't paid out.  The payment transaction is "oops..." Smiley

Hey this provable fairness stuff isn't actually fair! I was expected to earn coins with this, not lose them! Cheesy

Code:
$ bitcoind getbalance
0.34425772

I'm sending some funds to the wallet as I type this.

Edit: done!
legendary
Activity: 2940
Merit: 1333
I just won a game but wasn't paid out.  The payment transaction is "oops..." Smiley



I increased the size of the address box to 50 chars.

That's fine now.  There's room to spare, but I guess that depends on the address:



I'm using Chromium "Version 25.0.1364.160 Ubuntu 12.10 (25.0.1364.160-0ubuntu0.12.10.1)" if you care.
legendary
Activity: 1974
Merit: 1029
I increased the size of the address box to 50 chars.

The bet limits are calculated when a game is created and are attached to that specific game, so if you:

  • Create a game, leave it in the background.
  • Play some other games, altering the wallet's balance.
  • Return to the backgrounded game and reload it.
The limits of that game shouldn't have changed.

The worst case scenario is that by playing many winning games in between, the wallet balance could decrease up to a point that when the original game is also won, there could be not enough balance left. I would have to manually fund it in this case.
legendary
Activity: 2940
Merit: 1333
Sorry to keep bumping your thread, but it just occurred to me:

a) There seems to be no limit to the number of games I can have 'in progress' at a time.  Earlier I played 30 games in a single transaction, sending bets to 30 different addresses that your site sent me.

b) It looks like you adjust the max bets according to how your wallet balance is doing.

Do a) and b) conflict with each other?  Do you adjust the max bet after each game, even if you already told the player a different max bet?  I guess you can't, really, or it's an avenue for you to cheat the player.  "Sorry, you would have won, but it turns out your bet was over the maximum bet because we just reduced it".  Although I believe that's what SatoshiDice does - they change their max bet with no notice.
legendary
Activity: 2940
Merit: 1333
The 7-7 game shows a minimum bet of zero:

legendary
Activity: 2940
Merit: 1333
Argh, what an awful moment to get an "Keypool ran out, please call keypoolrefill first" error, just when this thread receives a free bump! Cheesy. The immediate internet search turned an answer here. Man, you're useful!

I just increased the box size from 35 to 40, which should be more than enough.

That's funny.  I'm the #1 google search result for all your problems.  Wink

The box still isn't big enough for my address (showing that I see '40' in the source, but the address still doesn't fit):



Also, I keep winning.  I played 9 times today (6 cards, A-A) and won every time!



I wrote a little Perl script that checks the provable-fairness, and that's working just fine:

Quote
$ ./flipside.pl 3034b72d15372924cae59e98246b51e2317b9b642098a800f5e717d40ccda133b5c6cdec18e3799 ec45e1f5cd7396dcc alfalfa a7452eb9e658a373 d7e4f97a
AS>KC AD>KS AH>KC AC>QH AH>JC AC>9D         WIN
$ ./flipside.pl c79ffa2cad920454aa51b8d7dd5068639df15c93102f88538de1953c0c4ddc5f411f8a9db957b98 add061b0000bc6037 clover  0a3b638c167c5759 754d67aa
AC>JD AC>JS AD>7H AC>TC AD>8S AC>JS         WIN
$ ./flipside.pl 807c2dd88c4ca17e590536e793eeaa058e79796248dc3375fb7eabf6027d07f2210bc9cc764f96c 9aa333263f6edff0a dlkfjj2 3c9c725fd154f748 704e1ce3
AD>JC AD>JD AS>QD AS>KH AD=AD AC>9S         WIN
$ ./flipside.pl 61eaba331654114d9ac4c50e68efa2a10e6e2c3013d8aba6e8d11140a7dd58139b9c48af590895f deeef8fab100b988e ludicr2 08dc4f54e1a72263 b9b63aed
AS>TC AH>7D AH>7H AH>8H AS>8C AS>TH         WIN
$ ./flipside.pl c6d9c0ca63bcd4c9e808e51dbeeb7c0194b82a7aed279e4a00f4335878e3ca05bc4029a392b4489 662975f6ec57cb3ec game1of5 afe9f5476316bec4 2ac62a0b
AH>8C AH>AD AS>7D AS>8D AC>8H AS>TS         WIN
$ ./flipside.pl 6a33e186d1463a354fcf3ed54012cb54e7dc0cd63088672cb1bbf78eefea749b809b5bec666a6dd 13621d76ea2034e79 game2of5 9af52677ad635a78 2ac62a0b
AS>7S AH>KH AH>9H AC=AC AD>7S AD>JS         WIN
$ ./flipside.pl 90b1c7b05a34243ef14c2191973e9b1801125ab099d2eda203a1b22bd916deb23832ab05142d71f 8433b75210315d7c0 game3of5 8926654fd3e814d8 c48ea4c5
AH>9S AD>QH AD>TD AH>TC AC>7C AH>AD         WIN
$ ./flipside.pl 8e43ef657fd42b5bed18ce21015a4943b36053208360222ff19284c835a8493547eeac2d810033a 10db6e9cc378fc8f3 game4of5 14130a1f2df82ffd c48ea4c5
AH>QC AD>QS AC>TD AH>7H AH>KD AC>KC         WIN
$ ./flipside.pl f8b69620ddeae0e1d155be8ebdbee2e5e8b2a211a6717e513824f7cd11a073379025ee89c731353 8aec0c3553237b96e game5of5 13aae71f33fc991d c48ea4c5
AD>KS AC>QS AH>8C AH>TS AH>TH AS>KC         WIN

The script is pretty bad - I've forgotten most of the Perl I ever knew, so I'm using backticks to invoke subshells, etc.  But it does the job:

Quote
#!/usr/bin/perl

use Math::Random::ISAAC;

die "usage: flipside.ph " if @ARGV != 4;

sub card {
    my ($n) = @_;
    my $ranks = '789TJQKA';
    my $suits = 'CDHS';

    my $rank = substr($ranks, int($n / 4), 1);
    my $suit = substr($suits, $n % 4, 1);

    return "$rank$suit";
}

($hash, $client, $secret, $block) = @ARGV;

die "hashes don't match\n" if `echo -n $secret | sha384sum | cut -d' ' -f1` ne "$hash\n";

$block = eval("0x" . substr($block, -8));
$concat = $secret . $client;
$secret = eval("0x" . substr($secret, -8));
$xor = ($block ^ $secret) & (0x3fffffff);
# print "concat: $concat\n";
$seed = '0x' . `echo -n $concat | sha384sum | cut -c1-8`;
# print "seed: $seed\n";
$seed = eval $seed;

my $rng = Math::Random::ISAAC->new($seed);
$count = 0;
$result = 'WIN';
while (1) {
    $r = ($rng->irand()) & 31;
    if ($r > 27) {
   $mine = $r;
   $his = ($xor >> 5*5) & 31;
   print card($mine);
   if ($his > $mine) {
       $result = 'LOSE';
       print '<';
   } elsif ($his == $mine) {
       print '=';
   } else {
       print '>';
   }
   print card($his) . " ";
   $xor *= 32;
   $count++;
   last if $count == 6;
    }
}

print "        $result\n";
legendary
Activity: 2940
Merit: 1333
5 million times your bet?? Bloody hell lol! You couldn't help feel sorry for ya if you lost one of those bets haha.

Well with the upcoming limitation of small outputs I guess betting to those games will become somewhat difficult—unless I fill the hot wallet with 300 coins Smiley.

Note that you don't have to have enough coins in the hot wallet to be able to pay out all winning bets.  If someone wins 5 million times their bet I'm sure they'll be happy to wait 24 hours for you to get their winnings online.

Check out bitmillions.com for instance.  They keep their two biggest prize pools offline since they are very rarely won.  So long as your code can handle the case of your hot wallet having insufficient funds, you'll be OK.
legendary
Activity: 1974
Merit: 1029
5 million times your bet?? Bloody hell lol! You couldn't help feel sorry for ya if you lost one of those bets haha.

Well with the upcoming limitation of small outputs I guess betting to those games will become somewhat difficult—unless I fill the hot wallet with 300 coins Smiley.


Your game looks cool though. I'll give it a whirl when I get home

Best of luck! Wink
hero member
Activity: 504
Merit: 500
5 million times your bet?? Bloody hell lol! You couldn't help feel sorry for ya if you lost one of those bets haha.

Your game looks cool though. I'll give it a whirl when I get home
legendary
Activity: 1974
Merit: 1029
Argh, what an awful moment to get an "Keypool ran out, please call keypoolrefill first" error, just when this thread receives a free bump! Cheesy. The immediate internet search turned an answer here. Man, you're useful!

I just increased the box size from 35 to 40, which should be more than enough.
legendary
Activity: 2940
Merit: 1333
A slightly less important bug:

The "Payout address:" box isn't wide enough for me to see the whole address.  I tend to check the first few and last few characters to see that the address is right, but can't see the last few very easily.
legendary
Activity: 2940
Merit: 1333
I PM'ed the game's owner with the following a few days ago.  Since he's fixed the issues now I figured I'd post it here to show how you have to be careful when implementing 'provable fairness'.

Please get yourself a pizza for both your help here and this stackexchange post that was useful for my coin control utility Smiley.

Hey thanks!  I was wondering where that 0.1 BTC came from.  Smiley  I somehow missed your post here.  The forum's "watchlist" feature is a little buggy I think.

A few comments on your new provably fair system:

1) You only publish the first 4 bytes of the server secret's hash.  You could have pre-selected a bunch of server secrets with known collisions in their first 4 bytes.  That's not hard to find.  Then when you see the client secret and the block hash you can pick which of the pair (or more) of server secrets is best for you.  It would be better if you published the whole hash of the server secret to remove this as a way of you cheating.

2) The server secret is only 4 bytes long.  There are only 4 billion possible server secrets.  It wouldn't take very long with decent hardware for me to brute force it.  If I'm lucky there's only one server secret that hashes to the right value.  I can test it against multiple client secrets until I find one with 6 of the best card, and pick those 6.  You should use longer server secrets so players can't brute force them.  I don't know how slow sha386 is compared to sha256, but people regularly run 1Ghash/s when mining.  That would mean they can find your secrets in 4 seconds.  You don't need to use the whole secret in the concatenation that seeds ISAAC - you can safely use just the first 4 bytes - but tack some random junk on the end to make it impossible to discover up front.

3) I wasn't able to figure out how to seed the C version of the ISAAC RNG you linked to.  But package libmath-random-isaac-perl in ubuntu worked fine, and reproduces your numbers.

Chris.
legendary
Activity: 1974
Merit: 1029
1. show hash of server secret to user
2. allow user to select their secret
3. shuffle cards using server secret and client secret

Thanks dooglus for your input. I've made the necessary changes and put the new code online. This is a finished game with the improved provability. I entered a user secret containing the Euro symbol to show that there's an issue with the encoding; however, the sha384sum is correct. Help has been updated accordingly too.

Another example shows that when the RNG generates out-of-range cards they are skipped (lower than J-clubs in this case). It still amazes me that betting 0.73 BTC is now a whopping 80 euro…

Please get yourself a pizza for both your help here and this stackexchange post that was useful for my coin control utility Smiley.
Pages:
Jump to: