This repository has no description
3.3 kB
67 lines
1{
2 "lexicon": 1,
3 "id": "org.lichess.puzzle.attempt",
4 "defs": {
5 "main": {
6 "type": "record",
7 "description": "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.",
8 "key": "tid",
9 "record": {
10 "type": "object",
11 "required": [
12 "puzzleId",
13 "service",
14 "solved",
15 "playerMoves",
16 "createdAt"
17 ],
18 "properties": {
19 "puzzleId": {
20 "type": "string",
21 "maxLength": 32,
22 "description": "Lichess puzzle ID."
23 },
24 "service": {
25 "type": "string",
26 "format": "did",
27 "description": "DID of the puzzle/scoring service that issued this puzzle and owns the rating it affects. This is traditionally a did:web of the web server, not a user's identity. Needed to be able to find the puzzle"
28 },
29 "mode": {
30 "type": "string",
31 "knownValues": ["casual", "ranked"],
32 "default": "casual",
33 "description": "Whether this attempt was played for rating and should be counted towards the user's rating."
34 },
35 "solved": {
36 "type": "boolean",
37 "description": "Whether the puzzle was solved. Advisory (client-claimed) unless sig is present, in which case it is the server-judged result and covered by the signature."
38 },
39 "nonce": {
40 "type": "string",
41 "maxLength": 64,
42 "description": "Idempotency key echoed back by submitAttempt (the challenge's jti). Uniquely identifies the issued challenge, so duplicate records for one attempt can be detected. Covered by sig."
43 },
44 "playerMoves": {
45 "type": "string",
46 "description": "the moves played by the solver during the attempt, in the same notation as the puzzle's solution moves. For ranked attempts this must be the line submitted to submitAttempt verbatim: it is covered by sig."
47 },
48 "fen": {
49 "type": "string",
50 "maxLength": 128,
51 "description": "The FEN of the puzzle's starting position (position before the opponent's setup move). Advisory context denormalized from the puzzle; derivable from puzzleId and not covered by sig."
52 },
53 "createdAt": {
54 "type": "string",
55 "format": "datetime",
56 "description": "client-declared timestamp when this attempt record was created."
57 },
58 "sig": {
59 "type": "string",
60 "maxLength": 128,
61 "description": "base64url (unpadded) detached signature by the service proving it judged playerMoves against the puzzle's solution with the given solved result. Signs the canonical DAG-CBOR encoding of an org.lichess.puzzle.defs#resultAttestation rebuilt from this record's fields — see that def for the exact verification recipe. Present only when the attempt was rated (ranked and not flagged)."
62 }
63 }
64 }
65 }
66 }
67}