Something went wrong. Try again.
AT Protocol Lexicons, SDK, CLI, and opengaming.games AppView for Game Achievements & Leaderboards
Something went wrong. Try again.
Files
- TypeScript 75%
- JavaScript 19%
- CSS 5%
- HTML 1%
README.md
Open Gaming (games.opengaming.*) #
Shared AT Protocol Lexicons, TypeScript SDK & CLI (@opengaming/sdk), Reference Documentation, and Viewer App (opengaming.games) for interoperable Game Achievements, Leaderboards, Rotating Challenges, and PvP Match Results — prototyped under games.opengaming.* (with Flappysky as the first reference game) and designed for 1:1 adoption by the ATProto Games Working Group.
Core Design Principles #
- Canonical Definitions on the Game's PDS, Lightweight Signed Receipts on the Player's PDS
- Games publish achievement, leaderboard, and challenge metadata (
title,description,iconblob,tier,scoreFormat/components,dimensions,timeframes,recordPolicy, optional BCP-47translations) once in the game publisher's repository. - Players store compact, dated unlock, progress, score, and match records in their own PDS referencing the game's definition via
at-uri— with a symmetric, optionaldefinitionCidacrossunlock,progress, andscoreso fixing typos or updating art never orphans existing player awards.
- Games publish achievement, leaderboard, and challenge metadata (
- Spoiler-Proof Hidden Achievements, Non-Penalizing DLC/Jam Badges & Unlock Memories
- When
hidden: true,achievement.definitionallows omittingtitle,description, andiconon the public PDS so Firehose /pds.lsscrapers never leak unreleased narrative spoilers, pointing to an access-controlledhiddenSpaceURI revealed upon unlock. countsTowardCompletion: falsesupports DLC, seasonal events, and game-jam "Feats of Strength" (bonusUnlockedCount) without revoking existing players'100%Perfect Game status;repeatable: truesupports multi-earn accolades.achievement.unlocksupports optional commemorativemediablobs (<= 2 MB), playernote, co-opparticipants+runId, and open-uniondetails(games.opengaming.defs#unlockContext) for RPG Hall-of-Fame party/loadout snapshots.
- When
- Local Component Maps, Sub-Board Dimensions, Speedrun PB History & Co-op Squads
- Classic boards use
score(integer) +scoreFormat(numeric | time | currency, includingsignedPrefix: truefor golf to-par and rating deltas). - Multi-factor boards (rhythm games, action stages) declare local
leaderboard.definition#*components (#points,#percentage,#time,#enum,#text) andleaderboard.score#*values via the forward-compatible$keyFormat/$valueTypedictionary convention +componentOrder— positioned for a zero-migration schema upgrade to the proposed Lexiconmaptype without altering PDS records or DAG-CBOR attestation CIDs. - Parameterized sub-board
dimensions(mode=4k,character=mario,difficulty=hard) avoid multiplying leaderboard definitions;recordPolicy(overwriteBest,personalBests,perWindowBest,everyRun) +includeObsolete+playerpower speedrun.com-style PB progression timelines;participants+runIddeduplicate co-op/raid runs into a single leaderboard rank.
- Classic boards use
- Daily Seeds, Rotating Quests & Serverless P2P Co-Signed PvP Matches
games.opengaming.challenge.definitionmodels daily/weekly seeded runs and rotating quests linked to leaderboards and reward achievements.games.opengaming.match.resultcaptures 1v1, team, and free-for-all PvP matches (ratingBefore/ratingAfter,#setBreakdown), verifying both server-attested ladders (rankingMode: "latest") and serverless peer-to-peer multi-participant DID co-signing.
- Infinite-Scale Mode A Attestations, EoS Fault Tolerance, Publisher Revocations & ATProto Labelers
- Player records carry inline ECDSA signatures (
games.opengaming.defs#inlineSignature) bound torepository(<playerDid>) and optionalrkey($sig.rkey), scaling with zero Game-PDS writes during normal gameplay. - End-of-Service (EoS) Continuity & Co-Equal Moderation: Optional
signatures,trustedIssuersrevival federation,replayblobs (<= 2 MB) +verified-replaylabels, surgicalgames.opengaming.revocationrecords, and ATProto Labeler folding (!cheat,neg: trueappeals).
- Player records carry inline ECDSA signatures (
- Per-Game Appreciation Over Global Gamerscore / XP
- Achievements intentionally carry no XP / gamerscore value and have no cap on how many achievements a game can define, spotlighting per-game
100%completion, custom artwork, tiers, and global rarity.
- Achievements intentionally carry no XP / gamerscore value and have no cap on how many achievements a game can define, spotlighting per-game
Monorepo Layout #
lexicons/— Canonicalgames.opengaming.*ATProto Lexicon v1 JSON schemas (11 schemas)packages/sdk/—@opengaming/sdkTypeScript library &opengamingCLIdocs/— Reference specifications & integration guides:examples/— End-to-end sample records (flappysky.examples.json)apps/web/— Theopengaming.gamesAppView, Jetstream/PDS Indexer, XRPC Server, and Achievement & Leaderboard Viewer web app
Lexicon Suite (11 Schemas) #
| NSID | Type | Lives On | Purpose |
|---|---|---|---|
games.opengaming.defs |
defs |
Shared | #inlineSignature (rkey-capable), #scoreFormat (signedPrefix), #participant, #optionItem, #stringMap, #translation / #translationMap, #unlockContext, and #judgmentBreakdown |
games.opengaming.achievement.definition |
record |
Game PDS | Canonical achievement metadata (hiddenSpace, countsTowardCompletion, repeatable, availableFrom/Until, retired, translations, trustedIssuers, tier, stepsNeeded) |
games.opengaming.achievement.unlock |
record |
Player PDS | Unlock receipt supporting co-op participants + runId, open-union details (#unlockContext), commemorative media blob, and note |
games.opengaming.achievement.progress |
record |
Player PDS | Partial step count (currentSteps / stepsNeeded) with optional definitionCid & signatures |
games.opengaming.leaderboard.definition |
record |
Game PDS | Canonical leaderboard config with local #points/#percentage/#time/#enum/#text #componentMap, #dimensionMap, rankingMode, startsAt/endsAt, rankedVersions, timeframes, and recordPolicy |
games.opengaming.leaderboard.score |
record |
Player PDS | Score submission supporting integer score or local #componentMap, dimensions, seed, co-op participants + runId, open-union details, version hash, and replay blob |
games.opengaming.challenge.definition |
record |
Game PDS | Daily/weekly/event challenges & quests (cadence, seed, targetSteps, leaderboard, rewardAchievement, dimensions, startsAt/endsAt) |
games.opengaming.match.result |
record |
Player PDS | PvP / competitive match outcome (participants with outcome & ratingBefore/ratingAfter, #setBreakdown, host attestation OR P2P multi-participant DID co-signing) |
games.opengaming.revocation |
record |
Game PDS | Revokes compromised, exploited, or mistakenly signed attestations (attestation, leaderboard, achievement, match, challenge, or game scope) |
games.opengaming.leaderboard.getScores |
query |
AppView / Game | Ranked query supporting timeframe (`daily |
games.opengaming.actor.getProfile |
query |
AppView | Player Gamercard summary (gamesPlayed, completedGames, totalUnlocks, tiers, per-game completion + bonusUnlockedCount) |
Quick Verification #
npm install
npm run build
npm test
npm run validate
License #
Dedicated to the public domain under CC0 1.0 for frictionless upstream adoption.