Portable Chess Notation (PCN) Specification
- Version: 1.0.0
- Author: Sashité
- Published: June 10, 2025
- License: MIT License
Overview
Portable Chess Notation (PCN) is a comprehensive, JSON-based format for representing complete chess game records across variants. PCN leverages the Sashité ecosystem specifications, using CELL for multi-dimensional coordinates, HAND for reserve locations, QPI for piece identification, PMN for move representation, and FEEN for position representation, creating a unified and rule-agnostic game recording system.
PCN supports both traditional single-variant games and modern cross-variant scenarios where different players use different game systems.
Terminology
For complete definitions of terms used in this document, see the Glossary.
Dependencies
PCN builds upon five foundational Sashité specifications:
- CELL: Multi-dimensional coordinate encoding for board positions
- HAND: Reserve location notation using
"*"
for off-board areas - QPI: Qualified Piece Identifier for unambiguous piece identification
- PMN: Portable Move Notation for mechanical move decomposition
- FEEN: Forsyth-Edwards Enhanced Notation for complete position representation
These specifications define the standardized formats that PCN uses for coordinate identification, reserve management, piece representation, move encoding, and position description.
Design Principles
- Ecosystem Integration: Native use of CELL, HAND, QPI, PMN, and FEEN specifications
- Rule-Agnostic: No embedded game logic or validation
- Cross-Game Ready: Native support for hybrid game scenarios
- Comprehensive: Complete game state representation
- FEEN-Centric: Direct use of FEEN for all position representation
- Multi-Dimensional Support: Via CELL coordinates for 3D and higher-dimensional games
- Reserve-Aware: Via HAND notation for capture-and-drop mechanics
JSON Structure
{
"meta": {
"name": "<string>",
"event": "<string>",
"location": "<string>",
"round": "<integer>",
"started_on": "<date>",
"finished_at": "<datetime>",
"href": "<url>"
},
"sides": {
"first": {
"name": "<string>",
"elo": "<integer>"
},
"second": {
"name": "<string>",
"elo": "<integer>"
}
},
"setup": "<feen_position>",
"moves": [
[<pmn_element>, <pmn_element>, <pmn_element>, ...],
...
],
"state": {
"status": "<status>",
"winner": "<winner>"
}
}
Field Specifications
Meta Section (Optional)
Standard game metadata following common conventions.
Field | Type | Description |
---|---|---|
name |
string | Game or opening name |
event |
string | Tournament or event name |
location |
string | Venue or location |
round |
integer | Round number (≥ 1) |
started_on |
date | Game start date (ISO 8601) |
finished_at |
datetime | Game completion timestamp (ISO 8601) |
href |
url | Reference URL |
Sides Section (Optional)
Player information for each side:
Field | Type | Description |
---|---|---|
first |
object | First player information |
second |
object | Second player information |
Player Object Fields:
Field | Type | Description |
---|---|---|
name |
string | Player name or identifier |
elo |
integer | Elo rating (≥ 0) |
Player-Style Association
The association between players and style casing remains fixed throughout the game:
- First player: Always associated with uppercase style identifier and uppercase pieces
- Second player: Always associated with lowercase style identifier and lowercase pieces
This association follows the conventions established by Style Identifier Notation (SIN):
First player’s style (uppercase style identifier):
- Native pieces: Uppercase pieces without derivation marker (e.g.,
K
,Q
,R
) - Derived pieces: Lowercase pieces with derivation marker (e.g.,
k'
,q'
,r'
)
Second player’s style (lowercase style identifier):
- Native pieces: Lowercase pieces without derivation marker (e.g.,
k
,q
,r
) - Derived pieces: Uppercase pieces with derivation marker (e.g.,
K'
,Q'
,R'
)
This enables cross-style scenarios where captured pieces retain their original casing while being controlled by the capturing player.
Turn Indication
The order of styles in the FEEN position indicates whose turn it is:
- When the uppercase style appears first:
C/c
→ First player to move - When the lowercase style appears first:
c/C
→ Second player to move
This dual function enables both style attribution and turn identification, supporting hybrid configurations where different players use different piece systems.
Examples
C/c
- Chess first player (uppercase pieces) to moves/S
- Shōgi second player (lowercase pieces) to moveX/o
- Xiangqi first player (uppercase pieces) to move (in a hybrid game)
Setup Section (Required)
Initial game configuration using Forsyth-Edwards Enhanced Notation (FEEN):
Field | Type | Description |
---|---|---|
setup |
string | Complete FEEN position string |
This approach provides several advantages:
- Native FEEN integration: Direct use of the established position format
- Irregular board support: Automatic support for non-standard board shapes
- Multi-dimensional support: Native support for 3D and higher-dimensional games
- Pieces in hand: Captured pieces automatically represented in FEEN format
- Turn information: Current player and style identification embedded in FEEN
- Canonical representation: Leverages FEEN’s canonical position format
Important: All piece identifiers must use ASCII letters (a-z, A-Z) as required by the Extended Piece Identifier Notation (EPIN) specification.
Moves Section (Required)
Sequence of game moves using Portable Move Notation (PMN) format. Each move is a PMN array representing one player’s complete turn.
Move Array Structure: Each element in the moves array is a PMN sequence representing the complete mechanical decomposition of one player’s turn.
State Section (Required)
Current game state:
Field | Type | Description |
---|---|---|
status |
string | Current game status |
winner |
string or null | Game winner when finished, null for draws |
Game Status Values:
"in_progress"
- Game ongoing"checkmate"
- King in checkmate"stalemate"
- No legal moves available"bare_king"
- King remains after all friendly pieces captured"mare_king"
- King captured"resignation"
- Player resigned"illegal_move"
- Loss due to illegal move"time_limit"
- Time limit exceeded"move_limit"
- Draw due to move limit reached"repetition"
- Position repeated (draw by repetition)"mutual_agreement"
- Draw by mutual agreement
Winner Values:
"first"
- First player (uppercase style) wins"second"
- Second player (lowercase style) winsnull
- Game ends in draw
Examples
Standard Chess Game
{
"meta": {
"name": "King's Gambit",
"event": "Club Championship"
},
"sides": {
"first": {"name": "Alice", "elo": 1650},
"second": {"name": "Bob", "elo": 1720}
},
"setup": "+rnbq+kbn+r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/+RNBQ+KBN+R / C/c",
"moves": [
["e2", "e4"],
["e7", "e5"],
["f2", "f4"],
["e5", "f4"]
],
"state": {
"status": "in_progress",
"winner": null
}
}
Completed Chess Game with Checkmate
{
"sides": {
"first": {"name": "Alice"},
"second": {"name": "Bob"}
},
"setup": "+rnbq+kbn+r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/+RNBQ+KBN+R / C/c",
"moves": [
["e2", "e4"],
["e7", "e5"],
["d1", "h5"],
["b8", "c6"],
["f1", "c4"],
["g8", "f6"],
["h5", "f7"]
],
"state": {
"status": "checkmate",
"winner": "first"
}
}
Cross-Game: Chess vs Xiangqi
{
"sides": {
"first": {"name": "Chess Player"},
"second": {"name": "Xiangqi Player"}
},
"setup": "+rnbq+kbn+r/+p+p+p+p+p+p+p+p/8/8/8/PPPPPPPP/2C2C2/RHBEKBHR / C/x",
"moves": [
["e3", "e4"],
["e7", "e5"]
],
"state": {
"status": "in_progress",
"winner": null
}
}
Mare King Victory
{
"sides": {
"first": {"name": "Alice"},
"second": {"name": "Bob"}
},
"setup": "+rnbq+kbn+r/+p+p+p+p+p+p+p+p/8/8/8/8/+P+P+P+P+P+P+P+P/+RNBQ+KBN+R / C/c",
"moves": [
["e2", "e4"],
["f7", "f6"],
["d1", "h5"],
["g7", "g6"],
["h5", "e8"]
],
"state": {
"status": "mare_king",
"winner": "first"
}
}
Relationship with Other Specifications
PCN serves as the comprehensive game recording layer in the Sashité ecosystem:
Specification | Relationship to PCN |
---|---|
CELL | Core dependency: Provides multi-dimensional coordinate format for board locations in PMN moves |
HAND | Core dependency: Provides reserve location notation ("*" ) for capture-and-drop mechanics in PMN |
QPI | Core dependency: Provides piece identification format throughout moves and positions |
PMN | Core dependency: Represents each player’s turn as atomic action sequences using CELL and HAND |
FEEN | Core dependency: Provides initial setup and enables position reconstruction |
SIN | Inherited through QPI/FEEN: Distinguishes different piece systems and variants |
PIN | Inherited through QPI: Foundation for piece identification with state modifiers |
PCN unifies these specifications to provide complete game documentation, ensuring that any recorded game can be fully reconstructed, analyzed, and shared across different implementations and platforms with full support for multi-dimensional boards and reserve-based mechanics.
JSON Schema
Schema URL: https://sashite.dev/schemas/pcn/1.0.0/schema.json
Reference Implementations
This section lists available libraries and tools that implement the PCN specification.
Ruby
- PCN.rb - Implementation of the Portable Chess Notation specification for Ruby.