Skip to content

Latest commit

Β 

History

History
1051 lines (895 loc) Β· 51.2 KB

File metadata and controls

1051 lines (895 loc) Β· 51.2 KB

GameStart: Decentralized Game Distribution Platform

Specification Document v1.0


1. Executive Summary

GameStart is a decentralized game distribution platform built on the Nostr protocol that eliminates intermediary fees while maintaining security, authenticity, and anti-piracy measures through cryptographic identity, web of trust curation, and developer-hosted authentication.

Core Value Proposition

  • Zero platform fees - Developers keep 100% of revenue
  • Decentralized hosting - Games distributed across Nostr relays
  • Cryptographic identity - All parties verified via Nostr keys
  • Community curation - Web of trust model for game safety
  • Self-sovereign licenses - Ownership tied to user's Nostr identity

2. Problem Statement

Current Centralized Model Issues

  1. High fees - Major platforms take 20-30% of every sale
  2. Gatekeeping - Centralized approval processes
  3. Platform dependency - Games can be delisted arbitrarily
  4. Account lock-in - Users don't truly own their purchases
  5. Privacy concerns - Platforms collect extensive user data

Decentralization Challenges to Solve

  1. Malware risk - Anyone can publish, including bad actors
  2. Piracy - No central authority to enforce licenses
  3. Discovery - Finding legitimate games among noise
  4. Identity verification - Proving developer legitimacy
  5. Payment processing - Trustless transactions

3. System Architecture

3.1 High-Level Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      GAMESTART ECOSYSTEM                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚   USERS      β”‚    β”‚  CURATORS    β”‚    β”‚  DEVELOPERS  β”‚      β”‚
β”‚  β”‚              β”‚    β”‚              β”‚    β”‚              β”‚      β”‚
β”‚  β”‚ - Browse     β”‚    β”‚ - Vouch for  β”‚    β”‚ - Publish    β”‚      β”‚
β”‚  β”‚ - Purchase   β”‚    β”‚   games      β”‚    β”‚ - Host relay β”‚      β”‚
β”‚  β”‚ - Play       β”‚    β”‚ - Build      β”‚    β”‚ - Receive    β”‚      β”‚
β”‚  β”‚              β”‚    β”‚   reputation β”‚    β”‚   payments   β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚         β”‚                   β”‚                   β”‚               β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                             β”‚                                   β”‚
β”‚                             β–Ό                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                    NOSTR RELAY NETWORK                    β”‚  β”‚
β”‚  β”‚                                                           β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚  β”‚
β”‚  β”‚  β”‚ Public  β”‚  β”‚ Public  β”‚  β”‚Developerβ”‚  β”‚Developerβ”‚     β”‚  β”‚
β”‚  β”‚  β”‚ Relay 1 β”‚  β”‚ Relay 2 β”‚  β”‚ Relay A β”‚  β”‚ Relay B β”‚     β”‚  β”‚
β”‚  β”‚  β”‚         β”‚  β”‚         β”‚  β”‚  (Auth) β”‚  β”‚  (Auth) β”‚     β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚  β”‚
β”‚  β”‚                                                           β”‚  β”‚
β”‚  β”‚  Game Metadata, Vouches, Licenses distributed across      β”‚  β”‚
β”‚  β”‚  public relays. Authentication handled by developer relaysβ”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3.2 Component Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    GAMESTART CLIENT                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Library View  β”‚  β”‚  Store View    β”‚  β”‚ Social View   β”‚  β”‚
β”‚  β”‚                β”‚  β”‚                β”‚  β”‚               β”‚  β”‚
β”‚  β”‚ - My Games     β”‚  β”‚ - Browse       β”‚  β”‚ - Following   β”‚  β”‚
β”‚  β”‚ - Downloads    β”‚  β”‚ - Search       β”‚  β”‚ - Curators    β”‚  β”‚
β”‚  β”‚ - Licenses     β”‚  β”‚ - Categories   β”‚  β”‚ - Reviews     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    CORE SERVICES                      β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚
β”‚  β”‚  β”‚ Nostr       β”‚ β”‚ Download    β”‚ β”‚ License         β”‚ β”‚   β”‚
β”‚  β”‚  β”‚ Manager     β”‚ β”‚ Manager     β”‚ β”‚ Manager         β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚
β”‚  β”‚  β”‚ Web of      β”‚ β”‚ Payment     β”‚ β”‚ Auth            β”‚ β”‚   β”‚
β”‚  β”‚  β”‚ Trust       β”‚ β”‚ Handler     β”‚ β”‚ Handler         β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                 KEY MANAGEMENT                        β”‚   β”‚
β”‚  β”‚  - Nostr keypair (nsec/npub)                         β”‚   β”‚
β”‚  β”‚  - NIP-07 browser extension support                  β”‚   β”‚
β”‚  β”‚  - Hardware wallet integration (future)              β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

4. Nostr Protocol Integration

4.1 NIPs (Nostr Implementation Possibilities) Used

NIP Purpose Usage in GameStart
NIP-01 Basic protocol Event structure, signatures
NIP-02 Contact List Following curators/developers
NIP-05 DNS Verification Developer identity verification
NIP-07 Browser Extension Key management via extensions
NIP-42 Authentication Developer relay auth for anti-piracy
NIP-57 Zaps (Lightning) Game payments
NIP-94 File Metadata Game binary metadata
NIP-96 HTTP File Storage Binary hosting references

4.2 Custom Event Kinds (To Be Proposed)

We will define custom event kinds in the 30000+ range (parameterized replaceable events):

Kind 30100: Game Publication
Kind 30101: Game Version/Update
Kind 30102: Game Vouch (Curator endorsement)
Kind 30103: License Purchase Receipt
Kind 30104: Developer Relay Registration
Kind 30105: Curator Profile
Kind 30106: Developer License Confirmation

4.3 Game Publication Event (Kind 30100)

{
  "kind": 30100,
  "pubkey": "<developer_pubkey>",
  "created_at": 1234567890,
  "tags": [
    ["d", "<unique_game_identifier>"],
    ["title", "Game Title"],
    ["summary", "Short description of the game"],
    ["description", "Full markdown description"],
    ["version", "1.0.0"],
    ["price", "21000", "sats"],
    ["thumbnail", "<url_to_thumbnail>"],
    ["banner", "<url_to_banner>"],
    ["category", "action"],
    ["category", "indie"],
    ["platform", "windows"],
    ["platform", "linux"],
    ["binary", "<platform>", "<url>", "<sha256_hash>", "<size_bytes>"],
    ["binary", "windows", "https://...", "abc123...", "1073741824"],
    ["relay", "wss://auth.developer.com", "auth"],
    ["nip05", "developer@game-studio.com"],
    ["website", "https://game-studio.com"],
    ["license-type", "perpetual"],
    ["auth-mode", "online-only"],
    ["refund-policy", "30-day", "Full refund within 30 days of purchase"],
    ["t", "singleplayer"],
    ["t", "rpg"]
  ],
  "content": "Extended description, changelog, credits in markdown",
  "sig": "<signature>"
}

4.4 Vouch Event (Kind 30102)

{
  "kind": 30102,
  "pubkey": "<curator_pubkey>",
  "created_at": 1234567890,
  "tags": [
    ["d", "<game_d_tag>"],
    ["e", "<game_event_id>", "<relay_hint>"],
    ["p", "<developer_pubkey>"],
    ["version", "1.0.0"],
    ["verdict", "safe"],
    ["review", "Tested on Windows 11, no malware detected, fun game!"]
  ],
  "content": "Optional extended review",
  "sig": "<signature>"
}

4.5 License Receipt Event (Kind 30103)

{
  "kind": 30103,
  "pubkey": "<user_pubkey>",
  "created_at": 1234567890,
  "tags": [
    ["d", "<game_d_tag>:<timestamp>"],
    ["e", "<game_event_id>"],
    ["p", "<developer_pubkey>"],
    ["price", "21000", "sats"],
    ["payment-hash", "<lightning_payment_hash>"],
    ["payment-preimage", "<lightning_preimage>"],
    ["bitcoin-txid", "<on_chain_txid>"],
    ["invoice", "<bolt11_or_bolt12_invoice>"]
  ],
  "content": "",
  "sig": "<signature>"
}

5. Web of Trust Model

5.1 Trust Hierarchy

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   PLATFORM ROOT   β”‚
                    β”‚   (GameStart)     β”‚
                    β”‚                   β”‚
                    β”‚ Initial trusted   β”‚
                    β”‚ curator - US      β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚               β”‚               β”‚
              β–Ό               β–Ό               β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Curator A β”‚   β”‚ Curator B β”‚   β”‚ Curator C β”‚
        β”‚           β”‚   β”‚           β”‚   β”‚           β”‚
        β”‚ Vouches   β”‚   β”‚ Vouches   β”‚   β”‚ Vouches   β”‚
        β”‚ for games β”‚   β”‚ for games β”‚   β”‚ for games β”‚
        β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
              β”‚               β”‚               β”‚
              β–Ό               β–Ό               β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Game 1  β”‚     β”‚ Game 4  β”‚     β”‚ Game 7  β”‚
        β”‚ Game 2  β”‚     β”‚ Game 5  β”‚     β”‚ Game 8  β”‚
        β”‚ Game 3  β”‚     β”‚ Game 6  β”‚     β”‚ Game 9  β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

5.2 Trust Calculation Algorithm

interface TrustScore {
  curator: string;      // npub
  trustLevel: number;   // 0-100
  hops: number;         // distance from user
  vouches: number;      // total vouches made
  disputed: number;     // vouches that led to issues
}

function calculateGameTrust(
  game: GameEvent,
  userFollows: Set<string>,
  vouchEvents: VouchEvent[]
): TrustResult {

  // Direct follow vouches (hop = 1)
  const directVouches = vouchEvents.filter(v =>
    userFollows.has(v.pubkey) && v.gameId === game.id
  );

  // Indirect vouches (hop = 2, follows of follows)
  const indirectVouches = vouchEvents.filter(v =>
    isFollowOfFollow(v.pubkey, userFollows)
  );

  // Platform root always counts
  const platformVouch = vouchEvents.find(v =>
    v.pubkey === PLATFORM_ROOT_PUBKEY
  );

  return {
    score: weightedScore(directVouches, indirectVouches, platformVouch),
    vouchers: [...directVouches, ...indirectVouches],
    platformEndorsed: !!platformVouch,
    warnings: checkWarnings(game)
  };
}

5.3 User's Game List Generation

A game appears in a user's browse list if:

  1. Platform Endorsed: Vouched by GameStart root account, OR
  2. Direct Trust: Vouched by someone the user directly follows, OR
  3. Indirect Trust: Vouched by someone followed by someone the user follows (configurable depth)

Users can adjust their trust settings:

  • trust_depth: How many hops to traverse (default: 2)
  • min_vouches: Minimum vouches required (default: 1)
  • require_nip05: Only show NIP-05 verified developers (default: false)
  • show_unvouched: Allow browsing unvouched games with warnings (default: false)

5.4 Curator Reputation System

Curators build reputation through:

  • Longevity: Account age and consistent activity
  • Accuracy: Low dispute rate on vouched games
  • Verification: NIP-05 verified identity
  • Stake: Optional Lightning bond (future feature)
interface CuratorProfile {
  pubkey: string;
  nip05?: string;
  vouchCount: number;
  followerCount: number;
  disputeRate: number;  // % of vouches flagged as problematic
  categories: string[]; // genres they specialize in
  createdAt: number;
}

6. Developer Authentication & Anti-Piracy

6.1 Developer Relay Architecture

Each game developer hosts their own Nostr relay for authentication purposes:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DEVELOPER AUTH RELAY                      β”‚
β”‚                  wss://auth.mygame.com                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                   NIP-42 AUTH LAYER                   β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚  1. Client connects with AUTH challenge              β”‚   β”‚
β”‚  β”‚  2. Client signs challenge with their nsec           β”‚   β”‚
β”‚  β”‚  3. Relay verifies signature                         β”‚   β”‚
β”‚  β”‚  4. Relay checks license database                    β”‚   β”‚
β”‚  β”‚  5. Relay tracks active sessions                     β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                 SESSION MANAGEMENT                    β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚ License DB      β”‚    β”‚ Active Sessions         β”‚  β”‚   β”‚
β”‚  β”‚  β”‚                 β”‚    β”‚                         β”‚  β”‚   β”‚
β”‚  β”‚  β”‚ npub -> license β”‚    β”‚ npub -> [session_id,   β”‚  β”‚   β”‚
β”‚  β”‚  β”‚ purchase_date   β”‚    β”‚         ip, timestamp, β”‚  β”‚   β”‚
β”‚  β”‚  β”‚ game_version    β”‚    β”‚         device_id]     β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β”‚  Rules:                                               β”‚   β”‚
β”‚  β”‚  - Only 1 active session per npub (configurable)    β”‚   β”‚
β”‚  β”‚  - Grace period for reconnection (5 min default)    β”‚   β”‚
β”‚  β”‚  - Session heartbeat every 60 seconds               β”‚   β”‚
β”‚  β”‚                                                       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

6.2 Game Launch Authentication Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Game    β”‚          β”‚  GameStart   β”‚          β”‚  Developer      β”‚
β”‚  Client  β”‚          β”‚  Client      β”‚          β”‚  Auth Relay     β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚                       β”‚                           β”‚
     β”‚  1. Launch Game       β”‚                           β”‚
     │──────────────────────>β”‚                           β”‚
     β”‚                       β”‚                           β”‚
     β”‚                       β”‚  2. Get auth relay URL    β”‚
     β”‚                       β”‚  from game metadata       β”‚
     β”‚                       β”‚                           β”‚
     β”‚                       β”‚  3. Connect to relay      β”‚
     β”‚                       │──────────────────────────>β”‚
     β”‚                       β”‚                           β”‚
     β”‚                       β”‚  4. AUTH challenge        β”‚
     β”‚                       β”‚<──────────────────────────│
     β”‚                       β”‚                           β”‚
     β”‚                       β”‚  5. Sign with user nsec   β”‚
     β”‚                       │──────────────────────────>β”‚
     β”‚                       β”‚                           β”‚
     β”‚                       β”‚  6. Verify license        β”‚
     β”‚                       β”‚  Check active sessions    β”‚
     β”‚                       β”‚<──────────────────────────│
     β”‚                       β”‚                           β”‚
     β”‚                       β”‚  7a. SUCCESS: Token       β”‚
     β”‚                       β”‚<──────────────────────────│
     β”‚                       β”‚                           β”‚
     β”‚  8. Auth token        β”‚                           β”‚
     β”‚<──────────────────────│                           β”‚
     β”‚                       β”‚                           β”‚
     β”‚  9. Game runs with    β”‚                           β”‚
     β”‚  periodic heartbeat   β”‚                           β”‚
     │──────────────────────────────────────────────────>β”‚
     β”‚                       β”‚                           β”‚

6.3 Concurrent Session Prevention

interface SessionManager {
  // Check if user can start new session
  canStartSession(npub: string): {
    allowed: boolean;
    reason?: string;
    existingSession?: SessionInfo;
  };

  // Start new session (kicks existing if configured)
  startSession(npub: string, deviceId: string, ip: string): Session;

  // Heartbeat to maintain session
  heartbeat(sessionId: string): boolean;

  // End session
  endSession(sessionId: string): void;
}

// Developer configurable options
interface AntiPiracyConfig {
  maxConcurrentSessions: number;    // default: 1
  sessionTimeout: number;           // seconds, default: 300
  heartbeatInterval: number;        // seconds, default: 60
  gracePeriod: number;              // seconds for reconnect, default: 300
  kickExistingOnNew: boolean;       // default: false (reject new instead)
}

6.4 Online vs Offline Games

Developers choose their game's authentication mode, which has significant implications:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    AUTHENTICATION MODES                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ ONLINE-ONLY (Recommended for most games)                   β”‚ β”‚
β”‚  β”‚                                                             β”‚ β”‚
β”‚  β”‚ auth-mode: "online-only"                                   β”‚ β”‚
β”‚  β”‚                                                             β”‚ β”‚
β”‚  β”‚ + Continuous auth verification                              β”‚ β”‚
β”‚  β”‚ + Refunds possible (revoke npub access)                    β”‚ β”‚
β”‚  β”‚ + Strongest anti-piracy                                     β”‚ β”‚
β”‚  β”‚ + Session management works fully                            β”‚ β”‚
β”‚  β”‚ - Requires internet to play                                 β”‚ β”‚
β”‚  β”‚ - Developer relay must be highly available                  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ OFFLINE-CAPABLE (Hybrid approach)                          β”‚ β”‚
β”‚  β”‚                                                             β”‚ β”‚
β”‚  β”‚ auth-mode: "offline-capable"                               β”‚ β”‚
β”‚  β”‚                                                             β”‚ β”‚
β”‚  β”‚ + Can play without internet after initial auth             β”‚ β”‚
β”‚  β”‚ + Periodic check-ins (configurable interval)               β”‚ β”‚
β”‚  β”‚ ~ Refunds difficult (grace period before revocation)       β”‚ β”‚
β”‚  β”‚ - Weaker anti-piracy during offline periods                β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ DRM-FREE (Trust-based)                                     β”‚ β”‚
β”‚  β”‚                                                             β”‚ β”‚
β”‚  β”‚ auth-mode: "drm-free"                                      β”‚ β”‚
β”‚  β”‚                                                             β”‚ β”‚
β”‚  β”‚ + No internet required ever                                 β”‚ β”‚
β”‚  β”‚ + Maximum user freedom                                      β”‚ β”‚
β”‚  β”‚ + No developer relay needed                                 β”‚ β”‚
β”‚  β”‚ - NO REFUNDS POSSIBLE                                       β”‚ β”‚
β”‚  β”‚ - No anti-piracy protection                                 β”‚ β”‚
β”‚  β”‚ - Trust in user's honesty                                   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

6.5 Refund Mechanism (Online-Only Games)

For online-only games, refunds work as follows:

User requests refund          Developer reviews request
        β”‚                              β”‚
        β–Ό                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Contact dev   │─────────────>β”‚ Check policy  β”‚
β”‚ (via Nostr DM β”‚              β”‚ (30-day, etc) β”‚
β”‚ or website)   β”‚              β”‚               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                      β”‚                β”‚                β”‚
                      β–Ό                β–Ό                β–Ό
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚ Approve  β”‚     β”‚ Deny     β”‚     β”‚ Partial  β”‚
               β”‚          β”‚     β”‚          β”‚     β”‚          β”‚
               β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                    β”‚                                 β”‚
                    β–Ό                                 β–Ό
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚ 1. Remove npub β”‚                β”‚ Negotiate or   β”‚
           β”‚    from relay  β”‚                β”‚ offer credit   β”‚
           β”‚                β”‚                β”‚                β”‚
           β”‚ 2. Send BTC    β”‚                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚    refund      β”‚
           β”‚                β”‚
           β”‚ 3. User can no β”‚
           β”‚    longer auth β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key insight: The developer's auth relay acts as the license server. Removing an npub instantly revokes access. This is simple, effective, and requires no platform intervention.


7. Payment System

7.1 Supported Payment Methods

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    PAYMENT OPTIONS                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ PRIMARY: Lightning Network (Recommended)                β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ - Instant settlement                                    β”‚ β”‚
β”‚  β”‚ - Low fees (< 1%)                                       β”‚ β”‚
β”‚  β”‚ - BOLT11 or BOLT12 invoices                            β”‚ β”‚
β”‚  β”‚ - NIP-57 Zaps integration                              β”‚ β”‚
β”‚  β”‚ - Payment proof via preimage                           β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ SECONDARY: On-chain Bitcoin                             β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ - For larger purchases                                  β”‚ β”‚
β”‚  β”‚ - Higher fees, slower confirmation                      β”‚ β”‚
β”‚  β”‚ - TXID as proof                                         β”‚ β”‚
β”‚  β”‚ - 1-6 confirmation wait                                 β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ FUTURE: Ecash (Cashu/Fedimint)                         β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ - Privacy-preserving                                    β”‚ β”‚
β”‚  β”‚ - Instant                                               β”‚ β”‚
β”‚  β”‚ - Requires mint trust                                   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

7.2 Purchase Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  User    β”‚    β”‚  GameStart   β”‚    β”‚  Developer      β”‚    β”‚  Nostr   β”‚
β”‚          β”‚    β”‚  Client      β”‚    β”‚  LN Node/Relay  β”‚    β”‚  Relays  β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚ 1. Buy Game     β”‚                     β”‚                  β”‚
     │────────────────>β”‚                     β”‚                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚                 β”‚ 2. Request invoice  β”‚                  β”‚
     β”‚                 β”‚ (include user npub) β”‚                  β”‚
     β”‚                 │────────────────────>β”‚                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚                 β”‚ 3. BOLT11/12 invoiceβ”‚                  β”‚
     β”‚                 β”‚<────────────────────│                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚ 4. Show invoice β”‚                     β”‚                  β”‚
     β”‚<────────────────│                     β”‚                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚ 5. Pay invoice  β”‚                     β”‚                  β”‚
     │─────────────────────────────────────>β”‚                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚                 β”‚ 6. Payment confirm  β”‚                  β”‚
     β”‚                 β”‚<────────────────────│                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚                 β”‚ 7. Create License   β”‚                  β”‚
     β”‚                 β”‚ Receipt (Kind 30103)β”‚                  β”‚
     β”‚                 │─────────────────────────────────────>β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚                 β”‚ 8. Developer createsβ”‚                  β”‚
     β”‚                 β”‚ license entry       β”‚                  β”‚
     β”‚                 β”‚<────────────────────│                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚
     β”‚ 9. Purchase     β”‚                     β”‚                  β”‚
     β”‚ complete!       β”‚                     β”‚                  β”‚
     β”‚<────────────────│                     β”‚                  β”‚
     β”‚                 β”‚                     β”‚                  β”‚

7.3 License Receipt Structure

The license receipt serves as cryptographic proof of purchase:

{
  "kind": 30103,
  "pubkey": "<buyer_npub>",
  "created_at": 1234567890,
  "tags": [
    ["d", "game123:1234567890"],
    ["e", "<game_publication_event_id>", "<relay_hint>"],
    ["p", "<developer_pubkey>"],
    ["game", "<game_d_tag>"],
    ["version", "1.0.0"],
    ["price", "21000", "sats"],
    ["payment-method", "lightning"],
    ["payment-hash", "<sha256_of_preimage>"],
    ["payment-preimage", "<32_byte_hex_preimage>"],
    ["invoice", "lnbc210u1p..."],
    ["license-type", "perpetual"]
  ],
  "content": "",
  "sig": "<user_signature>"
}

7.4 Developer-Side License Confirmation

Developers can optionally co-sign or publish their own confirmation:

{
  "kind": 30106,
  "pubkey": "<developer_pubkey>",
  "created_at": 1234567890,
  "tags": [
    ["e", "<license_receipt_event_id>"],
    ["p", "<buyer_pubkey>"],
    ["game", "<game_d_tag>"],
    ["confirmed", "true"]
  ],
  "content": "",
  "sig": "<developer_signature>"
}

8. Developer Identity Verification

8.1 NIP-05 Verification

Developers SHOULD verify their identity via NIP-05:

developer@game-studio.com
    β”‚
    β–Ό
https://game-studio.com/.well-known/nostr.json
{
  "names": {
    "developer": "<developer_npub>"
  }
}

This proves the developer controls the domain, making impersonation harder.

8.2 Trust Indicators in UI

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  GAME LISTING                                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ [Game Banner Image]                                     β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ AWESOME RPG GAME                                        β”‚ β”‚
β”‚  β”‚ by CoolDev Studios                                      β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ Trust Indicators:                                       β”‚ β”‚
β”‚  β”‚ βœ“ NIP-05 verified: dev@cooldevstudios.com              β”‚ β”‚
β”‚  β”‚ βœ“ Vouched by: GameStart Official (you follow)          β”‚ β”‚
β”‚  β”‚ βœ“ Vouched by: TrustedCurator (you follow)              β”‚ β”‚
β”‚  β”‚ βœ“ Vouched by: 12 others in your network                β”‚ β”‚
β”‚  β”‚ βœ“ Developer account age: 2 years                        β”‚ β”‚
β”‚  β”‚ βœ“ Auth relay verified: wss://auth.cooldevstudios.com   β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ ⚠ Warnings: None                                        β”‚ β”‚
β”‚  β”‚                                                         β”‚ β”‚
β”‚  β”‚ Price: 21,000 sats (~$21.00)                           β”‚ β”‚
β”‚  β”‚ [BUY NOW]                                               β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

8.3 Warning Indicators

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  UNTRUSTED GAME WARNING                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  ⚠️  WARNING: This game has trust concerns                   β”‚
β”‚                                                              β”‚
β”‚  Issues detected:                                            β”‚
β”‚  βœ— No NIP-05 verification                                   β”‚
β”‚  βœ— Not vouched by anyone you follow                         β”‚
β”‚  βœ— New developer account (< 30 days)                        β”‚
β”‚  βœ— Similar name to popular game "Real Game Name"            β”‚
β”‚  βœ— Binary hash changed since last vouch                     β”‚
β”‚                                                              β”‚
β”‚  Proceeding may expose you to:                               β”‚
β”‚  - Malware and viruses                                       β”‚
β”‚  - Financial loss                                            β”‚
β”‚  - Data theft                                                β”‚
β”‚                                                              β”‚
β”‚  [Cancel]                [I Understand the Risks - Proceed] β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

9. Security Considerations & Risks

9.1 Threat Model

Threat Severity Mitigation
Malware distribution Critical Web of trust, NIP-05, curator reputation
Game impersonation High NIP-05, name similarity detection, developer history
License theft High Developer auth relay, session management
Account sharing Medium Concurrent session limits, heartbeat
Curator collusion Medium Distributed trust, dispute system
Relay censorship Low Multiple relay redundancy
Payment fraud Medium Lightning proof-of-payment
Key compromise Critical NIP-07, hardware wallet support

9.2 Risk: Malicious Games

Problem: Anyone can publish, including malware authors.

Mitigations:

  1. Games only appear if vouched by trusted curators
  2. NIP-05 creates legal accountability (real domain = real identity)
  3. Binary hashes ensure tampering detection
  4. Community can report and blacklist
  5. Default settings hide unvouched games

9.3 Risk: Impersonation

Problem: Bad actor publishes "Call of Duty" to steal money/infect users.

Mitigations:

  1. NIP-05 verification (real Activision would verify activision.com)
  2. Name similarity detection warns users
  3. Established developers have account history
  4. Curators won't vouch for obvious fakes
  5. Legal recourse if NIP-05 verified

9.4 Risk: Piracy via Key Sharing

Problem: Users share their nsec to let others play.

Mitigations:

  1. Single concurrent session enforcement
  2. Sharing nsec = sharing entire Nostr identity (high risk)
  3. Device fingerprinting (optional, privacy tradeoff)
  4. Session heartbeats detect anomalies

9.5 User Responsibility

The platform must clearly communicate:

  • Users are responsible for their key security
  • Following curators is a trust decision
  • Bypassing warnings is at user's own risk
  • No centralized support or refunds

10. Binary Distribution

10.1 Hosting Options

Games can be hosted via:

  1. Developer's own servers - Full control, traditional CDN
  2. IPFS/Filecoin - Decentralized, content-addressed
  3. BitTorrent - P2P distribution, magnet links
  4. Blossom (NIP-96) - Nostr-native file hosting

10.2 Binary Integrity

interface GameBinary {
  platform: 'windows' | 'macos' | 'linux';
  url: string;
  sha256: string;          // Hash of the file
  size: number;            // Bytes
  signature: string;       // Developer signature of hash
  mirrors?: string[];      // Alternative download locations
}

// Verification flow
async function verifyBinary(binary: GameBinary, developer: string) {
  const file = await download(binary.url);
  const hash = sha256(file);

  if (hash !== binary.sha256) {
    throw new Error('Binary hash mismatch - file may be corrupted or tampered');
  }

  const validSig = verifySchnorr(binary.sha256, binary.signature, developer);
  if (!validSig) {
    throw new Error('Invalid developer signature');
  }

  return true;
}

10.3 Update Mechanism

{
  "kind": 30101,
  "pubkey": "<developer_pubkey>",
  "tags": [
    ["d", "<game_d_tag>"],
    ["e", "<original_game_event>"],
    ["version", "1.1.0"],
    ["previous-version", "1.0.0"],
    ["changelog", "- Fixed crash bug\n- Added new level"],
    ["binary", "windows", "<new_url>", "<new_hash>", "<size>"],
    ["required", "false"]
  ],
  "content": "Detailed patch notes...",
  "sig": "<signature>"
}

11. Implementation Roadmap

Phase 1: Core Protocol (MVP)

  • Define custom Nostr event kinds
  • Implement basic client with key management
  • Game publication and discovery
  • Simple follow-based trust (depth = 1)
  • Lightning payment integration
  • License receipt creation

Phase 2: Developer Tools

  • Developer relay reference implementation
  • NIP-42 authentication module
  • Session management system
  • License verification API
  • Publisher dashboard

Phase 3: Trust & Curation

  • Full web of trust algorithm
  • Curator profiles and reputation
  • Vouch/dispute system
  • Trust settings UI
  • NIP-05 verification display

Phase 4: Enhanced Security

  • Binary signature verification
  • Impersonation detection
  • Community reporting
  • Offline license tokens
  • Multi-device management

Phase 5: Ecosystem

  • Developer SDK
  • API documentation
  • Third-party client support
  • Mobile companion app
  • Hardware wallet integration

12. Technology Stack (Proposed)

Client Application

  • Framework: Tauri (Rust + Web) or Electron
  • Frontend: React/Svelte with TypeScript
  • Nostr: nostr-tools, NDK
  • Storage: SQLite for local data
  • Downloads: aria2 or native

Developer Auth Relay

  • Base: HORNETS Nostr Relay (https://github.com/HORNET-Storage/HORNETS-Nostr-Relay)
  • Language: Go
  • Features: Configurable kind support via web dashboard, NIP-42 auth, Blossom blob support
  • Database: Built-in storage with YAML configuration
  • Deployment: Docker, easy self-hosting
  • Customization: Add custom kinds 30100-30106, extend with license verification and session management

Reference Implementation

  • Relay: HORNETS fork with GameStart auth extensions
  • Client: TypeScript/Tauri
  • Mobile: React Native with Nostr

13. Design Decisions

13.1 Refund Policy

Decision: Developer discretion with transparent policy display.

Mechanism:

  • Developers specify their refund policy in the game publication event
  • Refunds are processed by removing the user's npub from the developer's auth relay
  • When the user attempts to launch the game, authentication fails and access is revoked
  • Developer manually refunds the Bitcoin/Lightning payment

Critical Implication - Online vs Offline Games:

Game Type Auth Required Refundable Notes
Online-only Yes (always) Yes Developer can revoke access anytime
Offline-capable Initial only No Once authenticated, runs without network
Fully offline Never No No DRM, pure trust-based

Refund policy field in game publication:

["refund-policy", "30-day", "Full refund within 30 days, no questions asked"]
["refund-policy", "none", "All sales are final"]
["refund-policy", "custom", "Refunds at developer discretion, contact support@..."]

This approach is:

  • Self-enforcing: No platform intervention needed
  • Transparent: Policy visible before purchase
  • Flexible: Each developer sets their own terms
  • Compatible: Fits existing auth relay architecture

13.2 Curator Compensation

Decision: No automatic curator fees.

Curators contribute voluntarily for:

  • Building reputation in the community
  • Supporting developers and games they believe in
  • Growing their follower base
  • Altruistic curation

This avoids:

  • Incentivizing paid/shill vouches
  • Complexity in payment splitting
  • Potential curator corruption

Users can voluntarily tip curators via Lightning zaps if they appreciate their work.

13.3 Open Questions (Remaining)

  1. Free-to-play / Demos: How to handle games with in-app purchases?

    • Need additional event kinds for IAP
  2. Dispute Resolution: How to handle malware reports?

    • Community flagging system
    • Curator reputation penalties
    • Emergency broadcast for critical threats

14. Verification & Testing Plan

Protocol Verification

  1. Test event creation and signing
  2. Verify events propagate across relays
  3. Test NIP-42 authentication flow
  4. Verify license receipts are cryptographically sound

Client Testing

  1. Key generation and management
  2. Game discovery based on trust settings
  3. Purchase flow end-to-end
  4. Download and hash verification
  5. Game launch with auth relay

Security Testing

  1. Attempt to forge license receipts
  2. Test concurrent session prevention
  3. Attempt impersonation attacks
  4. Binary tampering detection
  5. Trust algorithm edge cases

15. Project Structure

GameStart/
β”œβ”€β”€ docs/
β”‚   └── SPECIFICATION.md          # This document
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ nostr-game-protocol/      # Event kind definitions
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ events/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ game.ts       # Kind 30100
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ update.ts     # Kind 30101
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ vouch.ts      # Kind 30102
β”‚   β”‚   β”‚   β”‚   └── license.ts    # Kind 30103
β”‚   β”‚   β”‚   β”œβ”€β”€ trust/
β”‚   β”‚   β”‚   β”‚   └── web-of-trust.ts
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   └── package.json
β”‚   β”œβ”€β”€ client/                   # Desktop client (Tauri)
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ src-tauri/
β”‚   β”‚   └── package.json
β”‚   └── dev-relay/                # Developer auth relay
β”‚       β”œβ”€β”€ src/
β”‚       └── Cargo.toml
└── README.md

Summary

GameStart provides a complete decentralized alternative for game distribution by leveraging:

  1. Nostr for identity - Cryptographic keys for all participants
  2. Web of trust for safety - Community-driven curation
  3. Developer relays for licensing - Self-sovereign DRM
  4. Lightning for payments - Instant, low-fee, provable transactions
  5. NIP-05 for verification - Legal accountability through domain ownership

The system eliminates platform fees while maintaining security through distributed trust rather than centralized authority.