org.lichess.puzzle.defs

Repository @pds.dad did:plc:rnpkyqnmsw4ipey6eotbdnnf not from the namespace authority
Details · defs
Kinddefs
Authoritypuzzle.lichess.org
Indexed

#puzzleView

object

The shared representation of a chess puzzle returned by the puzzle queries.

Properties

fen

requiredstring

the FEN string of the position before the opponent makes their move.

gameId

string

the unique identifier of the specific game and move the puzzle was extracted from. The game would be accessible at https://lichess.org/{GameId}

id

requiredstring

the id of the puzzle.

moves

requiredstring

the solution to the puzzle. All player moves of the solution are "only moves", i.e. playing any other move would considerably worsen the player position. An exception is made for mates in one: there can be several. Any move that checkmates should win the puzzle.

nbPlays

integer

the number of times a puzzle was played.

a list of openings. This is only set for puzzles starting before move 20.

itemsstring

popularity

integer

a number between 100 (best) and -100 (worst), calculated as 100 * (upvotes - downvotes)/(upvotes + downvotes). Votes are weighted by various factors such as whether the puzzle was solved successfully or the solver's puzzle rating in comparison to the puzzle's.

  • minimum: -100
  • maximum: 100

rating

requiredinteger

the Glicko-2 rating of the puzzle.

ratingDeviation

requiredinteger

the Glicko-2 rating deviation of the puzzle.

themes

array

a list of puzzle themes.

itemsstring

#resultAttestation

object

The payload a puzzle service signs when it judges a ranked attempt: proof that the service verified playerMoves against the puzzle's solution with the given solved result. The signature over it is stored in the org.lichess.puzzle.attempt record's sig field; this object itself is never stored, since every field is recoverable from the attempt record and the repo it lives in. To verify: rebuild this object from the record (kind is the constant below; player is the DID of the repo the record lives in), encode it as canonical DAG-CBOR (sorted map keys), and check the record's sig — an unpadded base64url low-S ECDSA signature over the sha256 of those bytes — against the service DID's published atproto verification key.

Properties

kind

requiredstring

always "org.lichess.puzzle.defs#resultAttestation"; domain-separates these signatures from anything else the service key signs.

  • const: "org.lichess.puzzle.defs#resultAttestation"

nonce

requiredstring

nonce of the challenge this result resolves (the attempt record's nonce field).

player

requiredstring · did

DID of the player the result belongs to — the repo the attempt record lives in. Binds the signature to its owner so it cannot be replayed into another player's repo.

playerMoves

requiredstring

the solution line the player submitted, exactly as judged (the attempt record's playerMoves field).

puzzle

requiredstring

Lichess puzzle ID (the attempt record's puzzleId field).

service

requiredstring · did

DID of the service that judged the attempt (the attempt record's service field).

solved

requiredboolean

the server-judged result (the attempt record's solved field).

#themeView

object

A puzzle theme with its display name and description.

Properties

description

requiredstring

a sentence describing the theme.

key

requiredstring

the theme identifier used in puzzle themes and the getRandom themes filter (e.g. "fork").

name

requiredstring

the human-readable display name of the theme (e.g. "Fork").

Similar lexicons

semantic match

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • org.lichess.puzzle.attempt

    record not from the namespace authority

    A record of a user's attempt at solving an org.lichess.puzzle. Ranked attempts carry a detached signature (sig) from the service proving the submitted moves were judged server-side. Rating is not part of the record: it is each scoring service's (appview's) own business.

  • org.lichess.puzzle.submitAttempt

    procedure not from the namespace authority

    Submits the outcome of a ranked puzzle previously issued by getNextRanked. The challenge token issued with the puzzle must be passed back verbatim, along with the full solution line the player played. The server validates those moves against the puzzle's actual solution: the attempt counts as solved only if they match. Applies the Glicko-2 rating update and returns the player's new rating, plus a detached signature (sig) proving the server judged the moves; the client should store it in its org.