NIPs by PolleramaCommunity NIPs, surfaced by trustConnect
npub1scvyzz02aym...

Magic: The Gathering Decks

Published Jul 23, 2025

NIP-MG

Magic: The Gathering Decks

draft optional

This NIP defines kind:37381 events for storing Magic: The Gathering deck lists. These events allow players to share, store, and discover MTG decks on the Nostr protocol.

Event Structure

Kind

37381 - Magic: The Gathering Deck

Tags

  • d (required): Unique identifier for the deck
  • title (required): Human-readable name of the deck
  • C (optional, multiple): Card name of the commander(s) (for Commander format decks)
  • S (optional): Card name of the companion
  • b (optional, multiple): Sideboard card entries in the format ["b", "name", "quantity", "set_id", "art_id", "lang", "foil"]
  • banner (optional): URL to featured artwork representing the deck
  • t (optional): Format tags (e.g., "standard", "modern", "commander", "legacy") and other deck attributes
  • c (required, multiple): Card entries in the format ["c", "name", "quantity", "set_id", "art_id", "lang", "foil"]
  • alt (recommended): Human-readable description of the deck for accessibility (NIP-31)

Card Tag Format

Each card in the deck is represented by a c tag with the following structure:

["c", "name", "quantity", "set_id", "art_id", "lang", "foil"]

Where:

  • name (string, required): The exact card name as it appears on the card
  • quantity (string, required): Number of copies of this card in the deck
  • set_id (string, optional): The set identifier (e.g., "MID", "VOW", "NEO"), can be empty string ""
  • art_id (string, optional): Unique identifier for the specific artwork variant, can be empty string ""
  • lang (string, optional): The two-letter ISO 639-1 language code (e.g., "en", "es", "fr", "ja", "ko", "ru", "zhs", "zht").
  • foil (string, optional): "foil" if the card is foil, considered not foil otherwise

Sideboard Tag Format

Each card in the sideboard is represented by a b tag with the same structure as the c tag:

["b", "name", "quantity", "set_id", "art_id", "lang", "foil"]

Content

The content field SHOULD be empty ("") as all deck information is stored in tags for efficient querying.

Examples

Modern Deck with Sideboard

{
  "kind": 37381,
  "content": "",
  "tags": [
    ["d", "modern-burn-deck"],
    ["title", "Modern Burn"],
    ["alt", "Magic: The Gathering Deck - Modern Burn"],
    ["banner", "https://example.com/burn-art.jpg"],
    ["t", "modern"],
    ["t", "aggro"],
    ["t", "burn"],
    ["c", "Lightning Bolt", "4", "M21", "162", "en", ""],
    ["c", "Monastery Swiftspear", "4", "KTK", "118", "en", ""],
    ["c", "Goblin Guide", "4", "ZEN", "126", "en", "true"],
    ["c", "Mountain", "20", "", "", "en", ""],
    ["b", "Smash to Smithereens", "3", "M15", "163", "en", ""],
    ["b", "Kor Firewalker", "2", "M11", "22", "en", ""]
  ]
}

Commander Deck with Partners

{
  "kind": 37381,
  "content": "",
  "tags": [
    ["d", "tymna-kraum-deck"],
    ["title", "Tymna and Kraum"],
    ["alt", "Magic: The Gathering Deck - Tymna and Kraum"],
    ["C", "Tymna the Weaver"],
    ["C", "Kraum, Ludevic's Opus"],
    ["banner", "https://example.com/partner-art.jpg"],
    ["t", "commander"],
    ["t", "cedh"],
    ["c", "Tymna the Weaver", "1", "C16", "48", "en", ""],
    ["c", "Kraum, Ludevic's Opus", "1", "C16", "34", "en", ""],
    ["c", "Force of Will", "1", "2XM", "51", "en", "true"]
  ]
}

Commander Deck

{
  "kind": 37381,
  "content": "",
  "tags": [
    ["d", "my-dragon-deck"],
    ["title", "Ur-Dragon Tribal"],
    ["alt", "Magic: The Gathering Deck - Ur-Dragon Tribal"],
    ["C", "The Ur-Dragon"],
    ["S", "Jegantha, the Wellspring"],
    ["banner", "https://example.com/ur-dragon-art.jpg"],
    ["t", "commander"],
    ["t", "tribal"],
    ["t", "dragons"],
    ["c", "The Ur-Dragon", "1", "C17", "1", "en", ""],
    ["c", "Dragonlord Ojutai", "1", "DTK", "42", "ja", "true"],
    ["c", "Lightning Bolt", "1", "M21", "162", "en", ""],
    ["c", "Command Tower", "1", "C21", "284", "en", ""]
  ]
}

Client Behavior

Publishing

Clients SHOULD:

  • Validate that card names exist in official MTG databases
  • Ensure deck legality for the specified format(s) when possible
  • Use consistent set identifiers (preferably official Wizards of the Coast set codes)
  • Include appropriate t tags for format and archetype classification
  • Include a NIP-31 alt tag with a human-readable description of the deck for accessibility and compatibility with clients that don't support kind 37381
  • If lang is empty or missing, clients should default to the client's language.

Querying

Clients can efficiently query decks by:

  • Format: {"kinds": [37381], "#t": ["commander"]}
  • Card inclusion (main deck): {"kinds": [37381], "#c": ["Lightning Bolt"]}
  • Card inclusion (sideboard): {"kinds": [37381], "#b": ["Kor Firewalker"]}
  • Commander: {"kinds": [37381], "#C": ["The Ur-Dragon", "Tymna the Weaver"]}
  • Companion: {"kinds": [37381], "#S": ["Jegantha, the Wellspring"]}
  • Author's decks: {"kinds": [37381], "authors": ["pubkey"]}

Display

Clients SHOULD:

  • Display the deck title prominently
  • Show the commander and companion separately for relevant format decks
  • Group cards by type (creatures, spells, lands, etc.) when displaying
  • Display the sideboard separately from the main deck
  • Indicate foil cards with appropriate visual styling
  • Show banner artwork when available