# net.anisota.chronicle.progress

> Published by [anisota.net](https://lexicon.garden/identity/did:plc:lcieujcfkv4jx7gehsvok3pr)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.progress)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.progress/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.progress/examples)

## Definitions

### `net.anisota.chronicle.progress`

**Type**: `record`

Signed player progression state. Singleton (rkey: self), overwritten via putRecord. Backend validates XP claims before signing.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `level` | `integer` | Yes | Current player level (derived from XP table) |
| `totalXP` | `integer` | Yes | Total accumulated XP |
| `createdAt` | `string` (datetime) | Yes | When the record was first created |
| `signature` | `ref` → `#chronicleSignature` | Yes |  |
| `updatedAt` | `string` (datetime) | No | When the record was last updated |
| `triggerSource` | `string` | No | What triggered this save (level_up, session_end, visibility_hidden, periodic, card_advance) |
| `xpToNextLevel` | `integer` | No | XP remaining to reach next level |
| `progressPercentage` | `string` | No | Progress toward next level as decimal string |
| `xpGainedSinceLastSign` | `integer` | No | XP gained since the last signed progress record (for rate validation against daily activity) |

### `net.anisota.chronicle.progress#chronicleSignature`

**Type**: `object`

ES256 cryptographic signature proving record authenticity

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `alg` | `string` | Yes | Signing algorithm (ES256) |
| `kid` | `string` | Yes | Key identifier for the signing key |
| `sig` | `string` | Yes | Base64-encoded ES256 signature |
| `nonce` | `string` | Yes | Unique random nonce to prevent replay |
| `version` | `integer` | Yes | Signature schema version |
| `signedAt` | `string` (datetime) | Yes | When the record was signed |

## Raw Schema

```json
{
  "id": "net.anisota.chronicle.progress",
  "defs": {
    "main": {
      "key": "any",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "totalXP",
          "level",
          "signature",
          "createdAt"
        ],
        "properties": {
          "level": {
            "type": "integer",
            "maximum": 99,
            "minimum": 1,
            "description": "Current player level (derived from XP table)"
          },
          "totalXP": {
            "type": "integer",
            "minimum": 0,
            "description": "Total accumulated XP"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the record was first created"
          },
          "signature": {
            "ref": "#chronicleSignature",
            "type": "ref"
          },
          "updatedAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the record was last updated"
          },
          "triggerSource": {
            "type": "string",
            "description": "What triggered this save (level_up, session_end, visibility_hidden, periodic, card_advance)"
          },
          "xpToNextLevel": {
            "type": "integer",
            "minimum": 0,
            "description": "XP remaining to reach next level"
          },
          "progressPercentage": {
            "type": "string",
            "description": "Progress toward next level as decimal string"
          },
          "xpGainedSinceLastSign": {
            "type": "integer",
            "minimum": 0,
            "description": "XP gained since the last signed progress record (for rate validation against daily activity)"
          }
        }
      },
      "description": "Signed player progression state. Singleton (rkey: self), overwritten via putRecord. Backend validates XP claims before signing."
    },
    "chronicleSignature": {
      "type": "object",
      "required": [
        "sig",
        "alg",
        "kid",
        "signedAt",
        "nonce",
        "version"
      ],
      "properties": {
        "alg": {
          "type": "string",
          "description": "Signing algorithm (ES256)"
        },
        "kid": {
          "type": "string",
          "description": "Key identifier for the signing key"
        },
        "sig": {
          "type": "string",
          "description": "Base64-encoded ES256 signature"
        },
        "nonce": {
          "type": "string",
          "description": "Unique random nonce to prevent replay"
        },
        "version": {
          "type": "integer",
          "description": "Signature schema version"
        },
        "signedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When the record was signed"
        }
      },
      "description": "ES256 cryptographic signature proving record authenticity"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
