Sashité for Developers
  1. Sashité for Developers
  2. Rules
  3. Sanki

Sanki

Rule System for Sanki built on the Game Protocol.

Sanki is the game played on Sashité: one 8×8 board on which each player brings the army and the rules of one of three variants — Chess, Ōgi or Xiongqi. Two players of the same variant play that variant exactly as its own page defines it; two players of different variants play a cross-variant game, and this page defines what happens where the two rule sets meet — captures, hands and drops, promotion, en passant, castling, and the endings. Everything a piece does on its own is its variant’s rule; everything that involves the other player’s pieces is Sanki’s.

In the Sashité Nostr suite, a Sanki session declares game: sanki and one variant per player (chess, ogi, xiongqi); the same three identifiers name standalone games when played alone.


1. Board

One 8×8 grid encoded in CELL, shared by both variants. The first player’s home ranks start at rank 1 and their last rank is 8; the second player’s start at rank 8 and their last rank is 1 (two home ranks for Chess and Xiongqi, three for Ōgi — §4). The river of Xiongqi (between ranks 4 and 5) exists for a Xiongqi Soldier whatever the opponent’s variant.


2. Variants and Styles

Each player chooses a variant; the variant’s Style is that player’s Style, encoded in SIN and carried by the FEEN Style–Turn field.

Variant Style SIN (first / second) Page
chess Western W / w Chess
ogi Japanese J / j Ōgi
xiongqi Chinese C / c Xiongqi

The Style–Turn field reads <ACTIVE>/<INACTIVE>: uppercase is the first player’s style, lowercase the second player’s, and the left-hand token is the player to move. A Chess (first) versus Ōgi (second) game is therefore written W/j when the first player is to move and j/W when the second is; both forms describe the same game, and every rule on this page is turn-independent.

Six pairings. Three same-variant pairings (chess+chess, ogi+ogi, xiongqi+xiongqi) and three cross-variant ones (chess+ogi, chess+xiongqi, ogi+xiongqi), each playable with either variant in either seat. A same-variant game is governed entirely by its variant’s page; this page adds nothing to it beyond the universal rules of §9.


3. Pieces

A piece is encoded in EPIN; its Style is the native style of its camp: an uppercase token is a first-player piece and moves by the first player’s variant, a lowercase token by the second player’s. No derivation marker or other modifier is needed — the case, read with the Style–Turn field, resolves every piece.

The three vocabularies were chosen so that they never collide on the shared board:

Letter Chess Ōgi Xiongqi
K^ King King —
G^ — — General
Q Queen — —
G — Gold General —
E — — Empress
R Rook Rook Chariot
B Bishop Bishop Bear
N Knight Knight (shōgi) Knight
L — Lance —
S — Silver General Soldier
P Pawn — —
F — Fu —

R and B are shared and move identically in all three variants; K^ is shared by Chess and Ōgi. N and S are shared with different movements by camp: the Ōgi Knight is the shōgi Knight (two squares forward and one aside, never back), the Ōgi Silver is not the Xiongqi Soldier. Every other letter identifies its variant on its own: a P is always a Chess Pawn, an F always an Ōgi Fu. G and G^ share a letter but never a token: a G is always the Ōgi Gold General (+G its promoted form, the Free Gold), a G^ always the Xiongqi General.

The state markers are the union of the variants’ — -K^/-G^ (royal in check), +R/-R (castling immediately performable / retained but blocked, on a Chess Rook or a Chariot), +P/+S (double-step eligible), -P/-S (just double-stepped and legally capturable en passant) — with the same meaning in every pairing; on an Ōgi piece + is not transient state but the piece’s promotion (+F the Tokin, +L, +N, +S the Gold movers, +G the Free Gold, +B the Horse, +R the Dragon), permanent on the board and removed only at capture. The transient markers are maintained by the canonicalizer after every move and never survive a capture (§5).


4. Initial Position

The initial position is assembled from each variant’s home ranks — two for Chess and Xiongqi, three for Ōgi. For a first player of variant A and a second player of variant B, the FEEN is

<B's home ranks, from rank 8 down> / <empty ranks> / <A's home ranks, down to rank 1>  <hands>  <A>/<b>
Variant First player (from rank 3 or 2 down to rank 1) Second player (from rank 8 down)
Chess +P+P+P+P+P+P+P+P/-RNBQK^BN-R -rnbqk^bn-r/+p+p+p+p+p+p+p+p
Ōgi FFFFFFFF/1B4R1/LNS+GK^SNL lns+gk^snl/1r4b1/ffffffff
Xiongqi +S+S+S+S+S+S+S+S/-RNBEG^BN-R -rnbeg^bn-r/+s+s+s+s+s+s+s+s

The Ōgi Bishop stands on each player’s left and the Rook on their right, as in shōgi, so the second player’s second rank is 1r4b1, not the lowercase of 1B4R1; the King and the Gold General keep the files e and d in both camps. Against Chess or Xiongqi, as in the table, the Gold General starts promoted, as the Free Gold (+G); in ogi+ogi it starts unpromoted (lnsgk^snl/1r4b1/ffffffff/8/8/FFFFFFFF/1B4R1/LNSGK^SNL / J/j). Chess (first) versus Ōgi (second), first player to move:

lns+gk^snl/1r4b1/ffffffff/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / W/j

Every Chess Pawn and Xiongqi Soldier starts double-step eligible (+), every Chess Rook and Chariot with its castling right retained but not yet performable (-R: the path is obstructed); the Ōgi tokens are bare but the Free Gold’s +G; both hands empty. The position is deterministic: the rule system prescribes it, and a session’s founding carries no other.


5. Movements and Captures

Each piece moves and captures by its own variant’s rules, against the full board — a Chess Bishop is blocked by an Ōgi Fu exactly as by a Pawn, a Xiongqi General’s Chariot-range capture reaches an Ōgi Rook, and the “flying general” line is checked against whatever stands between the two royals. The movement tables of the three variants are published as GGN documents (§10).

5.1 Capture mutation

What a captured piece becomes in the capturer’s hand depends on the capturer’s variant, in two steps:

  1. Base form — the transient +/- markers are stripped and an Ōgi promoted piece is demoted (+F → F, +L → L, +N → N, +S → S, +G → G, +B → B, +R → R), case preserved. (This is the hand canonicalization of every variant page: a piece in hand never carries a marker.)
  2. Conversion —
Capturer Captured piece Result in the capturer’s hand
Chess any base form, case preserved — the piece stays in the opponent’s camp: inert
Xiongqi any base form, case preserved — inert
Ōgi an Ōgi piece base form, case flipped to the capturer’s camp — droppable
Ōgi a Chess or Xiongqi piece replaced by an Ōgi Fu in the capturer’s camp — droppable

Three principles: Chess and Xiongqi never convert; Ōgi captures of Ōgi pieces flip side; Ōgi captures of foreign pieces become Fu, the original type discarded. A royal is never captured — check decides (§9) — so K^/G^ never enters a hand.

5.2 Hands

Both players hold a hand, part of the canonical position (§8). A piece is droppable if and only if its case matches the holding player’s side (the universal drop rule). A Chess or Xiongqi player’s hand is therefore write-only and inert; an Ōgi player’s hand holds only droppable pieces — in cross-variant play, exclusively Fu.


6. Drops

Only an Ōgi player drops. A drop places a held piece on an empty square, in its hand form, always unpromoted: a dropped Fu is F, never +F, and a drop never promotes even inside the zone. The restrictions apply as in Ōgi — no Fu or Lance on the player’s last rank, no Knight on its last two, nifu (no second unpromoted Fu of the same side on a file), uchifuzume (a Fu drop may give check but not checkmate) — and hold against the opponent’s royal whichever variant it belongs to.

A dropped piece may block or unblock the opponent’s castling path, and may attack a royal’s transit square; the Rook or Chariot markers follow (§7).


7. Promotion, en passant and Castling

Promotion is each variant’s own. A Chess Pawn reaching the last rank becomes a Queen, Rook, Bishop or Knight of the player’s choice; a Xiongqi Soldier reaching the last rank becomes a Chariot, Knight, Bear or Empress of the player’s choice. An Ōgi piece promotes by the zone rule of Ōgi §8: a board move that starts or ends in the mover’s last three ranks may promote it — the mover chooses — and must where the unpromoted piece would have no move left (a Fu or a Lance on the last rank, a Knight on the last two); every Ōgi piece but the King promotes, to a single + form each (in a cross-variant pairing the Gold General starts as +G). A promoted piece that is later captured is treated as any other piece of its variant (a promoted Chess Queen captured by an Ōgi piece becomes a Fu; an Ōgi Dragon captured by anyone demotes to a Rook).

En passant is asymmetric, keyed on the capturer’s own mechanism and open to any double-stepped foot soldier as victim:

Capturer Chess Pawn (victim) Ōgi Fu (victim) Xiongqi Soldier (victim)
Chess Pawn — diagonally forward onto the skipped square yes never (a Fu never double-steps) yes
Ōgi Fu never (a Fu captures straight only) — never
Xiongqi Soldier — sideways onto the skipped square, past the river yes never (a Fu never double-steps) yes

The victim is the enemy foot soldier standing one rank beyond the skipped square, in its own marching direction; it carries the - marker only when such a capture is legal on the next ply (the canonicality condition of each variant page), so in a Chess-versus-Ōgi game a Pawn’s double step never sets -P, and no Fu ever carries one.

Castling is available to the Chess and Xiongqi players, each with their own royal and their own Rook or Chariot, under the mechanically identical conditions of their pages: royal and rook unmoved, the squares between them empty, the royal neither in check nor crossing nor landing on an attacked square — attacked by any enemy piece, of either variant. The rook’s marker (+R performable, -R retained, R lost) is recomputed after every ply, so a drop or a capture by the other variant is reflected immediately. The Ōgi player never castles: an Ōgi Rook carries no castling marker, and +R on an Ōgi Rook is the Dragon.


8. Position Identity

Two positions are the same when their canonical FEEN strings are equal — board, both hands, side to move and Style–Turn field, and every transient marker included. The hands count even when inert: a Chess player who has captured a Fu is not in the same position as one who has not.


9. Termination

Status values from CGSN, identical in every pairing. A game has exactly one of three results — 1–0, ½–½, or 0–1; there are no partial results.

9.1 Decisive

CGSN Status Result
checkmate The player to move is in check with no legal move — including drops — that escapes it; they lose. Self-check is illegal for both royals, so neither is ever captured.
resignation Resigning player loses
timeout The player whose clock expired loses (a session-level ending: time controls are an application concern, accounted per the deployment’s rules)

9.2 Draw

CGSN Status Condition
nomove The player to move has no pseudo-legal move at all; tested before checkmate and stalemate, and takes precedence even in check (CGSN §9.1)
stalemate No legal move (drops included), not in check
insufficient Dead position, by pairing — see below
repetition The same canonical position (§8) occurs a third time
movelimit 50 full moves by each player (100 half-moves) with no capture and no move of an unpromoted foot soldier (Pawn, Fu or Soldier); a drop does not reset the count
movecap 300 full moves (600 half-moves) played and the game still ongoing — an absolute ceiling that never resets; a decisive 600th half-move stands
agreement Mutual agreement

Dead positions are detected on material only, and the detected set depends on the pairing:

Pairing Detected dead positions
chess+chess K vs K · K+B vs K · K+N vs K · Kings and Bishops only with all Bishops on same-colour squares (hands ignored, being inert)
xiongqi+xiongqi General vs General (any other material can build a cooperative mate, the General capturing at Chariot range)
ogi+ogi none — captured material stays droppable, so no materially dead position is reachable
any cross-variant pairing only the two royals remain on the board and no hand holds a droppable piece — an inert hand does not prevent the draw. This deliberately includes King versus General: a cornered General is matable in principle, but neither side can force a win, so the draw is declared outright rather than played out to a repetition

Order of classification. A position with no legal move is nomove, checkmate or stalemate before any background draw is considered; among the background draws, insufficient, then repetition, then movelimit, then movecap. A checkmate delivered on the ply that reaches a limit therefore stands.

Illegal moves are not a termination cause: a move rejected as illegal is simply refused — the player keeps the turn. The illegal moves of a cross-variant game are the union of the two variants’ (self-check for both royals included) plus the en passant asymmetry of §7.


10. Rule System and Kernel

Everything above is what a reader learns. What an implementation executes is Sanki’s rule system: a WebAssembly module, published by Sashité as a signed Nostr event that names it by digest, which every consumer of a session runs to obtain every rule answer — what is legal, what a move does, whether the position is terminal, how time is charged, which of a slot’s candidates is canonical, what the verdict is. The module embeds, for each variant, its complete movement table in GGN, its initial fragments, its promotion, capture and drop parameters, and, for each pairing, the dead-position predicates it enables. What it implements is the kernel — Kernel — Sanki — the fixed part: the effects of a move, the attack relation, the check, double-step, en passant and castling recompositions, royal safety, the drop restrictions, the terminations and their order, and the session-level rules (slots, clocks, the resolution of a conclusion). The kernel page is the specification the module was built to; the module is the rule.

A Sashité session names its rule system in its founding events, so that every consumer — a browser, a rating service, a bot — reaches the same verdict from the same public events by running the same bytes. A revised rule — a new table, a new threshold, a new kernel rule — is a new module, published as a new rule system. Sessions already founded keep theirs, for their whole life.


11. Reference


12. License

Open Web Foundation Agreement 1.0 (OWFa 1.0) — OWFa 1.0