Skip to content

Instantly share code, notes, and snippets.

@melvincarvalho
Last active March 26, 2024 16:42
Show Gist options
  • Save melvincarvalho/1baf10b53c82d25527d46dd60695236c to your computer and use it in GitHub Desktop.
Save melvincarvalho/1baf10b53c82d25527d46dd60695236c to your computer and use it in GitHub Desktop.
NIP-133.md

NIP-133

Nostr Game Score Event

draft optional author:melvincarvalho

This NIP defines an event used to represent scores for players within various games on the Nostr network. Each game is uniquely identified by a d tag, and each Nostr user can have a score associated with that game.

Nostr event

A kind 33334 event is used.

The content SHOULD be a stringified number representing the user's score in the game. The number by default is implicitly denominated in satoshis. A complex stringified JSON event is reserved for future use and more expressive self-descriptive scoring.

The following tags are defined as REQUIRED:

  • d - a unique string representing a specific game. This could be a URI which gives more information about the game.

Example event:

{
    "id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578736",
    "pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ef",
    "content": "1000",
    "kind": 33334,
    "created_at": 1682327854,
    "tags": [
        [
            "d",
            "SpaceInvaders2023"
        ]
    ],
    "sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22186"
}

Use Cases

  1. Self-Reported Scores: Players can report their own scores for various games. This could be something like a step counter or to track productivity.
  2. Achievements: Certain thresholds of scores can be linked with achievements or rewards.
  3. Replaceable Scores: Scores can be updated by users, ensuring the latest score is always available. Since scores change fast, a replaceable event is better.

Extensions

Extensions to this NIP can be proposed and implemented to cover additional scenarios and use cases. For instance, additional tags could be introduced for more complex game scenarios or for integrating with other systems or platforms.

Witness Verification: While the primary use case is self-reported scores, the possibility remains for game hosts or third parties to report scores for users using a p tag to indicate the user's public key. On-chain commitments to blockchain networks like Bitcoin can be used to witness and validate these scoring events using the c tag. This will be described further after the initial system is immplemented.

Reference Implementations

(TBD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment