upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/54.md
diff options
context:
space:
mode:
Diffstat (limited to '54.md')
-rw-r--r--54.md112
1 files changed, 112 insertions, 0 deletions
diff --git a/54.md b/54.md
new file mode 100644
index 0000000..8823af9
--- /dev/null
+++ b/54.md
@@ -0,0 +1,112 @@
1NIP-54
2======
3
4Wiki
5----
6
7`draft` `optional`
8
9This NIP defines `kind:30818` (a _parameterized replaceable event_) for long-form text content similar to [NIP-23](23.md), but with one important difference: articles are meant to be 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.
10
11Articles are identified by lowercase, normalized ascii `d` tags.
12
13### Articles
14```jsonc
15{
16 "content": "A wiki is a hypertext publication collaboratively edited and managed by its own audience.",
17 "tags": [
18 ["d", "wiki"],
19 ["title", "Wiki"],
20 ]
21}
22```
23
24### `d` tag normalization rules
25
26- Any non-letter character MUST be converted to a `-`.
27- All letters MUST be converted to lowercase.
28
29### Content rules
30
31The content should be Markdown, following the same rules as of [NIP-23](23.md), although it takes some extra (optional) metadata tags:
32
33 - `title`: for when the display title should be different from the `d` tag.
34 - `summary`: for display in lists.
35 - `a` and `e`: for referencing the original event a wiki article was forked from.
36
37One extra functionality is added: **wikilinks**. Unlike normal Markdown links `[]()` that link to 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.
38
39### Merge Requests
40
41Event `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.
42
43[INSERT EVENT EXAMPLE]
44
45### Redirects
46
47Event `kind:30819` is also defined to stand for "wiki redirects", i.e. if one thinks `Shell structure` should redirect to `Thin-shell structure` 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)).
48
49[INSERT EVENT EXAMPLE]
50
51How to decide what article to display
52-------------------------------------
53
54As 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:
55
56### Reactions
57
58[NIP-25](25.md) 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.
59
60### Relays
61
62[NIP-51](51.md) 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.
63
64### Contact lists
65
66[NIP-02](02.md) 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.
67
68### Wiki-related contact lists
69
70[NIP-51](51.md) lists can also be used to create a list of users that are trusted only in the context of wiki authorship or wiki curationship.
71
72Forks
73---------
74Wiki-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.
75
76Deference
77---------
78Wiki-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.
79
80This is a stronger signal of trust than a `+` reaction.
81
82This 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.
83
84Why Markdown?
85-------------
86
87If the idea is to make a wiki then the most obvious text format to use is probably the mediawiki/wikitext format used by Wikipedia since it's widely deployed in all mediawiki installations and used for decades with great success. However, it turns out that format is very bloated and convoluted, has way too many features and probably because of that it doesn't have many alternative implementations out there, and the ones that exist are not complete and don't look very trustworthy. Also it is very much a centralized format that can probably be changed at the whims of the Wikipedia owners.
88
89On the other hand, Markdown has proven to work well for small scale wikis and one of the biggest wikis in the planet (which is not very often thought of as a wiki), [StackOverflow](https://stackoverflow.com) and its child sites, and also one of the biggest "personal wiki" software, [Obsidian](https://obsidian.md/). Markdown can probably deliver 95% of the functionality of wikitext. When augmented with tables, diagram generators and MathJax (which are common extensions that exist in the wild and can be included in this NIP) that rate probably goes to 99%, and its simplicity is a huge benefit that can't be overlooked. Wikitext format can also be transpíled into Markdown using Pandoc. Given all that, I think it's a reasonable suspicion that mediawiki is not inherently better than Markdown, the success of Wikipedia probably cannot be predicated on the syntax language choice.
90
91# Appendix 1: Merge requests
92Users can request other users to get their entries merged into someone else's entry by creating a `kind:818` event.
93
94```jsonc
95{
96 "content": "I added information about how to make hot ice-creams",
97 "kind": 818,
98 "tags": [
99 [ "a", "30818:<destination-pubkey>:hot-ice-creams", "<relay-url>" ],
100 [ "e", "<version-against-which-the-modification-was-made>", "<relay-url>' ],
101 [ "p", "<destination-pubkey>" ],
102 [ "e", "<version-to-be-merged>", "<relay-url>", "source" ]
103 ]
104}
105```
106
107`.content`: an optional explanation detailing why this merge is being requested.
108`a` tag: tag of the article which should be modified (i.e. the target of this merge request).
109`e` tag: optional version of the article in which this modifications is based
110`e` tag with `source` marker: the ID of the event that should be merged. This event id MUST be of a `kind:30818` as defined in this NIP.
111
112The destination-pubkey (the pubkey being requested to merge something into their article can create [[NIP-25]] reactions that tag the `kind:818` event with `+` or `-`