Pawnshake v0.1.0 · draft

Security

Attack gallery

Every trick a cheater could try, why it fails, and what it costs. Red: the cheater loses. Amber: the game ends without a result. Grey: the record is void. Green: the trick gains nothing.

All 34 attacks at a glance

Lying about moves

Two-faced move

signer loses

The trick

Send Qh5 to the opponent and Nf3 to the server, then show whichever helps.

Why it fails

Both are signed records with the same seq. The opponent holds one, the server the other: two different headers for one number.

One number, two stories.
Cheater Server Opponentseq 3: Qh5seq 3: Nf3two headers, one seq → fork Cheater Server Opponentseq 3: Qh5seq 3: Nf3two headers, one seq → fork

Outcome Fork. The cheater loses the game.

Changing your mind

signer loses

The trick

Send a move, then quickly send a different move with the same number, hoping the second replaces the first.

Why it fails

The opponent now holds two signed headers for one seq. Clients never re-sign: a resend is the stored bytes.

Outcome Fork. The cheater loses.

Edited report

signer loses

The trick

After the game, upload a chain with a better move at some point.

Why it fails

The edited record has the seq of a record the opponent (or the anchors) already holds, with a different header. When the reports or anchors meet, the pair is a fork.

Outcome Fork, as soon as the two versions meet.

Half a report

no gain

The trick

Upload only the part of the game before you started losing, or do not upload at all.

Why it fails

The server takes the union of every report and every anchor. The opponent received all your records (that is how the game went on) and uploads them.

Reports can only add.
Cheater Server Opponentmoves 1-20 onlymoves 1-41union: 1-41 Cheater Server Opponentmoves 1-20 onlymoves 1-41union: 1-41

Outcome No gain. The full game is saved.

Forging the opponent's record

record void

The trick

Make up a resignation from the opponent, or alter one of its moves.

Why it fails

Every record is signed with the opponent's device key, certified by the server. Without that key the signature fails.

Outcome The forged record is void.

Replaying a record

record void

The trick

Take the opponent's resignation from last week's game, or from earlier in this one, and send it again.

Why it fails

The signed header names the genesis hash (unique per game thanks to both nonces) and the seq, and the body names prev and seen. A record only fits its own spot.

Outcome Void: it fails or is a duplicate.

Claiming to have seen something

record void

The trick

Accept a draw offer the opponent never made, or claim to have seen a move that was never sent.

Why it fails

seen_hash must equal the id of the opponent's real record. A verifier rebuilds the body with its own copy, so the signature fails. And DRAW_ACCEPT is only valid if a real offer is in the signer's seen.

Outcome Void.

Resign race

no gain

The trick

Resign at the instant the opponent mates you, hoping your resignation 'counts first', or the other way round.

Why it fails

The canonical order breaks ties the same way on every device: moves before other records, White before Black, two crossing resignations make a draw.

Concurrent records, one answer.
Opponent CheaterRESIGNMOVE matecanonical order: the move first Opponent CheaterRESIGNMOVE matecanonical order: the move first

Outcome Deterministic. Both phones show the same result.

Engines that disagree

record void

The trick

Not an attack, a bug: two engines that list different legal moves would read the same byte as different moves.

Why it fails

Every move's signed body includes ply and the number of legal moves. A mismatch fails the signature at once.

Outcome No silent divergence. The record is refused on arrival.

Lying about time

Pre-anchoring every candidate

signer loses

The trick

When your turn starts, anchor all 20 possible next moves. Think a minute, play one, and point to its 'early' anchor as proof you moved instantly.

Why it fails

Anchors carry signed heads, and a head names its seq. Twenty candidates for one seq are twenty signed headers for one number.

Candidates anchored for seq 5: only one can exist.
…Nf3?seq 5 · anchored…Bc4?seq 5 · anchoredWhiteBlack…Nf3?seq 5 · anchored…Bc4?seq 5 · anchoredWhiteBlack

Outcome Fork. The cheater loses.

Anchoring a head off the chain

signer loses

The trick

Anchor a head now, but later reveal a chain where that seq holds a different record.

Why it fails

Every anchored head must lie on the revealed chain. One that does not is a second signed header for its seq.

Outcome Fork. The cheater loses.

Dating a move early (peer clocks)

disputed

The trick

Sign a move with an at that is earlier than when you really sent it, to save clock time.

Why it fails

Small lies hide inside the transit allowance J. Bigger ones fail the early-send check: you kept pinging after the time you claim to have sent the move.

Outcome At most J per move (tens of ms). More: DISPUTE, no result.

Acknowledging late (peer clocks)

disputed

The trick

Receive the opponent's move, think, and only then sign the ACK with a late time, so your thinking looks like transit.

Why it fails

The link is ordered: your pong to a ping sent after the move proves you already had the move.

The pong gives the lie away.
Opponent CheaterMOVEPINGPONGACK 'just arrived'pong came first → DISPUTE Opponent CheaterMOVEPINGPONGACK 'just arrived'pong came first → DISPUTE

Outcome At most J per move. More: DISPUTE.

A slow clock (peer clocks)

disputed

The trick

Run your device clock slightly slow, so every think time shrinks.

Why it fails

Pings measure the opponent's clock rate against your own.

Outcome At most 0.1 % of thinking time. More: DISPUTE.

Faking an outage (peer clocks)

canceled

The trick

Stop sending for a while to think 'off the clock', then claim the link dropped.

Why it fails

Excess transit comes out of one small pause budget per game (2 to 20 seconds). Beyond it the game is canceled.

Outcome The budget once. Then canceled, never a win.

Flag claim from the future

disputed

The trick

Claim the opponent flagged, stamping the claim with a time later than now.

Why it fails

The future check: no record may claim an at later than its arrival allows.

Outcome DISPUTE.

Silent past the flag (peer clocks)

signer loses

The trick

Let your clock run out, stay silent while the opponent claims the flag, then report a move dated just before the deadline: concurrent moves go first, so the claim would be void.

Why it fails

Your device kept sending signed heartbeats. One from after the deadline says your newest record was older, so a move dated before it contradicts your own signature.

Outcome Fork. The cheater loses.

no gain

The trick

Sit on the Bluetooth or LAN path and inject pings and pongs, so the opponent's live checks fail and the game ends disputed.

Why it fails

The link handshake: after the signed hellos every frame is sealed with keys only the two devices hold. A frame that does not open closes that link; the records still race on the others.

Outcome No effect on the game.

Refusing to acknowledge mate

canceled

The trick

Never ACK the mating move, hoping the game stays open or the mater looks late.

Why it fails

A missing ACK is an outage. The outage rules apply: paused up to the budget, then canceled.

Outcome Canceled at worst. Never a win for the one refusing.

Under-reporting think time (online)

no gain

The trick

Claim a tiny think time on every move, so the server refunds lots of 'lag'.

Why it fails

Refunds come from the lag quota: a few hundred ms per move, capped at 7 moves' worth.

Outcome Bounded by the quota, exactly as on a normal server.

Anchoring but holding back (online)

no gain

The trick

Anchor your move with the server (so your clock stops) but delay sending it to the opponent (so theirs does not start).

Why it fails

The server pushes every anchored record to the opponent's live session at once.

The server delivers what you anchor.
Cheater Server Opponentanchor + recordwithheldpushed anyway Cheater Server Opponentanchor + recordwithheldpushed anyway

Outcome No gain: the anchor is the delivery.

Anchoring the opponent's move late (online)

no gain

The trick

Anchor the opponent's move only after a delay, so it looks like they took longer.

Why it fails

The opponent anchored its own move when sending it. The earliest receipt counts.

Outcome No effect on the opponent's clock.

Leaving and presence

Walking away when losing (online)

signer loses

The trick

Close the app in a lost position so the game never ends.

Why it fails

The arbiter keeps the clock and sees it: the game waits on you and you are gone.

Outcome VERDICT_ABANDON. The leaver loses (a draw if the opponent cannot mate).

Walking away when losing (hybrid)

canceled

The trick

Close the app in a lost position, in a game whose server is only a witness.

Why it fails

On your own turn your clock keeps running: stay silent past the deadline and the opponent claims the flag, and your heartbeats stop a move dated in time later. Before your turn started, a loss needs your own checkpoints to prove it: the server delivered the move on your session, you signed a nonce after it, and you kept checking in without answering.

Outcome On your turn: a flag, or canceled if you cut every link before the deadline. Before it: VERDICT_ABANDON on proof; going quiet gives canceled. Never a win.

Faking the opponent's absence or presence

no gain

The trick

In a hybrid game, leave the opponent's records out of your checkpoints to make it look away, or submit its heads to make it look present and silent.

Why it fails

Absence never counts. Only the opponent's own checkpoints, sent over its own session or signed over a fresh server nonce, can show it held a record and did not answer.

Outcome No effect.

Holding back a relayed nonce (hybrid)

no gain

The trick

Your opponent has no connection of its own, so its checkpoint nonces travel through you. Drop them, so it looks absent.

Why it fails

Holding a nonce back only removes evidence, and missing evidence never counts against the player it is missing for. You cannot forge its signature either.

Outcome No effect.

Walking away when losing (offline)

residual

The trick

In a game with no arbiter, switch the phone off when losing.

Why it fails

Nothing can tell a walk-away from a dead radio without a referee. So the game is canceled, never won. Only a leaver whose clock runs out first can still lose it to a flag claim.

Outcome Canceled, still saved. Counted per account with the engine evaluation, for review.

False dispute

residual

The trick

Sign DISPUTE in a lost position to end the game without a result.

Why it fails

A DISPUTE always ends the game unrated, so it can never win. Each one is recorded with the position's evaluation.

Outcome No result. Counted per account, for review.

The start, the server and the device

Choosing your colour

no gain

The trick

Pick a nonce that makes you White.

Why it fails

Commit-reveal: A commits to its nonce before seeing B's; B picks without knowing A's. Neither can steer the hash.

Outcome A coin flip. A may refuse to START, which only cancels a game that never began.

A server dropping or reordering receipts

no gain

The trick

The server (or someone in front of it) quietly drops an awkward receipt.

Why it fails

Receipts of a game are chained through prev_receipt and both players keep theirs.

Outcome A gap is visible to both players.

Stolen device

no gain

The trick

Play rated games with someone else's phone.

Why it fails

Its certificate is revoked when the owner signs out everywhere; revocation is checked at anchoring and reporting.

Outcome Games signed by a revoked key are not rated.

Rating farming between own accounts

residual

The trick

Play yourself offline with two accounts and always let one win.

Why it fails

Signatures prove who signed, not that two people are different. This is the same problem as online collusion.

Outcome Out of the protocol's reach: handled by profile and server policy.

The honest limit

Pawnshake does not pretend an offline game can force a result. Without a referee, a losing player can always end it without one: walk away, fake a long outage, or sign a false dispute. The protocol makes sure that is the only thing it achieves (no win, no rating gain, the game still saved) and records it per account. Games that must have a winner should run online, where the server keeps the clock. A hybrid game adds evidence: a player shown to have had the move and not answered loses, but a missing checkpoint never decides anything.