org.lichess.puzzle.submitAttempt

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.lichess.puzzle.attempt record. Resubmitting the same challenge (same nonce) is idempotent and returns the original result.

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

Procedure

procedure · POST

Input

application/json

challenge

requiredstring

The opaque signed token issued by getNextRanked, passed back verbatim.

  • maxLength: 4096

solutionMoves

requiredstring

The full solution line the player played, in the same notation and form as the puzzle's solution moves (org.lichess.puzzle.defs#puzzleView moves). The server compares this against the puzzle's actual solution to decide whether the attempt is solved.

Output

application/json

The exact payload sig signs, echoed back so callers can see and independently verify what was attested. Present only when the attempt was rated (ranked and not flagged).

nonce

requiredstring

The nonce (jti) of the challenge this result resolves. Store it in the attempt record's nonce field so duplicate records are detectable.

  • maxLength: 64

ranked

requiredboolean

Whether this attempt counted towards the player's rating.

rating

requiredinteger

The player's Glicko-2 rating after applying this attempt.

ratingDeviation

requiredinteger

The player's Glicko-2 rating deviation after applying this attempt.

sig

string

base64url (unpadded) detached signature by the service over the canonical DAG-CBOR encoding of attestation (see org.lichess.puzzle.defs#resultAttestation). Present only when the attempt was rated (ranked and not flagged). Store it verbatim in the attempt record's sig field.

  • maxLength: 128

solved

requiredboolean

Whether the submitted solution line matched the puzzle's actual solution, as judged by the server.

Errors

InvalidChallenge

The challenge token is malformed, has a bad signature, or does not belong to the authenticated player.

ChallengeExpired

The challenge token is past its expiry. Request a new puzzle.

UnknownAttempt

No outstanding attempt matches this challenge.

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.getNextRanked

    query not from the namespace authority

    Fetches the next ranked puzzle for the authenticated player. Each puzzle needs to be solved or failed before requesting another; if the player already holds an unresolved ranked puzzle, that same puzzle (with a freshly re-signed challenge) is returned so a client that lost its token can recover it.

  • org.lichess.puzzle.defs

    not from the namespace authority

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