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 variantsChess, Ō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 are 1–2 and their last rank is 8; the second player’s home ranks are 7–8 and their last rank is 1. 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 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
I Princess
E Empress
R Rook Rook Chariot
B Bishop Bishop Bear
N Knight Knight Knight
P Pawn
F Fu
T Tokin
S Soldier

R, B and N are shared and move identically in all three variants; K^ is shared by Chess and Ōgi. Every other letter identifies its variant on its own: a P is always a Chess Pawn, an F always an Ōgi Fu, an S always a Xiongqi Soldier.

The transient state markers are the union of the variants’ — -K^/-G^ (royal in check), +R/-R (castling immediately performable / retained but blocked, on a Rook or a Chariot), +P/+F/+S (double-step eligible), -P/-F/-S (just double-stepped and legally capturable en passant) — with the same meaning in every pairing. They 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 two home ranks. For a first player of variant A and a second player of variant B, the FEEN is

<B's ranks 8–7> / 8/8/8/8 / <A's ranks 2–1>  <hands>  <A>/<b>
Variant First player (ranks 2–1) Second player (ranks 8–7)
Chess +P+P+P+P+P+P+P+P/-RNBQK^BN-R -rnbqk^bn-r/+p+p+p+p+p+p+p+p
Ōgi +F+F+F+F+F+F+F+F/-RNBIK^BN-R -rnbik^bn-r/+f+f+f+f+f+f+f+f
Xiongqi +S+S+S+S+S+S+S+S/-RNBEG^BN-R -rnbeg^bn-r/+s+s+s+s+s+s+s+s

Chess (first) versus Ōgi (second), first player to move:

-rnbik^bn-r/+f+f+f+f+f+f+f+f/8/8/8/8/+P+P+P+P+P+P+P+P/-RNBQK^BN-R / W/j

Every foot soldier starts double-step eligible (+), every Rook and Chariot with its castling right retained but not yet performable (-R: the path is obstructed), 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 Tokin is demoted to a Fu (TF), 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 preservedinert
Ō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 current (unpromoted, unmarked) form: a dropped Fu is F, never +F. The Fu’s three restrictions apply as in Ōgi — no drop on the player’s last rank, nifu (no second unpromoted Fu of the same side on a file, whatever its marker), 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 either player’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, on the same zone — the mover’s last rank, reached by a forward move: a Pawn becomes a Queen, Rook, Bishop or Knight of the player’s choice; a Fu becomes a Tokin, automatically; a Soldier becomes a Chariot, Knight, Bear or Empress of the player’s choice. 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).

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 yes yes
Ōgi Fu never (a Fu captures straight only) never
Xiongqi Soldier — sideways onto the skipped square, past the river yes yes 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, while a Fu’s sets -F whenever a Pawn can take it.

Castling is available to both players, each with their own royal and their own Rook or Chariot, under the mechanically identical conditions of the three 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. A Rook dropped from hand never carries a castling right.


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 content-addressed manifest (sashite.sanki.rules/1) carrying, 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 — together with the identifier and digests of the kernel that reads them. The kernel — Kernel — Sanki — is 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).

A Sashité session names its rule system by SHA-256 in its founding events, so that any two implementations of the kernel reach the same verdict from the same public events. A revised rule — a new table, a new threshold — is a new manifest; a revised kernel rule is a new kernel identifier. Sessions already founded keep theirs.


11. Reference


12. License

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