larprober logo, an ink bottle with three strokes rising from it larprober
05

A card game with a deal you can audit

71

Four players in four houses, one Turkish card game, and a shuffle that every phone re-runs at the end of the round to prove it was not rigged.

Year
2026
Type
Android and server
Stack
Kotlin, JDK HttpServer, WebRTC
Status
Built, verified on emulators

The brief

A family plays 71 together, from four different houses. They wanted a real table: the same rules they argue about in person, faces and voices, and a deal that nobody has to take on trust.

The deal is auditable

Fairness here is commit and reveal, not a promise in a privacy policy.

  1. Before dealing, the server publishes a hash of a secret it has already chosen.
  2. Every phone contributes a nonce of its own.
  3. The shuffle seed is the hash of the secret together with all of the nonces, so neither side alone decides the deal.
  4. At the end of the round the secret is revealed, every phone re-runs the same shuffle and checks that the hand it was dealt is the hand that seed produces.

Other players' hands never travel over the wire. Bot nonces are derived from the committed secret, so the server cannot pick them after seeing the human ones either.

The commit and reveal shuffle The server commits to a hash of its secret before dealing. Every phone contributes a nonce. The seed is the hash of the secret and all nonces together. After the round the secret is revealed and each phone re-runs the shuffle to check its own hand. Neither side alone decides the deal Commit server publishes H(secret) Nonces every phone adds one Seed H(secret + nonces) Deal hands go out Audit phones re-run it other players' hands never go on the wire bot nonces derive from the committed secret
The phone audits the server with the server's own shuffle code, because both compile the same rules module. A rigged deal would have to survive four independent recomputations of it.

Three modules, one rule set

Plain Kotlin rules hold the cards, melds, turn machine, scoring and shuffle. The server is the JDK's own HTTP server with long polling and in memory rooms, and no dependencies. The Android app is built on views. Both the phone and the server compile the same rules module, which is precisely what lets a phone audit the server using the server's own shuffle code.

Then it grew

Voice and video arrived as a mesh between the phones, with the server relaying only the signalling through a per player inbox on the existing long poll. Bots came next, driven through the same methods a phone calls. Then a table browser, then blackjack, then Texas hold'em on the same table furniture, seats, chat and audit trail.

Proof by probe

  • 120,000 simulated blackjack hands: dealer bust 27.95 percent, house edge 0.31 percent, zero illegal states.
  • 4 million poker hands: every hand category within 0.03 percentage points of the published odds.
  • 4,000 full poker hands with chips conserved exactly, and a real three way all in settled correctly on an emulator.

The bug that probe caught: side pot levels have to come from players still in the hand. Take them from folded players as well and a folded over committer creates a pot nobody is eligible to win, and the chips vanish.

Honest limits

Played on emulators, not yet on the family's own phones, and there is no permanent host for the server yet.

All case studies Next: Leptocline

Need something like this?

Describe it in a paragraph. I will tell you whether it is a two day job or a two month one before you commit to anything.

Start a project

Reply within 24 hours on weekdays. Taking new projects.

Taking new projectsReply in 24 hours on weekdays Start a project