{"id":"1654a61d04d14355b51dc9194058b25954a0edf4bbceda77b6f7f860fb49749c","pubkey":"93afa609d45882ebe91e2efca40c5dcd2f0614a9898ac8fe34e70d5f7b7afd8b","created_at":1761666191,"kind":30817,"tags":[["d","score"],["title","Score"],["client","nostrhub.io"]],"content":"# Abstract\n\nThis NIP defines a standardized way to publish game scores on Nostr, allowing any game to record and share player achievements in a decentralized manner.\n\n# Motivation\n\nGaming applications need a standardized way to publish scores that can be:\n- Verified and preserved across different clients\n- Queried and aggregated by leaderboard applications\n- Shared by players across social networks\n- Used for competitive gaming and tournaments\n\n# Event Format\n\nGame scores are published using kind `30762` events with the following structure:\n\n```json\n{\n  \"kind\": 30762,\n  \"content\": \"\",\n  \"tags\": [\n    [\"p\", \"<player-pubkey-hex>\"],\n    [\"game\", \"<game-identifier>\"],\n    [\"score\", \"<numerical-score>\"],\n    [\"state\", \"<score-state>\"],\n    [\"difficulty\", \"<difficulty-level>\"],\n    [\"duration\", \"<game-duration-seconds>\"],\n    [\"version\", \"<game-version>\"],\n    [\"alt\", \"Game score: <score> in <game-name>\"]\n  ]\n}\n```\n\n# Required Tags\n\n- `d`: Unique identifier for this score to enable in-game updates to the score.\n- `p`: Hex-encoded public key of the player who achieved this score\n- `game`: Unique identifier for the specific game (e.g., \"blockstr\", \"tetris\", \"chess\")\n- `score`: Numerical score achieved (as string)\n\n# Optional Tags\n\n- `state`: The score state (i.e live, final, half-time). Clients shall interpret no state as final.\n- `match`: Unique identifier for this game session / match. Can be used to reference individually published scores in a multiplayer match\n- `difficulty`: Difficulty level or mode (e.g., \"easy\", \"hard\", \"level-5\")\n- `duration`: Game duration in seconds (as string)\n- `version`: Version of the game client\n- `referee`: Hex-encoded public key of the person that refereed the match\n- `alt`: Human-readable description per NIP-31\n\n# Implementation Notes\n\n## Score Verification\nGames should implement score verification mechanisms appropriate to their type:\n- Cryptographic proofs for deterministic games\n- Replay data for verification\n- Anti-cheat measures for competitive games\n\n## Privacy\nPlayers can choose to publish scores from their own keys or allow games to publish on their behalf. Anonymous scores can be published using ephemeral keys.\n\n## Querying Scores\nApplications can query scores using standard Nostr filters:\n\n```javascript\n// Get all scores for a specific game\n{ kinds: [30762], \"#game\": [\"blockstr\"], limit: 100 }\n\n// Get scores for a specific player\n{ kinds: [30762], \"#player\": [\"<pubkey-hex>\"], limit: 50 }\n\n// Get high scores with minimum threshold\n{ kinds: [30762], \"#game\": [\"blockstr\"], \"#score\": [\">1000\"], limit: 10 }\n```","sig":"5be117742fa96bfedc8e58599fae7e7371a9067c0f4cbbb566cabd668c6fc3cffe03af78c97c07cb1249e31f70fedc65f38aaedfe7d0cf4359a63db48586ce2e"}