Pawnshake v0.1.0 · draft

Reference

Rules profiles

Everything that is taste rather than protocol lives in a numbered profile signed into each game. WhitePawn's is whitepawn/1; your app can ship its own.

Protocol versus policy

How big a transit allowance is fair, how long to wait for a player who vanished, what leaving costs: reasonable apps disagree. So Pawnshake does not decide. The challenger writes concrete numbers for this game into CHALLENGE, the opponent signs them by accepting, and every verifier (the opponent's phone, the server, a checker years later) judges the game by those numbers, never by its own defaults. A device that sees a key it does not know declines the challenge.

Profile45 bytes for whitepawn/1 online, 47 with key 14
name length 1 B
name UTF-8 e.g. whitepawn/1
count varint
key, value varints repeated count times

The keys

ParameterKeyMeaning
j_min_ms1smallest transit allowance
j_rtt_mult2allowance as a multiple of the round trip
sample_window3transit samples per direction for the link estimate
pause_budget_ms4outage time forgiven per game, shared by both players
ping_interval_ms5live-check ping interval
rate_tolerance_ppm6allowed clock rate difference
checkpoint_interval_ms7presence checkpoints while online (hybrid)
away_after_ms8how long the game waits on an absent player
leave_with_arbiter9outcome for leaving when there is an arbiter: 0 cancel, 1 loss, 2 draw
leave_offline10the same without an arbiter
free_first_moves11the first move of each side costs no clock
takebacks12takeback offers allowed
report_wait_days13how long a pending game waits for the second report
link_settle14samples per direction that set the transit floors after a LINK

link_settle is written only into games with peer clocks, so the profile of an online (full) game keeps its bytes.

A loss for leaving becomes a draw when the remaining player cannot mate, as for a flag.

whitepawn/1

The values WhitePawn writes into every game. Speeds follow the usual estimate initial + 40 × increment: bullet under 3 minutes, blitz under 8, rapid under 25, classical above.

KeyBulletBlitzRapidClassical
j_min_ms30
j_rtt_mult2
sample_window16
pause_budget_ms2 0005 00010 00020 000
ping_interval_ms250
rate_tolerance_ppm1 000 (0.1 %)
checkpoint_interval_ms10 000
away_after_ms15 00030 00060 000120 000
leave_with_arbiter1: the leaver loses
leave_offline0: canceled
free_first_moves1
takebacks1 in casual games, 0 in rated games
report_wait_days7
link_settle4 (nearby and offline games only)

What that means for players

Online

Games with a full arbiter: the player who goes away loses, or draws if the other cannot mate.

Nearby (hybrid)

A game whose phones have a Bluetooth link at the challenge. Staying silent on your own turn past the deadline loses on time. Leaving before your turn started loses only when the server can prove it (you were online, had the move and did not answer); otherwise, and when you cut every link before the deadline, the game is canceled. Losing the internet never ends or costs the game, and one played completely offline is saved the next time a phone is online.

Offline

Games without an arbiter: if one player hops off, the game is canceled. It is still uploaded and saved in both collections, unrated, with all its moves.

Outages up to the pause budget are paused time; longer ones cancel an offline game unless both players resume.