# net.anisota.chronicle.level

> 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.level)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.level/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lcieujcfkv4jx7gehsvok3pr/net.anisota.chronicle.level/examples)

## Definitions

### `net.anisota.chronicle.level`

**Type**: `record`

Immutable level milestone record. Created once on level-up with createRecord. rkey is zero-padded level (001-099).

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `level` | `integer` | Yes | The level that was reached |
| `journey` | `ref` → `#journeyData` | No |  |
| `snapshot` | `ref` → `#levelSnapshot` | Yes |  |
| `createdAt` | `string` (datetime) | Yes | When the level was reached |
| `signature` | `ref` → `#chronicleSignature` | Yes |  |

### `net.anisota.chronicle.level#journeyData`

**Type**: `object`

Journey info from previous level

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `daysFromPreviousLevel` | `integer` | No | Days taken to advance from previous level |
| `xpGainedFromPreviousLevel` | `integer` | No | XP gained since previous level |

### `net.anisota.chronicle.level#levelSnapshot`

**Type**: `object`

Player state at the moment of leveling up

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `totalXP` | `integer` | Yes | Total XP at time of level-up |
| `daysPlayed` | `integer` | No | Total days played at time of level-up |
| `itemsTotal` | `integer` | No | Total items at time of level-up |
| `postsReadTotal` | `integer` | No | Total posts read all-time at level-up |
| `specimensDocumented` | `integer` | No | Total specimens documented at time of level-up |

### `net.anisota.chronicle.level#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.level",
  "defs": {
    "main": {
      "key": "any",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "level",
          "snapshot",
          "signature",
          "createdAt"
        ],
        "properties": {
          "level": {
            "type": "integer",
            "maximum": 99,
            "minimum": 1,
            "description": "The level that was reached"
          },
          "journey": {
            "ref": "#journeyData",
            "type": "ref"
          },
          "snapshot": {
            "ref": "#levelSnapshot",
            "type": "ref"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the level was reached"
          },
          "signature": {
            "ref": "#chronicleSignature",
            "type": "ref"
          }
        }
      },
      "description": "Immutable level milestone record. Created once on level-up with createRecord. rkey is zero-padded level (001-099)."
    },
    "journeyData": {
      "type": "object",
      "properties": {
        "daysFromPreviousLevel": {
          "type": "integer",
          "minimum": 0,
          "description": "Days taken to advance from previous level"
        },
        "xpGainedFromPreviousLevel": {
          "type": "integer",
          "minimum": 0,
          "description": "XP gained since previous level"
        }
      },
      "description": "Journey info from previous level"
    },
    "levelSnapshot": {
      "type": "object",
      "required": [
        "totalXP"
      ],
      "properties": {
        "totalXP": {
          "type": "integer",
          "minimum": 0,
          "description": "Total XP at time of level-up"
        },
        "daysPlayed": {
          "type": "integer",
          "minimum": 0,
          "description": "Total days played at time of level-up"
        },
        "itemsTotal": {
          "type": "integer",
          "minimum": 0,
          "description": "Total items at time of level-up"
        },
        "postsReadTotal": {
          "type": "integer",
          "minimum": 0,
          "description": "Total posts read all-time at level-up"
        },
        "specimensDocumented": {
          "type": "integer",
          "minimum": 0,
          "description": "Total specimens documented at time of level-up"
        }
      },
      "description": "Player state at the moment of leveling up"
    },
    "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
}
```
