Provably fair

The technique we use in our provably fair blackjack game will mathematically guarantee we can not cheat the game and it is always a fair random dealt game. How do we do this? Let's take a random example:

  1. Before each game (after ending a previous game), the server generates a new random serverseed which is kept secret.
  2. To prove we will not change this serverseed, we already provide you with the SHA512 hash of this seed. In the console log you will see
    New server seed hash for next game: b050051e1a9cb37a9d31c613ba6ee6f09c2a0a676fbda86c7dfb86a5c73bba5b41c1e2cd77fe26734315cd5c260e36f78317281a4cf304f3e8e62e2e0559a5ff
  3. You press 'deal' to start a new game. Your browser will generate a random clientseed (see JS source), which will be provided to our backend and also printed in the console log:
    Generated new clientseed (local): 88165868741
  4. Our backend will now salt and concatenate it's serverseed and your clientseed ('satoshi' + serverseed + clientseed). The serverseed (which is not yet revealed) is LNBJd539a0edb1d6f32f47b441afdcd3b06f994b2890253b3e95, so when we concatenate everything, we get satoshiLNBJd539a0edb1d6f32f47b441afdcd3b06f994b2890253b3e9588165868741.
  5. The server will now SHA512 this concatenated seeds. You can try this yourself using any online tool (example). The SHA512 of this concatenation is cf17181cdce1494e8f4902023a9bc626d36496e01c18fd2c3dfffec44b7a6a72473cfe72d6a861a7aa69d0e7ccfc313d57dae8fbac22866efd37b06dbc6ddb66.
  6. This string decides the order of the deck. Split in chunks of two characters: cf, 17, 18, 1c, dc, e1, 49, ...
  7. Now you can look up these codes in the below table. You could also convert these HEX groups to decimal to find their sequence number. Eg: cf=207, 17=23, 18=24 ..
  8. Attention: if a number is higher than 207 (CF in hex), it is ignored. If it comes multiple times, it is ignored as well since the card is already taken from the deck. In the above example the hex groups 'dc' en 'e1' would be ignored because too high.
  9. The order of our shuffled deck is thus: king of clubs, jack of hearts, queen of hearts, 3 of diamonds, 9 of hearts, ...
  10. We always deal in this order: player card 1, dealer (downcard), player card 2, dealer (upcard), player cards until stand or 21, dealer cards 3-n. In this example, it means the player will get dealt the king and queen, and the dealer has the jack (downcard) and 3 (upcard). The player has thus 20 and can now choose to stand or hit. If the player hits, he will get the next card in the deck but given his cards, he stands. Now the dealer, who has a 13, hits and gets the 9 of hearts. This gives him a total of 22, so the player wins!
  11. The game has ended, so we can safely expose our serverseed:
    The server seed was: LNBJd539a0edb1d6f32f47b441afdcd3b06f994b2890253b3e95
  12. You can now totally verify there was no way we could have reshuffled the deck in our favor. When you take the SHA512 of the given serverseed, you will get b050051e1a9cb37a9d31c613ba6ee6f09c2a0a676fbda86c7dfb86a5c73bba5b41c1e2cd77fe26734315cd5c260e36f78317281a4cf304f3e8e62e2e0559a5ff. This is exactly what we've shown you before the game started, so our server seed was already determined at that point. Since your browser only created a random client seed after we've shown this hash, there was no way for us to cherry-pick a better serverseed.

This is a layout of the deck we use.

sequence hex card name
000
ace of spades
101
2 of spades
202
3 of spades
303
4 of spades
404
5 of spades
505
6 of spades
606
7 of spades
707
8 of spades
808
9 of spades
909
10 of spades
100a
jack of spades
110b
queen of spades
120c
king of spades
130d
ace of hearts
140e
2 of hearts
150f
3 of hearts
1610
4 of hearts
1711
5 of hearts
1812
6 of hearts
1913
7 of hearts
2014
8 of hearts
2115
9 of hearts
2216
10 of hearts
2317
jack of hearts
2418
queen of hearts
2519
king of hearts
261a
ace of diamonds
271b
2 of diamonds
281c
3 of diamonds
291d
4 of diamonds
301e
5 of diamonds
311f
6 of diamonds
3220
7 of diamonds
3321
8 of diamonds
3422
9 of diamonds
3523
10 of diamonds
3624
jack of diamonds
3725
queen of diamonds
3826
king of diamonds
3927
ace of clubs
4028
2 of clubs
4129
3 of clubs
422a
4 of clubs
432b
5 of clubs
442c
6 of clubs
452d
7 of clubs
462e
8 of clubs
472f
9 of clubs
4830
10 of clubs
4931
jack of clubs
5032
queen of clubs
5133
king of clubs
5234
ace of spades
5335
2 of spades
5436
3 of spades
5537
4 of spades
5638
5 of spades
5739
6 of spades
583a
7 of spades
593b
8 of spades
603c
9 of spades
613d
10 of spades
623e
jack of spades
633f
queen of spades
6440
king of spades
6541
ace of hearts
6642
2 of hearts
6743
3 of hearts
6844
4 of hearts
6945
5 of hearts
7046
6 of hearts
7147
7 of hearts
7248
8 of hearts
7349
9 of hearts
744a
10 of hearts
754b
jack of hearts
764c
queen of hearts
774d
king of hearts
784e
ace of diamonds
794f
2 of diamonds
8050
3 of diamonds
8151
4 of diamonds
8252
5 of diamonds
8353
6 of diamonds
8454
7 of diamonds
8555
8 of diamonds
8656
9 of diamonds
8757
10 of diamonds
8858
jack of diamonds
8959
queen of diamonds
905a
king of diamonds
915b
ace of clubs
925c
2 of clubs
935d
3 of clubs
945e
4 of clubs
955f
5 of clubs
9660
6 of clubs
9761
7 of clubs
9862
8 of clubs
9963
9 of clubs
10064
10 of clubs
10165
jack of clubs
10266
queen of clubs
10367
king of clubs
10468
ace of spades
10569
2 of spades
1066a
3 of spades
1076b
4 of spades
1086c
5 of spades
1096d
6 of spades
1106e
7 of spades
1116f
8 of spades
11270
9 of spades
11371
10 of spades
11472
jack of spades
11573
queen of spades
11674
king of spades
11775
ace of hearts
11876
2 of hearts
11977
3 of hearts
12078
4 of hearts
12179
5 of hearts
1227a
6 of hearts
1237b
7 of hearts
1247c
8 of hearts
1257d
9 of hearts
1267e
10 of hearts
1277f
jack of hearts
12880
queen of hearts
12981
king of hearts
13082
ace of diamonds
13183
2 of diamonds
13284
3 of diamonds
13385
4 of diamonds
13486
5 of diamonds
13587
6 of diamonds
13688
7 of diamonds
13789
8 of diamonds
1388a
9 of diamonds
1398b
10 of diamonds
1408c
jack of diamonds
1418d
queen of diamonds
1428e
king of diamonds
1438f
ace of clubs
14490
2 of clubs
14591
3 of clubs
14692
4 of clubs
14793
5 of clubs
14894
6 of clubs
14995
7 of clubs
15096
8 of clubs
15197
9 of clubs
15298
10 of clubs
15399
jack of clubs
1549a
queen of clubs
1559b
king of clubs
1569c
ace of spades
1579d
2 of spades
1589e
3 of spades
1599f
4 of spades
160a0
5 of spades
161a1
6 of spades
162a2
7 of spades
163a3
8 of spades
164a4
9 of spades
165a5
10 of spades
166a6
jack of spades
167a7
queen of spades
168a8
king of spades
169a9
ace of hearts
170aa
2 of hearts
171ab
3 of hearts
172ac
4 of hearts
173ad
5 of hearts
174ae
6 of hearts
175af
7 of hearts
176b0
8 of hearts
177b1
9 of hearts
178b2
10 of hearts
179b3
jack of hearts
180b4
queen of hearts
181b5
king of hearts
182b6
ace of diamonds
183b7
2 of diamonds
184b8
3 of diamonds
185b9
4 of diamonds
186ba
5 of diamonds
187bb
6 of diamonds
188bc
7 of diamonds
189bd
8 of diamonds
190be
9 of diamonds
191bf
10 of diamonds
192c0
jack of diamonds
193c1
queen of diamonds
194c2
king of diamonds
195c3
ace of clubs
196c4
2 of clubs
197c5
3 of clubs
198c6
4 of clubs
199c7
5 of clubs
200c8
6 of clubs
201c9
7 of clubs
202ca
8 of clubs
203cb
9 of clubs
204cc
10 of clubs
205cd
jack of clubs
206ce
queen of clubs
207cf
king of clubs