Skip to content

Play Koi-Koi online with a friend

Last updated

To play Koi-Koi online with a friend, sign in with Google, create a room and send your friend the invite link. When they open it, sign in and ask to join, the match starts on both screens. It is free, runs in the browser on phones, tablets and computers, and neither your friend nor the server can see your cards.

What you need

  • A Google account for each player. Online play needs a sign-in (Sign in with Google on the home page); practice against the computer does not (see playing the computer). Your friend sees your profile name, your avatar and a four-character tag such as #A34E, never your email address. Change the name and the avatar under Edit profile in the account menu.
  • A current browser on a phone, a tablet or a computer. There is nothing to download, though you can install the game as an app.
  • An internet connection for the match. If it drops, you have 3 minutes to come back (see disconnects and reloads).

You do not need to share a language. The invite link has none in it, so it opens the game in your friend’s own language, English or Japanese: the one they chose before, or their browser’s.

Play a friend in four steps

  1. Create a room

    In the lobby, under Create a room, pick Private, 6 or 12 rounds and, if you like, a password. Press Create room.

  2. Send the link

    Press Copy invite link, or Share on a phone, and send it in any messaging app. The six-character room code works too.

  3. Your friend joins

    They open the link, sign in with Google, type the password if there is one, and press Ask to join.

  4. Play

    Your device lets them in, the two devices set up an encrypted session, and the first round is dealt.

You, the host

Private room · 6 rounds · ×2 at 8+ · With hints

ABC234

https://hanafuda.lemme.dev/#join=ABC234Copy invite linkShare

Waiting for an opponent to join…

The invite link

Your friend

Join room ABC234

HostHana #A34E6 rounds · password protectedRound totals of 8 points or more double.Assisted highlighting: the table shows which cards match.
Room password
Ask to join
Your screen while you wait, with the room code, the invite link and the room’s settings, and the page your friend sees after opening the link. The code ABC234 and the host’s name are examples.

Create a room

Once you are signed in, the home page is the lobby. Its Create a room panel has these choices; the two room settings you used last are remembered on your device.

The choices for a new room
ChoiceWhat it doesDefault
VisibilityPublic: listed in the lobby while you wait. Private: not listed; only the link or the code leads to it.Public
PasswordOptional. Whoever joins has to type it.None
Rounds6 or 12 rounds.6
Double at 8+ pointsA round worth 8 points or more is doubled (see Room settings below).On
Assisted highlightingThe table shows which cards match.On

Press Create room and you get a six-character code, such as ABC234, and a waiting screen. You have one room at a time: creating a new one closes the one before. If you go back to the lobby while your room is open, the lobby says Your room ABC234 is still open. with Return to it and Close it. While a match is being played in it, the lobby says A match is in progress in your room ABC234. and offers Return to match and Resign and close instead, and a new room can be created only once that match has ended. A match that ended while you were away shows as Your match in room ABC234 ended while you were away. with See the result, which opens it so that your device can confirm the result. If the other player of your room’s last match was away when it ended and has not confirmed the result yet, closing the room from the lobby or the waiting screen, or creating a new one, asks first: the room keeps how that match ended for them.

Send the invite

The waiting screen shows the room code in large letters and the invite link under it, in the form https://hanafuda.lemme.dev/#join=ABC234. Copy invite link puts it on the clipboard, and on phones and tablets that can share, Share opens the system’s share sheet. Pressing the code copies the code.

You can also just read the code out. Your friend types it in the lobby under Join with a code. Codes use capital letters and the digits 2 to 9, without I, O, 0 or 1, so they are hard to misread; small letters, spaces, full-width characters and a pasted invite link are all accepted.

Your friend joins

The link opens the home page with a line above the buttons: Sign in to join room ABC234. After signing in, your friend sees the join page, which names you as the host and lists the number of rounds, the password (if any) and both room settings, so they know the terms before they join. They type the password and press Ask to join.

Your device lets them in at once; you do not have to do anything. The one exception is a player who walked out of a match against you before (see After the match): then you are asked, and choose Let them in or Ban for 12 hours. A room holds exactly two players, so once your friend is in, nobody else can join.

The match starts

Both screens now show Securing the session while the two devices agree on keys that only they hold. A coin flip that neither device can steer picks the first dealer, and the cards are shuffled and dealt face down by both devices together, in seven short steps. From then on you play exactly as against the computer: the same rules, the same table, and the same room settings for both of you.

Public rooms and rankings

A public room is listed in the lobby under Public rooms while its host waits for an opponent. Each entry shows the host’s name and tag, the number of rounds, the two settings (×2 at 8+ or No ×2 at 8+, With hints or No hints), the code, and password when it has one. Press Join to open its join page.

So to play someone new, create a public room and wait, or join one from the list. A room leaves the list as soon as a guest is let in, and comes back when the guest has gone.

The lobby also shows Rankings: the top ten players, with their wins, losses and total points, and a gold crown beside the leader. Players are ranked by wins, then by fewer losses, then by total points (the points each match ended above the 25 it started with, added up). Only online matches count, never practice games, and only when both players’ devices sign the same result: the server checks that the two agree and adds the match to each player’s record once. A match one of them does not confirm counts for neither, as the lobby says under the table.

Room settings

The host chooses two settings with the room. They are fixed when the room is created, shown to your friend before they join, and bound into the encrypted session, so both devices score alike and show the same help.

Double at 8+ points (on by default)
On: a round worth 8 points or more is doubled, and koi-koi calls multiply it as well. Off: nothing doubles for its points, and only koi-koi calls multiply a round.
Assisted highlighting (on by default)
On: hand cards that can capture shine, a picked card lights up its matches, and a bar over your captures shows what each play would do: the points it adds, the yaku it brings closer, the opponent’s yaku it blocks. Off: nothing on the table shows which cards match; you find them yourself, as at a real table.

Everything else is the same in every room. Each player starts with 25 points and the loser of a round pays the winner (the points pool), every koi-koi call by either player raises one shared multiplier (the multiplier), and the Sake cup counts only as an animal (the Sake cup).

Fair play, in plain words

Somebody has to shuffle a deck played over the internet. Here nobody does it alone: the two devices shuffle together, check each other’s every move, and use the server only as a post office that cannot open the letters.

Your device

  • Unlocks your own cards only
  • Encrypts and signs each move
  • Checks every move of your friend

Server (relay and archive)

  • Passes on locked cards and encrypted moves
  • Keeps the room, the players and the result
  • Cannot read a card or a move

Your friend’s device

  • Unlocks their own cards only
  • Encrypts and signs each move
  • Checks every move of yours

Moves are signed by one device and counter-signed by the other

The server passes everything on and keeps the record, but only the players’ two devices hold the keys.

The shuffle

At the start of each round the two devices shuffle the deck in turn, each locking every card with secret keys of its own. This is a known method called mental poker. A card can be read only when both players’ keys for it come together: your device gets the keys for your own hand, so only you see your cards, and a card you play is opened for your friend as you play it. Neither player can choose the deal, and the server holds no key at all.

Each step of the shuffle also carries a zero-knowledge proof: it shows that the step was done honestly (the same cards, only reordered and locked again) without revealing the new order or the keys. The other device checks the proof before it accepts the step, so a tampered deck is refused on the spot, before anyone can learn a card from it, and its author is named. When the round ends, both devices still reveal their keys and go over each other’s steps a second time. If a match ends early, in the middle of a deal, the winner’s device reveals its keys for that deal too, and the other device checks them before it confirms the result.

Every move

Each move is encrypted on your device, signed with a key made for this match only, and chained to the move before it. Your friend’s device replays it with the same rules engine. If the move is legal, it signs it too, and only then does the move count. A move, once shown to the other device, can never be taken back: if it is refused, it is sent again exactly as it was, and if it is refused a second time, or a move proves cheating, the match stops as disputed and counts for nobody. Because every move carries both players’ signatures, neither of you can later deny or rewrite it.

For the technically minded: the keys come from a post-quantum key exchange (X-Wing, which combines ML-KEM-768 with X25519), moves are encrypted with XChaCha20-Poly1305 and signed with Ed25519, and a room’s password, stretched with scrypt, also goes into its keys. Everything else the two devices send each other (the answers to moves, the connection details, the end of the match and its result) is encrypted and signed the same way. To rule out anyone in the middle, press the lock icon at the table and compare the security code, five emoji, with your friend over another channel: it must be identical on both screens.

What the server sees

What the server can and cannot see during an online match
The server seesThe server never sees
Your Google sign-in, profile name, avatar and tagYour cards, or your friend’s
The room: its code, settings, host and guestThe order of the draw pile
Whether the room has a password (it keeps only a check value made with scrypt)What any move was
Who is connected, and since whenThe keys of your session
The encrypted, signed moves, relayed while the browsers are not connected directly, and archived with a 30-day expiryYour security code
How each match ended, and the result both devices signed

Direct connection. Every match connects the two browsers directly (WebRTC): they send the same encrypted, signed moves to each other instead of through the server, so each player can see the other’s IP address. To keep yours hidden, switch on Hide my IP address in Settings: your side then connects only through a relay server, or, where the game has none, through its server. Until the direct connection is up, and whenever it drops, the moves go through the server, still encrypted and signed, and the game keeps trying to connect directly by itself. The lightning icon beside the lock at the table shows how the moves travel.

What all this cannot do: make a player move (that is what the turn clock is for), or make a player confirm a result. A match counts for the rankings only when both players’ devices confirm the same result; one they do not both confirm counts for neither player.

If someone stops playing

Online, the move a player owes is timed. The player who owes it sees nothing for the first 45 seconds; on the other screen a quiet ring slowly fills around their avatar. A drawn card with only one possible capture is taken for its owner after 5 seconds, so it never holds up the game.

  1. 0 s
    Thinking timeOnly a quiet ring on the other screen
  2. 45 s
    “Away?” and a countdownBoth players see it
  3. 75 s
    Claim winThe waiting player may claim
While a move is owed, a quiet ring fills around that player’s avatar on the other screen. At 45 seconds it turns amber, their seat reads “Away? Claim in 0:30”, and they get a countdown of their own. After 75 seconds the waiting player may claim the win; it is never automatic.

At 75 seconds you get a panel with Claim win, which asks you to confirm, and Keep waiting, which hides it for a minute; meanwhile a Claim win button stays in the toolbar. A claim ends the match on both screens, and counts once the other player’s device confirms it, which it does only when that player was there as the claim came and its own records show the move it owed at that point waiting that long (and never for a claimant who itself kept that player waiting as long). Otherwise the match counts for neither player, and their result says why.

The clock also runs while your friend’s device has not confirmed your last move (“Waiting for Hana to confirm your move”), and it counts from when the wait began, by the server’s clock. A claim then ends the match too, but the other device keeps no record of owing an answer (it answers every move that reaches it), so such a claim counts for neither player. A player who comes back after being offline always gets at least 30 seconds before a claim.

Disconnects and reloads

If a player’s connection drops, the other screen counts down the time they have to come back: “Hana disconnected · 2:41 to come back”. That is 3 minutes, timed by the server. Back in time, the match goes on where it was. After that, the player who stayed can press Claim win or keep waiting; nothing happens by itself. The win counts once the absent player is back and their device confirms it, so a player who never comes back leaves the match unrecorded for both.

Reloading the page, closing the tab or the app, or restarting the device is safe. The match keys are kept on your device, encrypted, for up to 7 days, and the next time you open the game in the same browser it takes you back to the room, where the match picks up where it was. They are kept nowhere else: a match started in one browser cannot go on in another, or on another device (on an iPhone or iPad, Safari and the Home Screen app count as two). There, the only choice is to resign, and the match then counts for neither player. Opening the room in a second tab shows Play here, which moves the match to that tab. Signing out removes the saved matches from the device.

After the match

When the match ends, both players see the result. The host can press Keep the room open: the room goes back to waiting with the same code, and your friend opens the invite link again to start another match. Close room ends it, unless your friend was away when the match ended and has not confirmed the result yet: the room then stays open without an opponent, keeping how the match ended for them, until you close it from the lobby or let another player in. To stop in the middle, press Resign (the flag in the toolbar) and your friend is awarded the win, once both devices have confirmed it; leaving the room or signing out during a match resigns too, after asking first. Signing out also removes the saved matches from your device: it first gives their results a few seconds to be confirmed, and a resignation not confirmed by then counts for neither player.

Under the result, a line says where it stands: Confirmed by both players, Waiting for Hana to confirm — it is recorded when they do, or Not recorded with the reason. Your device keeps trying to finish that step after you leave the room, and the next times you open the game, for up to 7 days.

An opponent who cut a match short (walked out, resigned, stayed away until you claimed, stopped the match with a dispute, or claimed a win your device did not confirm) goes on a list kept only in your browser. If they later ask to join a room you host, you are told what happened and decide between Let them in and Ban for 12 hours.

Troubleshooting

“The browser blocked the sign-in window.”
Allow pop-ups for this site, then press Sign in with Google again. In the installed app, sign-in opens as a page of its own instead of a window.
The link opened inside a chat or social app
Some apps open links in their own viewer. If signing in does not work there, open the link in Safari or Chrome (in the app’s menu, look for an option such as “Open in browser”).
“There is no room ABC234. The host may have closed it.”
The host closed the room, or created a new one, which closes the old. Ask for a fresh link.
“A match is in progress in this room.”
Someone is already playing there. Press Check again once it is free.
“Wrong password.”
The password must be typed exactly as the host set it, capitals included.
“Someone else took the seat first.”
In a public room, another player was let in first. Pick another room, or create one.
“Waiting for your opponent to confirm…” stays on screen
Every move waits for the other device’s signature. If this stays, your friend’s connection is slow or gone; if they are offline, the 3-minute countdown starts, and if they are online but their device does not answer, the turn clock runs for them.
“You are offline. Online play resumes when you reconnect.”
Your own connection dropped. Reconnect within 3 minutes to be sure of keeping the match; meanwhile you can still read the rules.

More answers are in the FAQ, and the privacy policy lists everything the game keeps.

Sources

  1. こいこい|花札の歴史・遊びかた. Nintendo: Nintendo’s rules: the first dealer by drawing cards, and the doubling at 7 points
  2. こいこい. Wikipedia (Japanese): how the first dealer is usually chosen
  3. Koi-Koi. Fuda Wiki: common variants, such as zero-sum scoring