upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf_ <fiatjaf@gmail.com>2024-05-02 11:04:55 -0300
committerGitHub <noreply@github.com>2024-05-02 11:04:55 -0300
commit218fbb1cc7ac900fd256f666cb6add590cabb24a (patch)
tree80d64e8ac4f1a5df4c548fd6dc10b6b232013328
parent88246c27414d11983dced414462b2be2d010fad8 (diff)
NIP-54: decentralized wikis (#787)
* draft of NIP-34: decentralized wikis. * add merge requests. * add merge request flow * update nip number --------- Co-authored-by: Pablo Fernandez <p@f7z.io>
-rw-r--r--51.md26
-rw-r--r--54.md106
-rw-r--r--README.md2
3 files changed, 122 insertions, 12 deletions
diff --git a/51.md b/51.md
index 95acbc8..fb40b26 100644
--- a/51.md
+++ b/51.md
@@ -20,18 +20,20 @@ Standard lists use non-parameterized replaceable events, meaning users may only
20 20
21For example, _mute list_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from. 21For example, _mute list_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from.
22 22
23| name | kind | description | expected tag items | 23| name | kind | description | expected tag items |
24| --- | --- | --- | --- | 24| --- | --- | --- | --- |
25| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags), `"word"` (lowercase string), `"e"` (threads) | 25| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags), `"word"` (lowercase string), `"e"` (threads) |
26| Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | 26| Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) |
27| Bookmarks | 10003 | uncategorized, "global" list of things a user wants to save | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r"` (URLs) | 27| Bookmarks | 10003 | uncategorized, "global" list of things a user wants to save | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r"` (URLs) |
28| Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | 28| Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) |
29| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) | 29| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) |
30| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | 30| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) |
31| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | 31| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) |
32| Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group ids + mandatory relay URL) | 32| Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group ids + mandatory relay URL) |
33| Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) | 33| Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) |
34| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) | 34| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) |
35| Good wiki authors | 10101 | [NIP-54](54.md) user recommended wiki authors | `"p"` (pubkeys) |
36| Good wiki relays | 10102 | [NIP-54](54.md) relays deemed to only host useful articles | `"relay"` (relay URLs) |
35 37
36## Sets 38## Sets
37 39
diff --git a/54.md b/54.md
new file mode 100644
index 0000000..9063ca9
--- /dev/null
+++ b/54.md
@@ -0,0 +1,106 @@
1NIP-54
2======
3
4Wiki
5----
6`draft` `optional`
7
8This 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.
9
10Articles are identified by lowercase, normalized ascii `d` tags.
11
12### Articles
13```js
14{
15 "content": "A wiki is a hypertext publication collaboratively edited and managed by its own audience.",
16 "tags": [
17 [ "d", "wiki" ],
18 [ "title", "Wiki" ],
19 ]
20}
21```
22
23[INSERT NORMALIZATION EXAMPLES]
24
25The content should be Markdown, following the same rules as of [NIP-23](23.md), although it takes some extra (optional) metadata tags:
26
27 - `title`: for when the display title should be different from the `d` tag.
28 - `summary`: for display in lists.
29 - `a` and `e`: for referencing the original event a wiki article was forked from.
30
31One 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.
32
33### Merge Requests
34
35Event `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.
36
37[INSERT EVENT EXAMPLE]
38
39### Redirects
40
41Event `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)).
42
43[INSERT EVENT EXAMPLE]
44
45How to decide what article to display
46-------------------------------------
47
48As 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:
49
50### Reactions
51
52[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.
53
54### Relays
55
56[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.
57
58### Contact lists
59
60[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.
61
62### Wiki-related contact lists
63
64[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.
65
66Forks
67---------
68Wiki-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.
69
70Deference
71---------
72Wiki-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.
73
74This is a stronger signal of trust than a `+` reaction.
75
76This 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 indepedent 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.
77
78Why Markdown?
79-------------
80
81If 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.
82
83On 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.
84
85# Appendix 1: Merge requests
86Users can request other users to get their entries merged into someone else's entry by creating a `kind:818` event.
87
88```js
89{
90 "content": "I added information about how to make hot ice-creams",
91 "kind": 818,
92 "tags": [
93 [ "a", "30818:<destination-pubkey>:hot-ice-creams", "<relay-url>" ],
94 [ "e", "<version-against-which-the-modification-was-made>", "<relay-url>' ],
95 [ "p", "<destination-pubkey>" ],
96 [ "e", "<version-to-be-merged>", "<relay-url>", "source" ]
97 ]
98}
99```
100
101`.content`: an optional explanation detailing why this merge is being requested.
102`a` tag: tag of the article which should be modified (i.e. the target of this merge request).
103`e` tag: optional version of the article in which this modifications is based
104`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.
105
106The 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 `-`
diff --git a/README.md b/README.md
index 619c984..b3736ea 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
66- [NIP-51: Lists](51.md) 66- [NIP-51: Lists](51.md)
67- [NIP-52: Calendar Events](52.md) 67- [NIP-52: Calendar Events](52.md)
68- [NIP-53: Live Activities](53.md) 68- [NIP-53: Live Activities](53.md)
69- [NIP-54: Wiki](54.md)
69- [NIP-56: Reporting](56.md) 70- [NIP-56: Reporting](56.md)
70- [NIP-57: Lightning Zaps](57.md) 71- [NIP-57: Lightning Zaps](57.md)
71- [NIP-58: Badges](58.md) 72- [NIP-58: Badges](58.md)
@@ -171,6 +172,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
171| `30402` | Classified Listing | [99](99.md) | 172| `30402` | Classified Listing | [99](99.md) |
172| `30403` | Draft Classified Listing | [99](99.md) | 173| `30403` | Draft Classified Listing | [99](99.md) |
173| `30617` | Repository announcements | [34](34.md) | 174| `30617` | Repository announcements | [34](34.md) |
175| `30818` | Wiki article | [54](54.md) |
174| `31922` | Date-Based Calendar Event | [52](52.md) | 176| `31922` | Date-Based Calendar Event | [52](52.md) |
175| `31923` | Time-Based Calendar Event | [52](52.md) | 177| `31923` | Time-Based Calendar Event | [52](52.md) |
176| `31924` | Calendar | [52](52.md) | 178| `31924` | Calendar | [52](52.md) |