Fair dealing

Every game of Euchre Showdown is dealt from a seed fixed before the first card, and anyone can deal the game again to check it.

How it works

  1. A seed, sealed. When a game begins, the app draws a secret house seed of 256 bits from the device’s secure random number generator and shows its fingerprint: the SHA-256 of the seed’s 64 hex digits. The fingerprint pins the seed down without giving it away. You’ll find it at the foot of Single Player, before you deal.
  2. Your phrase, if you like. Once you’ve seen the fingerprint, you can add a phrase of your own. The game’s seed is the SHA-256 of the house seed’s hex digits, a colon, and your phrase.
  3. Every card from the seed. Each deal comes from the game’s seed and the deal’s number, shuffled by a published method. The first dealer, and how each computer player deals, are drawn from the seed too, so the app can’t choose them. Nothing looks at how you play, your level, or the score.
  4. The seed, revealed. When the game is over, or you quit it, its house seed is shown in Fair Dealing. Check the Deal confirms that the seed matches the fingerprint and deals every hand again. The published script does the same on any computer with Python 3, and the checker below does it in your browser.

At a table on the Euchre Showdown server, the server draws the house seed and shows its fingerprint before the game begins. Then each person’s device adds its own part: 16 random bytes from its secure random number generator, drawn only after the fingerprint has arrived, written as 32 hex digits. The phrase is every seat’s part in the table’s order (north, east, south, and west; east, south, and west in cutthroat), joined by colons. The server draws the part for a computer player’s seat, and for a device whose part didn’t come in time. Every device sees the whole phrase before the first card and checks that its own part is in its place. The game’s seed comes from the house seed and that phrase exactly as it would from a phrase of your own, so the checker below verifies an online game as it does any other.

A seat can change hands between deals at an online table, and each seat keeps the way of dealing it had as the game began. A person’s seat deals that person’s way even after a computer player takes it over, and a seat a computer player held at the start deals as the seed drew for it, whoever plays it later. The game record Check the Deal copies says whose ways were drawn.

What it proves, and what it doesn’t

The fingerprint and the reveal prove that nothing changed after the fingerprint was shown: the seed was fixed then, and every card followed from it. Because the app runs on your device with no one else involved, that’s all they can prove on their own. The app chose the house seed, so by itself it could have picked one whose deals it liked before showing you the fingerprint.

Adding your own phrase is what stops that. Your phrase is mixed in after the fingerprint is fixed, so neither the app nor you could have chosen the cards. Type anything: a word, a date, a line from a song.

Online, the server chose the house seed, and each device’s part does what your phrase does: it keeps the server from choosing the cards by itself. What it can’t show is that no one learned the seed early. Whoever runs the server could see the house seed before the parts come in, and so could try parts of their own on a device of their own. Someone who joins a game after it began had no part in its phrase.

Check a game here

In the app, open a finished game’s Check the Deal (from Fair Dealing’s list of past games, or from the result when a game ends). Under Seeds, tap Copy beside Command for the verifier script and paste it below. A game with the kitchen-table shuffle deals each hand from the one before, so copy Game record for the verifier script instead: paste it, or choose the saved file.

Pressing Check downloads Pyodide, Python for the browser, from the jsDelivr network: about 6 MB the first time, which your browser keeps for next time. Then it runs this site’s copy of verify_deal.py, unchanged, with what you pasted. What you paste stays on your device.

Run the script yourself

Download verify_deal.py (plain Python 3, standard library only). It’s the script the app’s How the Deal Works screen points you to. Its SHA-256 is:

7ad46d68ac4506998fa263616d3f33d279b6238cbff451a7b7594317034f4d0d

To compare, run shasum -a 256 verify_deal.py on a Mac, sha256sum verify_deal.py on Linux, or Get-FileHash verify_deal.py in PowerShell.

Then paste the command Check the Deal copies into a terminal, in the folder where you saved the script:

python3 verify_deal.py --hands 7 --patterns 3232,2323,… -- HOUSE_SEED 'your phrase'

Or save the game record as game.json beside it and run:

python3 verify_deal.py --record game.json

The script prints the fingerprint first, so you can compare it with the one the app showed before the first card, then the game’s seed, the first dealer, how each computer player was drawn to deal, and every deal, hand by hand, to set beside Check the Deal’s list. python3 verify_deal.py --help lists every option.

The method, in full

The script’s opening lines and the app’s How the Deal Works describe each step: the SplitMix64 and xoshiro256** random number generators, the Fisher–Yates shuffle, the order of the deck, how each dealer’s pattern deals the packets, how the first dealer and the computer players’ ways of dealing are drawn, how the seed cuts the deck where the rules have a cut, and how the kitchen-table shuffle riffles and cuts the cards gathered after each hand. Change any of it and every past game would fail its check.