{"id":"227077dab7b5b42f92e93e5972e95491329ae3fed098e43e419e94a005c7d8ac","pubkey":"fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1","created_at":1782722502,"kind":30817,"tags":[["d","nip-54"],["title","NIP-54"],["alt","Nostr Implementation Possibility: NIP-54"],["k","30818","threads"],["i","https://github.com/nostr-protocol/nips/blob/master/54.md","fork"],["k","30819","redirects"],["k","818","merge request"],["k","819","merge acceptance"],["client","imwald"]],"content":"NIP-54\n======\n\nWiki\n----\n\n`draft` `optional`\n\nThis NIP defines `kind:30818` (an _addressable event_) for descriptions (or encyclopedia entries) of particular subjects, and it's expected that multiple people will write articles about the exact same subjects, with either small variations or completely independent content.\n\nArticles are identified by lowercase, normalized `d` tags.\n\n## Articles\n```json\n{\n  \"content\": \"A wiki is a hypertext publication collaboratively edited and managed by its own audience.\",\n  \"tags\": [\n    [\"d\", \"wiki\"],\n    [\"title\", \"Wiki\"]\n  ]\n}\n```\n\n## `d` tag normalization rules\n\n- All letters with uppercase/lowercase variants MUST be converted to lowercase.\n- Whitespace MUST be converted to `-`.\n- Punctuation and symbols SHOULD be removed.\n- Multiple consecutive `-` SHOULD be collapsed to a single `-`.\n- Leading and trailing `-` SHOULD be removed.\n- Non-ASCII letters (e.g., Japanese, Chinese, Arabic, Cyrillic) MUST be preserved as UTF-8.\n- Numbers MUST be preserved.\n\nFor example:\n- `\"Wiki Article\"` → `\"wiki-article\"`\n- `\"What's Up?\"` → `\"whats-up\"`\n- `\"  Hello  World  \"` → `\"hello-world\"`\n- `\"Article 1\"` → `\"article-1\"`\n- `\"ウィキペディア\"` → `\"ウィキペディア\"` (Japanese, no case change)\n- `\"Ñoño\"` → `\"ñoño\"` (Spanish, lowercased)\n- `\"Москва\"` → `\"москва\"` (Russian, lowercased)\n- `\"日本語 Article\"` → `\"日本語-article\"` (mixed scripts)\n\n## Content\n\nThe `content` should be Asciidoc with two extra functionalities: **wikilinks** and **nostr:...** links.\n\nUnlike normal Asciidoc links `http://example.com[]` that link to external webpages, wikilinks `[[]]` link to other articles in the wiki. In this case, the wiki is the entirety of Nostr. Clicking on a wikilink should cause the client to ask relays for events with `d` tags equal to the target of that wikilink.\n\nWikilinks can take these forms:\n\n  1. `[[Target Page]]` -- links to `target-page` and displays as `Target Page`;\n  2. `[[target page|see this]]` -- links to `target-page` but displays as `see this`;\n  3. `[[日本語 Topic|Japanese Topic]]` -- links to `日本語-topic` and displays as `Japanese Topic`.\n\n`nostr:...` links should link to profiles or arbitrary Nostr events. Although it is not recommended to link to specific versions of articles -- instead the _wikilink_ syntax should be preferred, since it should be left to the reader and their client to decide what version of any given article they want to read.\n\n## Optional extra tags\n\n  - `title`: for when the display title should be different from the `d` tag.\n  - `summary`: for display in lists.\n  - `a` and `e`: for referencing the original event a wiki article was forked from.\n\n## Merge Requests\n\nEvent `kind:818` represents a request to merge from a forked article into the source. It is directed to a pubkey and references the original article and the modified event.\n\n```json\n{\n  \"content\": \"I added information about the block size limit\",\n  \"kind\": 818,\n  \"tags\": [\n    [\"a\", \"30818:<destination-pubkey>:bitcoin\", \"<relay-url>\"],\n    [\"e\", \"<version-against-which-the-modification-was-made>\", \"<relay-url>\"],\n    [\"p\", \"<destination-pubkey>\"],\n    [\"e\", \"<version-to-be-merged>\", \"<relay-url>\", \"fork\"]\n  ]\n}\n```\n\n- `.content`: an optional explanation detailing why this merge is being requested.\n- `a` tag: tag of the article which should be modified (i.e. the target of this merge request).\n- `e` tag: optional version of the article on which this modification is based.\n- `e` tag with `fork` marker: the ID of the event that should be merged. This event id MUST be of a `kind:30818` as defined in this NIP, and SHOULD be the forked version that carries the `fork` marker.\n\n### Accepting or rejecting a merge request\n\nThe destination pubkey can respond to a `kind:818` merge request in either of two ways:\n\n1. **NIP-25 reaction** — a reaction event that tags the `kind:818` event with `+` to accept or `-` to reject the merge request. This is the lightweight signal and does not, by itself, publish the merged content.\n\n2. **`kind:819` merge acceptance** — when the destination pubkey actually merges the change (by publishing a new version of their `kind:30818` article that incorporates the proposed content), they MAY publish a `kind:819` event to explicitly record that the merge request was accepted and to point at the resulting version.\n\n```json\n{\n  \"kind\": 819,\n  \"content\": \"\",\n  \"tags\": [\n    [\"e\", \"<id-of-the-resulting-merged-version>\", \"<relay-url>\", \"result\"],\n    [\"e\", \"<id-of-the-kind-818-merge-request>\", \"<relay-url>\", \"request\"],\n    [\"p\", \"<pubkey-of-the-merge-request-author>\"]\n  ]\n}\n```\n\n- `e` tag with `result` marker: the ID of the newly published `kind:30818` version that contains the merged changes.\n- `e` tag with `request` marker: the ID of the `kind:818` merge request that was accepted.\n- `p` tag: the pubkey of the author who submitted the merge request, so they can be notified that their contribution was incorporated.\n\nClients SHOULD treat a `kind:819` event as a stronger, affirmative signal than a `+` reaction, since it also links to the concrete merged version. A merge request MAY be accepted with a `kind:819` event, a `+` reaction, or both.\n\n## Redirects\n\nEvent `kind:30819` is also defined to stand for \"wiki redirects\", i.e. if one thinks \"BTC\" should redirect to \"Bitcoin\" they can issue one of these events instead of replicating the content. These events can be used for automatically redirecting between articles on a client, but also for generating crowdsourced \"disambiguation\" pages ([common in Wikipedia](https://en.wikipedia.org/wiki/Help:Disambiguation)).\n\n```json\n{\n  \"kind\": 30819,\n  \"tags\": [\n    [\"d\", \"btc\"],\n    [\"a\", \"30818:<pubkey>:bitcoin\", \"<relay-url>\"]\n  ],\n  \"content\": \"\"\n}\n```\n\n## How to decide what article to display\n\nAs there could be many articles for each given name, some kind of prioritization must be done by clients. Criteria for this should vary between users and clients, but some means that can be used are described below:\n\n### Pages and Recommendations from Sender\n\nIf someone includes a wikilink in their note, their wiki page on the subject, or the page(s) they have deferred to or positively reacted to, might be ranked higher on the results page.\n\n### Reactions\n\nNIP-25 reactions are very simple and can be used to create a simple web-of-trust between wiki article writers and their content. While just counting a raw number of \"likes\" is unproductive, reacting to any wiki article event with a `+` can be interpreted as a recommendation for that article specifically and a partial recommendation of the author of that article. When 2 or 3-level deep recommendations are followed, suddenly a big part of all the articles may have some form of tagging.\n\n### Relays\n\nNIP-51 lists of relays can be created with the kind 10102 and then used by wiki clients in order to determine where to query articles first and to rank these differently in relation to other events fetched from other relays.\n\n### Contact lists\n\nNIP-02 contact lists can form the basis of a recommendation system that is then expanded with relay lists and reaction lists through nested queries. These lists form a good starting point only because they are so widespread.\n\n### Wiki-related contact lists\n\nNIP-51 lists can also be used to create a list of users that are trusted only in the context of wiki authorship or wiki curationship.\n\n## Forks\nWiki-events can tag other wiki-events with a `fork` marker to specify that this event came from a different version. Both `a` and `e` tags SHOULD be used and have the `fork` marker applied, to identify the exact version it was forked from.\n\n## Deference\nWiki-events can tag other wiki-events with a `defer` marker to indicate that it considers someone else's entry as a \"better\" version of itself. If using a `defer` marker both `a` and `e` tags SHOULD be used.\n\nThis is a stronger signal of trust than a `+` reaction.\n\nThis marker is useful when a user edits someone else's entry; if the original author includes the editor's changes and the editor doesn't want to keep/maintain an independent version, the `link` tag could effectively be a considered a \"deletion\" of the editor's version and putting that pubkey's WoT weight behind the original author's version.","sig":"49cff23016de090f7b5078be623ffd07ba65958c9396e56069ead5eb62ca47a3b3133a39446de28210e487822d5a4c712c57c41b8e1dd0706d4fa621c23a8f01"}