NIPs nostr improvement proposals

NIP-54 - Wiki

Table of Contents

Wiki

draft optional

This 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.

Articles are identified by lowercase, normalized d tags.

Articles

{
"content": "A wiki is a hypertext publication collaboratively edited and managed by its own audience.",
"tags": [
["d", "wiki"],
["title", "Wiki"]
]
}

d tag normalization rules

For example:

Content

The content should be Djot with two special functionalities:

  1. Links can have target URIs in NIP-21 format, like [Bob](nostr:npub1...).
  2. When a reference can't be found for a reference-style link, it should link to the wiki article with that name instead (wikilink behavior). The target is normalized following the d tag normalization rules above.

For example:

Bitcoin is a [cryptocurrency][] invented by [Satoshi Nakamoto][].
See also: [proof of work][] and [lightning network][Lightning Network].
[Satoshi Nakamoto]: nostr:npub1satoshi...

In the article above:

Wikilinks also work with non-Latin scripts following the same normalization rules:

NIP-21 nostr: links can also be used to link to profiles or arbitrary Nostr events. It is not recommended to link to specific versions of articles — the wikilink syntax should be preferred instead, since it should be left to the reader and their client to decide what version of any given article they want to read.

Optional extra tags

Merge Requests

Event 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.

{
"content": "I added information about the block size limit",
"kind": 818,
"tags": [
["a", "30818:<destination-pubkey>:bitcoin", "<relay-url>"],
["e", "<version-against-which-the-modification-was-made>", "<relay-url>"],
["p", "<destination-pubkey>"],
["e", "<version-to-be-merged>", "<relay-url>", "source"]
]
}

The destination pubkey can create NIP-25 reactions that tag the kind:818 event with + or - to accept or reject the merge request.

Redirects

Event 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).

{
"kind": 30819,
"tags": [
["d", "btc"],
["a", "30818:<pubkey>:bitcoin", "<relay-url>"]
],
"content": ""
}

How to decide what article to display

As 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:

Reactions

NIP-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.

Relays

NIP-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.

Contact lists

NIP-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.

NIP-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.

Forks

Wiki-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.

Deference

Wiki-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.

This is a stronger signal of trust than a + reaction.

This 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 defer tag could effectively be considered a "deletion" of the editor's version and putting that pubkey's WoT weight behind the original author's version.

Why Djot?

Djot is a markup language created by John MacFarlane (author of Pandoc and co-author of CommonMark). It was chosen for the following reasons: