{"id":"a19ec64d1ae428f3d7605879f415e0a4a8551d9086ea9ae2ea298db28c6abbdf","pubkey":"4abc8f17e30e49e8b960ea8211cfcc6448cc908b741e7f9819f066f272470848","created_at":1750201988,"kind":30817,"tags":[["d","nip-decks-flashcards"],["title","Decks and Flashcards"],["k","30500"],["k","30501"],["client","nostrhub.io"]],"content":"# NIP-DF: Decks and Flashcards\n\n## Summary\nDefines a standard format for representing **decks** of flashcards and **flashcards** themselves as Nostr events, including how to link flashcards to their parent decks.\n\n## Tags\n`deck`, `flashcard`, `learning`, `education`\n\n---\n\n## Motivation\n\nThere is currently no standard way in Nostr to create structured learning materials like decks of flashcards. This NIP enables:\n- Users to create decks and share them.\n- Flashcards to be attached to decks.\n- Flashcards and decks to be synchronized, versioned, and distributed across clients.\n\n---\n\n## Event Kinds\n\n| Kind  | Name        | Description                   |\n|-------|-------------|-------------------------------|\n| 30500 | `deck`      | Defines a deck of flashcards  |\n| 30501 | `flashcard` | Defines a flashcard attached to a deck |\n\n---\n\n## Deck Event (`kind: 30500`)\n\nA deck event represents a named collection of flashcards.\n\n```json\n{\n  \"kind\": 30500,\n  \"tags\": [\n    [\"d\", \"<deck-id>\"],\n    [\"name\", \"Basic Math\"],\n    [\"description\", \"A deck of flashcards covering basic arithmetic.\"],\n    [\"subject\", \"Mathematics\"],\n    [\"version\", \"1\"]\n  ],\n  \"content\": \"\"\n}\n```\n\n### Required Tags\n\n- `[\"d\", <deck-id>]`: A unique ID for the deck (deterministically derived or randomly generated).\n- `[\"name\", <deck-name>]`: The display name of the deck.\n\n### Optional Tags\n\n- `[\"description\", <text>]`: A human-readable description.\n- `[\"subject\", <topic>]`: Topic or category (e.g., history, math, science).\n- `[\"version\", <version>]`: Version number for content updates.\n\n## Flashcard Event (`kind: 30501`)\n\nA flashcard event represents a single question/answer pair.\n\n```json\n{\n  \"kind\": 30501,\n  \"tags\": [\n    [\"d\", \"<deck-id>\"],\n    [\"order\", \"3\"],\n    [\"version\", \"1\"]\n  ],\n  \"content\": \"{\\\"front\\\": \\\"What is 2 + 2?\\\", \\\"back\\\": \\\"4\\\"}\"\n}\n```\n\n### Required Tags\n\n- `[\"d\", <deck-id>]`: The deck ID this flashcard belongs to.\n\n### Optional Tags\n\n- `[\"order\", <index>]`: Index within the deck (integer or string).\n- `[\"version\", <version>]`: Version of the flashcard.\n\n### Content Format\n\nMust be a JSON object:\n\n```json\n{\n  \"front\": \"Question or prompt\",\n  \"back\": \"Answer or explanation\"\n}\n```\n\nOptionally, clients may support extra fields such as \"hint\" or \"media\".\n\n### Deterministic Deck ID\n\nClients may derive the `<deck-id>` using a `sha256(pubkey + created_at + name)`, or generate it randomly (e.g., `uuidv4()`), ensuring uniqueness.\n\n### Extensions (Future NIPs)\n\n- **Progress tracking**: Add `kind: 30502` to log study sessions or flashcard scores.\n- **Collaboration**: Multi-author decks.\n- **Flashcard types**: Support multiple choice, true/false, cloze deletion.\n- **Media support**: Embed or link images/audio.\n\n### Backward/Forward Compatibility\n\nClients not recognizing `kind: 30500` or `30501` will safely ignore them.\n\n### Use Cases\n\n- Personal study apps\n- Public learning repositories\n- Flashcard marketplaces\n- Collaborative classroom tools\n\n### Example Flow\n\n1. Alice creates a deck *Basic Spanish* (`kind: 30500`).\n2. Alice creates 10 flashcards (`kind: 30501`) tagged with the deck ID.\n3. Bob subscribes to Alice’s pubkey and loads the deck and cards.\n4. Bob studies and optionally tracks his progress with `kind: 30502`.","sig":"c174175638309d2d3344d7400ab7c2c554d33bdd64f4e1107deee8b24174767168a7f4d7f9b53b302312a426db48a9d2894ca9da89c1215df1d1b87be977ef00"}