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>2023-11-18 09:13:12 -0300
committerfiatjaf <fiatjaf@gmail.com>2023-11-18 09:13:12 -0300
commit5dcfe85306434f21ecb1e7a47edd92b2e3e64f9a (patch)
tree4fff8694238b3ae5e692a8480869ad1266b95be4
parentb0df71824f9967130b54150b64cc70fa94bffec2 (diff)
reformat a bunch of json things and small nitpicks.
-rw-r--r--11.md18
-rw-r--r--13.md6
-rw-r--r--14.md8
-rw-r--r--15.md205
-rw-r--r--28.md46
-rw-r--r--32.md9
-rw-r--r--36.md26
-rw-r--r--39.md28
-rw-r--r--40.md24
-rw-r--r--42.md14
-rw-r--r--45.md21
-rw-r--r--53.md30
-rw-r--r--56.md1
-rw-r--r--72.md14
-rw-r--r--75.md17
-rw-r--r--84.md11
-rw-r--r--89.md84
-rw-r--r--90.md147
-rw-r--r--94.md7
-rw-r--r--98.md28
-rw-r--r--99.md6
21 files changed, 385 insertions, 365 deletions
diff --git a/11.md b/11.md
index e05cb1f..ab05f31 100644
--- a/11.md
+++ b/11.md
@@ -68,7 +68,6 @@ are rejected or fail immediately.
68 68
69```json 69```json
70{ 70{
71 ...
72 "limitation": { 71 "limitation": {
73 "max_message_length": 16384, 72 "max_message_length": 16384,
74 "max_subscriptions": 20, 73 "max_subscriptions": 20,
@@ -82,7 +81,8 @@ are rejected or fail immediately.
82 "payment_required": true, 81 "payment_required": true,
83 "created_at_lower_limit": 31536000, 82 "created_at_lower_limit": 31536000,
84 "created_at_upper_limit": 3 83 "created_at_upper_limit": 3
85 } 84 },
85 ...
86} 86}
87``` 87```
88 88
@@ -181,8 +181,8 @@ flexibility is up to the client software.
181 181
182```json 182```json
183{ 183{
184 "relay_countries": [ "CA", "US" ],
184 ... 185 ...
185 "relay_countries": [ "CA", "US" ]
186} 186}
187``` 187```
188 188
@@ -203,10 +203,10 @@ To support this goal, relays MAY specify some of the following values.
203 203
204```json 204```json
205{ 205{
206 "language_tags": ["en", "en-419"],
207 "tags": ["sfw-only", "bitcoin-only", "anime"],
208 "posting_policy": "https://example.com/posting-policy.html",
206 ... 209 ...
207 "language_tags": [ "en", "en-419" ],
208 "tags": [ "sfw-only", "bitcoin-only", "anime" ],
209 "posting_policy": "https://example.com/posting-policy.html"
210} 210}
211``` 211```
212 212
@@ -239,13 +239,13 @@ Relays that require payments may want to expose their fee schedules.
239 239
240```json 240```json
241{ 241{
242 ...
243 "payments_url": "https://my-relay/payments", 242 "payments_url": "https://my-relay/payments",
244 "fees": { 243 "fees": {
245 "admission": [{ "amount": 1000000, "unit": "msats" }], 244 "admission": [{ "amount": 1000000, "unit": "msats" }],
246 "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], 245 "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
247 "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], 246 "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }],
248 } 247 },
248 ...
249} 249}
250``` 250```
251 251
@@ -255,8 +255,8 @@ A URL pointing to an image to be used as an icon for the relay. Recommended to b
255 255
256```json 256```json
257{ 257{
258 ...
259 "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", 258 "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
259 ...
260} 260}
261``` 261```
262 262
diff --git a/13.md b/13.md
index 4b15bbe..53c4d1b 100644
--- a/13.md
+++ b/13.md
@@ -35,11 +35,7 @@ Example mined note
35 "created_at": 1651794653, 35 "created_at": 1651794653,
36 "kind": 1, 36 "kind": 1,
37 "tags": [ 37 "tags": [
38 [ 38 ["nonce", "776797", "21"]
39 "nonce",
40 "776797",
41 "21"
42 ]
43 ], 39 ],
44 "content": "It's just me mining my own business", 40 "content": "It's just me mining my own business",
45 "sig": "284622fc0a3f4f1303455d5175f7ba962a3300d136085b9566801bc2e0699de0c7e31e44c81fb40ad9049173742e904713c3594a1da0fc5d2382a25c11aba977" 41 "sig": "284622fc0a3f4f1303455d5175f7ba962a3300d136085b9566801bc2e0699de0c7e31e44c81fb40ad9049173742e904713c3594a1da0fc5d2382a25c11aba977"
diff --git a/14.md b/14.md
index 72e5e39..480c4c5 100644
--- a/14.md
+++ b/14.md
@@ -6,14 +6,16 @@ Subject tag in Text events
6 6
7`draft` `optional` 7`draft` `optional`
8 8
9This NIP defines the use of the "subject" tag in text (kind: 1) events. 9This NIP defines the use of the "subject" tag in text (kind: 1) events.
10(implemented in more-speech) 10(implemented in more-speech)
11 11
12`["subject": <string>]` 12```json
13["subject": <string>]
14```
13 15
14Browsers often display threaded lists of messages. The contents of the subject tag can be used in such lists, instead of the more ad hoc approach of using the first few words of the message. This is very similar to the way email browsers display lists of incoming emails by subject rather than by contents. 16Browsers often display threaded lists of messages. The contents of the subject tag can be used in such lists, instead of the more ad hoc approach of using the first few words of the message. This is very similar to the way email browsers display lists of incoming emails by subject rather than by contents.
15 17
16When replying to a message with a subject, clients SHOULD replicate the subject tag. Clients MAY adorn the subject to denote 18When replying to a message with a subject, clients SHOULD replicate the subject tag. Clients MAY adorn the subject to denote
17that it is a reply. e.g. by prepending "Re:". 19that it is a reply. e.g. by prepending "Re:".
18 20
19Subjects should generally be shorter than 80 chars. Long subjects will likely be trimmed by clients. 21Subjects should generally be shorter than 80 chars. Long subjects will likely be trimmed by clients.
diff --git a/15.md b/15.md
index 0ee000f..51b7792 100644
--- a/15.md
+++ b/15.md
@@ -1,14 +1,14 @@
1NIP-15 1NIP-15
2====== 2======
3 3
4Nostr Marketplace (for resilient marketplaces) 4Nostr Marketplace
5----------------------------------- 5-----------------
6 6
7`draft` `optional` 7`draft` `optional`
8 8
9> Based on https://github.com/lnbits/Diagon-Alley 9Based on https://github.com/lnbits/Diagon-Alley.
10 10
11> Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market) 11Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market).
12 12
13## Terms 13## Terms
14 14
@@ -35,29 +35,30 @@ The `merchant` admin software can be purely clientside, but for `convenience` an
35A merchant can publish these events: 35A merchant can publish these events:
36| Kind | | Description | 36| Kind | | Description |
37| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------- | 37| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------- |
38| `0 ` | `set_meta` | The merchant description (similar with any `nostr` public key). | 38| `0` | `set_meta` | The merchant description (similar with any `nostr` public key). |
39| `30017` | `set_stall` | Create or update a stall. | 39| `30017` | `set_stall` | Create or update a stall. |
40| `30018` | `set_product` | Create or update a product. | 40| `30018` | `set_product` | Create or update a product. |
41| `4 ` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | 41| `4` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. |
42| `5 ` | `delete` | Delete a product or a stall. | 42| `5` | `delete` | Delete a product or a stall. |
43 43
44### Event `30017`: Create or update a stall. 44### Event `30017`: Create or update a stall.
45 45
46**Event Content**: 46**Event Content**
47
47```json 48```json
48{ 49{
49 "id": <String, UUID generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>, 50 "id": <string, id generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>,
50 "name": <String, stall name>, 51 "name": <string, stall name>,
51 "description": <String (optional), stall description>, 52 "description": <string (optional), stall description>,
52 "currency": <String, currency used>, 53 "currency": <string, currency used>,
53 "shipping": [ 54 "shipping": [
54 { 55 {
55 "id": <String, UUID of the shipping zone, generated by the merchant>, 56 "id": <string, id of the shipping zone, generated by the merchant>,
56 "name": <String (optional), zone name>, 57 "name": <string (optional), zone name>,
57 "cost": <float, base cost for shipping. The currency is defined at the stall level>, 58 "cost": <float, base cost for shipping. The currency is defined at the stall level>,
58 "regions": [<String, regions included in this zone>], 59 "regions": [<string, regions included in this zone>],
59 } 60 }
60 ] 61 ]
61} 62}
62``` 63```
63 64
@@ -70,34 +71,39 @@ Fields that are not self-explanatory:
70 - each shipping zone contains the base cost for orders made to that shipping zone, but a specific shipping cost per 71 - each shipping zone contains the base cost for orders made to that shipping zone, but a specific shipping cost per
71 product can also be specified if the shipping cost for that product is higher than what's specified by the base cost. 72 product can also be specified if the shipping cost for that product is higher than what's specified by the base cost.
72 73
73**Event Tags**: 74**Event Tags**
75
74```json 76```json
75 "tags": [["d", <String, id of stall]] 77{
78 "tags": [["d", <string, id of stall]],
79 ...
80}
76``` 81```
77 - the `d` tag is required, its value MUST be the same as the stall `id`. 82 - the `d` tag is required, its value MUST be the same as the stall `id`.
78 83
79### Event `30018`: Create or update a product 84### Event `30018`: Create or update a product
80 85
81**Event Content**: 86**Event Content**
87
82```json 88```json
83{ 89{
84 "id": <String, UUID generated by the merchant.Sequential IDs (`0`, `1`, `2`...) are discouraged>, 90 "id": <string, id generated by the merchant (sequential ids are discouraged)>,
85 "stall_id": <String, UUID of the stall to which this product belong to>, 91 "stall_id": <string, id of the stall to which this product belong to>,
86 "name": <String, product name>, 92 "name": <string, product name>,
87 "description": <String (optional), product description>, 93 "description": <string (optional), product description>,
88 "images": <[String], array of image URLs, optional>, 94 "images": <[string], array of image URLs, optional>,
89 "currency": <String, currency used>, 95 "currency": <string, currency used>,
90 "price": <float, cost of product>, 96 "price": <float, cost of product>,
91 "quantity": <int or null, available items>, 97 "quantity": <int or null, available items>,
92 "specs": [ 98 "specs": [
93 [<String, spec key>, <String, spec value>] 99 [<string, spec key>, <string, spec value>]
94 ], 100 ],
95 "shipping": [ 101 "shipping": [
96 { 102 {
97 "id": <String, UUID of the shipping zone. Must match one of the zones defined for the stall>, 103 "id": <string, id of the shipping zone (must match one of the zones defined for the stall)>,
98 "cost": <float, extra cost for shipping. The currency is defined at the stall level>, 104 "cost": <float, extra cost for shipping. The currency is defined at the stall level>,
99 } 105 }
100 ] 106 ]
101} 107}
102``` 108```
103 109
@@ -114,16 +120,18 @@ Fields that are not self-explanatory:
114 - the `id` should match the id of the shipping zone, as defined in the `shipping` field of the stall 120 - the `id` should match the id of the shipping zone, as defined in the `shipping` field of the stall
115 - to calculate the total cost of shipping for an order, the user will choose a shipping option during checkout, and then the client must consider this costs: 121 - to calculate the total cost of shipping for an order, the user will choose a shipping option during checkout, and then the client must consider this costs:
116 - the `base cost from the stall` for the chosen shipping option 122 - the `base cost from the stall` for the chosen shipping option
117 - the result of multiplying the product units by the `shipping costs specified in the product`, if any. 123 - the result of multiplying the product units by the `shipping costs specified in the product`, if any.
124
125**Event Tags**
118 126
119**Event Tags**:
120```json 127```json
121 "tags": [ 128 "tags": [
122 ["d", <String, id of product], 129 ["d", <string, id of product],
123 ["t", <String (optional), product category], 130 ["t", <string (optional), product category],
124 ["t", <String (optional), product category], 131 ["t", <string (optional), product category],
125 ... 132 ...
126 ] 133 ],
134 ...
127``` 135```
128 136
129 - the `d` tag is required, its value MUST be the same as the product `id`. 137 - the `d` tag is required, its value MUST be the same as the product `id`.
@@ -147,23 +155,23 @@ The below json goes in content of [NIP04](https://github.com/nostr-protocol/nips
147 155
148```json 156```json
149{ 157{
150 "id": <String, UUID generated by the customer>, 158 "id": <string, id generated by the customer>,
151 "type": 0, 159 "type": 0,
152 "name": <String (optional), ???>, 160 "name": <string (optional), ???>,
153 "address": <String (optional), for physical goods an address should be provided> 161 "address": <string (optional), for physical goods an address should be provided>
154 "message": "<String (optional), message for merchant>, 162 "message": "<string (optional), message for merchant>,
155 "contact": { 163 "contact": {
156 "nostr": <32-bytes hex of a pubkey>, 164 "nostr": <32-bytes hex of a pubkey>,
157 "phone": <String (optional), if the customer wants to be contacted by phone>, 165 "phone": <string (optional), if the customer wants to be contacted by phone>,
158 "email": <String (optional), if the customer wants to be contacted by email>, 166 "email": <string (optional), if the customer wants to be contacted by email>,
159 }, 167 },
160 "items": [ 168 "items": [
161 { 169 {
162 "product_id": <String, UUID of the product>, 170 "product_id": <string, id of the product>,
163 "quantity": <int, how many products the customer is ordering> 171 "quantity": <int, how many products the customer is ordering>
164 } 172 }
165 ], 173 ],
166 "shipping_id": <String, UUID of the shipping zone> 174 "shipping_id": <string, id of the shipping zone>
167} 175}
168 176
169``` 177```
@@ -186,23 +194,23 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni
186 194
187```json 195```json
188{ 196{
189 "id": <String, UUID of the order>, 197 "id": <string, id of the order>,
190 "type": 1, 198 "type": 1,
191 "message": <String, message to customer, optional>, 199 "message": <string, message to customer, optional>,
192 "payment_options": [ 200 "payment_options": [
193 { 201 {
194 "type": <String, option type>, 202 "type": <string, option type>,
195 "link": <String, url, btc address, ln invoice, etc> 203 "link": <string, url, btc address, ln invoice, etc>
196 }, 204 },
197 { 205 {
198 "type": <String, option type>, 206 "type": <string, option type>,
199 "link": <String, url, btc address, ln invoice, etc> 207 "link": <string, url, btc address, ln invoice, etc>
200 }, 208 },
201 { 209 {
202 "type": <String, option type>, 210 "type": <string, option type>,
203 "link": <String, url, btc address, ln invoice, etc> 211 "link": <string, url, btc address, ln invoice, etc>
204 } 212 }
205 ] 213 ]
206} 214}
207``` 215```
208 216
@@ -214,11 +222,11 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni
214 222
215```json 223```json
216{ 224{
217 "id": <String, UUID of the order>, 225 "id": <string, id of the order>,
218 "type": 2, 226 "type": 2,
219 "message": <String, message to customer>, 227 "message": <string, message to customer>,
220 "paid": <Bool, true/false has received payment>, 228 "paid": <bool: has received payment>,
221 "shipped": <Bool, true/false has been shipped>, 229 "shipped": <bool: has been shipped>,
222} 230}
223``` 231```
224## Customize Marketplace 232## Customize Marketplace
@@ -226,19 +234,20 @@ Create a customized user experience using the `naddr` from [NIP-19](https://gith
226 234
227### Event `30019`: Create or update marketplace UI/UX 235### Event `30019`: Create or update marketplace UI/UX
228 236
229**Event Content**: 237**Event Content**
238
230```json 239```json
231{ 240{
232 "name": <String (optional), market name>, 241 "name": <string (optional), market name>,
233 "about": <String (optional), market description>, 242 "about": <string (optional), market description>,
234 "ui": { 243 "ui": {
235 "picture": <String (optional), market logo image URL>, 244 "picture": <string (optional), market logo image URL>,
236 "banner": <String (optional), market logo banner URL>, 245 "banner": <string (optional), market logo banner URL>,
237 "theme": <String (optional), market theme>, 246 "theme": <string (optional), market theme>,
238 "darkMode": <Bool, true/false> 247 "darkMode": <bool, true/false>
239 }, 248 },
240 "merchants": <[String] (optional), array of pubkeys>, 249 "merchants": [array of pubkeys (optional)],
241 ... 250 ...
242} 251}
243``` 252```
244 253
diff --git a/28.md b/28.md
index 59e9389..2dcf800 100644
--- a/28.md
+++ b/28.md
@@ -27,8 +27,8 @@ In the channel creation `content` field, Client SHOULD include basic channel met
27 27
28```json 28```json
29{ 29{
30 "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\"}", 30 "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\"}",
31 ... 31 ...
32} 32}
33``` 33```
34 34
@@ -37,7 +37,7 @@ In the channel creation `content` field, Client SHOULD include basic channel met
37 37
38Update a channel's public metadata. 38Update a channel's public metadata.
39 39
40Clients and relays SHOULD handle kind 41 events similar to kind 33 replaceable events, where the information is used to update the metadata, without modifying the event id for the channel. Only the most recent kind 41 is needed to be stored. 40Clients and relays SHOULD handle kind 41 events similar to kind 33 replaceable events, where the information is used to update the metadata, without modifying the event id for the channel.Only the most recent kind 41 is needed to be stored.
41 41
42Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey. 42Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey.
43 43
@@ -53,9 +53,9 @@ Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay.
53 53
54```json 54```json
55{ 55{
56 "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", 56 "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}",
57 "tags": [["e", <channel_create_event_id>, <relay-url>]], 57 "tags": [["e", <channel_create_event_id>, <relay-url>]],
58 ... 58 ...
59} 59}
60``` 60```
61 61
@@ -72,9 +72,9 @@ Root message:
72 72
73```json 73```json
74{ 74{
75 "content": <string>, 75 "content": <string>,
76 "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]], 76 "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]],
77 ... 77 ...
78} 78}
79``` 79```
80 80
@@ -82,14 +82,14 @@ Reply to another message:
82 82
83```json 83```json
84{ 84{
85 "content": <string>, 85 "content": <string>,
86 "tags": [ 86 "tags": [
87 ["e", <kind_40_event_id>, <relay-url>, "root"], 87 ["e", <kind_40_event_id>, <relay-url>, "root"],
88 ["e", <kind_42_event_id>, <relay-url>, "reply"], 88 ["e", <kind_42_event_id>, <relay-url>, "reply"],
89 ["p", <pubkey>, <relay-url>], 89 ["p", <pubkey>, <relay-url>],
90 ... 90 ...
91 ], 91 ],
92 ... 92 ...
93} 93}
94``` 94```
95 95
@@ -108,9 +108,9 @@ Clients MAY hide event 42s for other users other than the user who sent the even
108 108
109```json 109```json
110{ 110{
111 "content": "{\"reason\": \"Dick pic\"}", 111 "content": "{\"reason\": \"Dick pic\"}",
112 "tags": [["e", <kind_42_event_id>]], 112 "tags": [["e", <kind_42_event_id>]],
113 ... 113 ...
114} 114}
115``` 115```
116 116
@@ -126,9 +126,9 @@ Clients MAY hide event 42s for users other than the user who sent the event 44.
126 126
127```json 127```json
128{ 128{
129 "content": "{\"reason\": \"Posting dick pics\"}", 129 "content": "{\"reason\": \"Posting dick pics\"}",
130 "tags": [["p", <pubkey>]], 130 "tags": [["p", <pubkey>]],
131 ... 131 ...
132} 132}
133``` 133```
134 134
diff --git a/32.md b/32.md
index dfcb35e..be4e872 100644
--- a/32.md
+++ b/32.md
@@ -64,7 +64,8 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
64 ["l", "permies", "#t"], 64 ["l", "permies", "#t"],
65 ["p", <pubkey1>, <relay_url>], 65 ["p", <pubkey1>, <relay_url>],
66 ["p", <pubkey2>, <relay_url>] 66 ["p", <pubkey2>, <relay_url>]
67 ] 67 ],
68 ...
68} 69}
69``` 70```
70 71
@@ -78,7 +79,8 @@ A report flagging violence toward a human being as defined by ontology.example.c
78 ["l", "VI-hum", "com.example.ontology"], 79 ["l", "VI-hum", "com.example.ontology"],
79 ["p", <pubkey1>, <relay_url>], 80 ["p", <pubkey1>, <relay_url>],
80 ["p", <pubkey2>, <relay_url>] 81 ["p", <pubkey2>, <relay_url>]
81 ] 82 ],
83 ...
82} 84}
83``` 85```
84 86
@@ -92,6 +94,7 @@ A moderation suggestion for a chat event.
92 ["l", "approve", "nip28.moderation"], 94 ["l", "approve", "nip28.moderation"],
93 ["e", <kind40_event_id>, <relay_url>] 95 ["e", <kind40_event_id>, <relay_url>]
94 ], 96 ],
97 ...
95} 98}
96``` 99```
97 100
@@ -105,6 +108,7 @@ Assignment of a license to an event.
105 ["l", "MIT", "license"], 108 ["l", "MIT", "license"],
106 ["e", <event_id>, <relay_url>] 109 ["e", <event_id>, <relay_url>]
107 ], 110 ],
111 ...
108} 112}
109``` 113```
110 114
@@ -119,6 +123,7 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2.
119 ["l", "IT-MI", "ISO-3166-2"] 123 ["l", "IT-MI", "ISO-3166-2"]
120 ], 124 ],
121 "content": "It's beautiful here in Milan!", 125 "content": "It's beautiful here in Milan!",
126 ...
122} 127}
123``` 128```
124 129
diff --git a/36.md b/36.md
index db4c4f2..b10262c 100644
--- a/36.md
+++ b/36.md
@@ -24,18 +24,18 @@ options:
24 24
25```json 25```json
26{ 26{
27 "pubkey": "<pub-key>", 27 "pubkey": "<pub-key>",
28 "created_at": 1000000000, 28 "created_at": 1000000000,
29 "kind": 1, 29 "kind": 1,
30 "tags": [ 30 "tags": [
31 ["t", "hastag"], 31 ["t", "hastag"],
32 ["L", "content-warning"], 32 ["L", "content-warning"],
33 ["l", "reason", "content-warning"], 33 ["l", "reason", "content-warning"],
34 ["L", "social.nos.ontology"], 34 ["L", "social.nos.ontology"],
35 ["l", "NS-nud", "social.nos.ontology"], 35 ["l", "NS-nud", "social.nos.ontology"],
36 ["content-warning", "reason"] /* reason is optional */ 36 ["content-warning", "<optional reason>"]
37 ], 37 ],
38 "content": "sensitive content with #hastag\n", 38 "content": "sensitive content with #hastag\n",
39 "id": "<event-id>" 39 "id": "<event-id>"
40} 40}
41``` 41```
diff --git a/39.md b/39.md
index c9970fa..c819e43 100644
--- a/39.md
+++ b/39.md
@@ -15,15 +15,13 @@ Nostr protocol users may have other online identities such as usernames, profile
15A new optional `i` tag is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md): 15A new optional `i` tag is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md):
16```json 16```json
17{ 17{
18 "id": <id>, 18 "tags": [
19 "pubkey": <pubkey>, 19 ["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
20 ... 20 ["i", "twitter:semisol_public", "1619358434134196225"],
21 "tags": [ 21 ["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"]
22 ["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"], 22 ["i", "telegram:1087295469", "nostrdirectory/770"]
23 ["i", "twitter:semisol_public", "1619358434134196225"], 23 ],
24 ["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"] 24 ...
25 ["i", "telegram:1087295469", "nostrdirectory/770"]
26 ]
27} 25}
28``` 26```
29 27
@@ -31,9 +29,9 @@ An `i` tag will have two parameters, which are defined as the following:
311. `platform:identity`: This is the platform name (for example `github`) and the identity on that platform (for example `semisol`) joined together with `:`. 291. `platform:identity`: This is the platform name (for example `github`) and the identity on that platform (for example `semisol`) joined together with `:`.
322. `proof`: String or object that points to the proof of owning this identity. 302. `proof`: String or object that points to the proof of owning this identity.
33 31
34Clients SHOULD process any `i` tags with more than 2 values for future extensibility. 32Clients SHOULD process any `i` tags with more than 2 values for future extensibility.
35Identity provider names SHOULD only include `a-z`, `0-9` and the characters `._-/` and MUST NOT include `:`. 33Identity provider names SHOULD only include `a-z`, `0-9` and the characters `._-/` and MUST NOT include `:`.
36Identity names SHOULD be normalized if possible by replacing uppercase letters with lowercase letters, and if there are multiple aliases for an entity the primary one should be used. 34Identity names SHOULD be normalized if possible by replacing uppercase letters with lowercase letters, and if there are multiple aliases for an entity the primary one should be used.
37 35
38## Claim types 36## Claim types
39 37
@@ -41,14 +39,14 @@ Identity names SHOULD be normalized if possible by replacing uppercase letters w
41 39
42Identity: A GitHub username. 40Identity: A GitHub username.
43 41
44Proof: A GitHub Gist ID. This Gist should be created by `<identity>` with a single file that has the text `Verifying that I control the following Nostr public key: <npub encoded public key>`. 42Proof: A GitHub Gist ID. This Gist should be created by `<identity>` with a single file that has the text `Verifying that I control the following Nostr public key: <npub encoded public key>`.
45This can be located at `https://gist.github.com/<identity>/<proof>`. 43This can be located at `https://gist.github.com/<identity>/<proof>`.
46 44
47### `twitter` 45### `twitter`
48 46
49Identity: A Twitter username. 47Identity: A Twitter username.
50 48
51Proof: A Tweet ID. The tweet should be posted by `<identity>` and have the text `Verifying my account on nostr My Public Key: "<npub encoded public key>"`. 49Proof: A Tweet ID. The tweet should be posted by `<identity>` and have the text `Verifying my account on nostr My Public Key: "<npub encoded public key>"`.
52This can be located at `https://twitter.com/<identity>/status/<proof>`. 50This can be located at `https://twitter.com/<identity>/status/<proof>`.
53 51
54### `mastodon` 52### `mastodon`
@@ -62,5 +60,5 @@ This can be located at `https://<identity>/<proof>`.
62 60
63Identity: A Telegram user ID. 61Identity: A Telegram user ID.
64 62
65Proof: A string in the format `<ref>/<id>` which points to a message published in the public channel or group with name `<ref>` and message ID `<id>`. This message should be sent by user ID `<identity>` and have the text `Verifying that I control the following Nostr public key: "<npub encoded public key>"`. 63Proof: A string in the format `<ref>/<id>` which points to a message published in the public channel or group with name `<ref>` and message ID `<id>`. This message should be sent by user ID `<identity>` and have the text `Verifying that I control the following Nostr public key: "<npub encoded public key>"`.
66This can be located at `https://t.me/<proof>`. 64This can be located at `https://t.me/<proof>`.
diff --git a/40.md b/40.md
index b8a0336..909747f 100644
--- a/40.md
+++ b/40.md
@@ -2,7 +2,7 @@ NIP-40
2====== 2======
3 3
4Expiration Timestamp 4Expiration Timestamp
5----------------------------------- 5--------------------
6 6
7`draft` `optional` 7`draft` `optional`
8 8
@@ -20,14 +20,14 @@ values:
20 20
21```json 21```json
22{ 22{
23 "pubkey": "<pub-key>", 23 "pubkey": "<pub-key>",
24 "created_at": 1000000000, 24 "created_at": 1000000000,
25 "kind": 1, 25 "kind": 1,
26 "tags": [ 26 "tags": [
27 ["expiration", "1600000000"] 27 ["expiration", "1600000000"]
28 ], 28 ],
29 "content": "This message will expire at the specified timestamp and be deleted by relays.\n", 29 "content": "This message will expire at the specified timestamp and be deleted by relays.\n",
30 "id": "<event-id>" 30 "id": "<event-id>"
31} 31}
32``` 32```
33 33
@@ -43,9 +43,9 @@ Clients SHOULD ignore events that have expired.
43Relay Behavior 43Relay Behavior
44-------------- 44--------------
45 45
46Relays MAY NOT delete expired messages immediately on expiration and MAY persist them indefinitely. 46Relays MAY NOT delete expired messages immediately on expiration and MAY persist them indefinitely.
47Relays SHOULD NOT send expired events to clients, even if they are stored. 47Relays SHOULD NOT send expired events to clients, even if they are stored.
48Relays SHOULD drop any events that are published to them if they are expired. 48Relays SHOULD drop any events that are published to them if they are expired.
49An expiration timestamp does not affect storage of ephemeral events. 49An expiration timestamp does not affect storage of ephemeral events.
50 50
51Suggested Use Cases 51Suggested Use Cases
diff --git a/42.md b/42.md
index 9f0c24d..e380e89 100644
--- a/42.md
+++ b/42.md
@@ -24,13 +24,13 @@ A relay may want to require clients to authenticate to access restricted resourc
24This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want 24This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want
25to authenticate. When sent by relays, the message is of the following form: 25to authenticate. When sent by relays, the message is of the following form:
26 26
27``` 27```json
28["AUTH", <challenge-string>] 28["AUTH", <challenge-string>]
29``` 29```
30 30
31And, when sent by clients, of the following form: 31And, when sent by clients, of the following form:
32 32
33``` 33```json
34["AUTH", <signed-event-json>] 34["AUTH", <signed-event-json>]
35``` 35```
36 36
@@ -41,16 +41,12 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client.
41 41
42```json 42```json
43{ 43{
44 "id": "...",
45 "pubkey": "...",
46 "created_at": 1669695536,
47 "kind": 22242, 44 "kind": 22242,
48 "tags": [ 45 "tags": [
49 ["relay", "wss://relay.example.com/"], 46 ["relay", "wss://relay.example.com/"],
50 ["challenge", "challengestringhere"] 47 ["challenge", "challengestringhere"]
51 ], 48 ],
52 "content": "", 49 ...
53 "sig": "..."
54} 50}
55``` 51```
56 52
@@ -67,13 +63,13 @@ is expected to last for the duration of the WebSocket connection.
67Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For 63Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For
68that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example: 64that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example:
69 65
70``` 66```json
71["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"] 67["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"]
72``` 68```
73 69
74or it can return an `OK` message noting the reason an event was not written using the same prefix: 70or it can return an `OK` message noting the reason an event was not written using the same prefix:
75 71
76``` 72```json
77["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"] 73["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"]
78``` 74```
79 75
diff --git a/45.md b/45.md
index a3abd19..998b952 100644
--- a/45.md
+++ b/45.md
@@ -16,29 +16,36 @@ Some queries a client may want to execute against connected relays are prohibiti
16 16
17This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result. 17This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result.
18 18
19``` 19```json
20["COUNT", <subscription_id>, <filters JSON>...] 20["COUNT", <subscription_id>, <filters JSON>...]
21``` 21```
22 22
23Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements. 23Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
24In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`. 24In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
25 25
26``` 26```json
27["COUNT", <subscription_id>, {"count": <integer>}] 27["COUNT", <subscription_id>, {"count": <integer>}]
28``` 28```
29 29
30Examples: 30## Examples:
31 31
32``` 32### Followers count
33# Followers count 33
34```json
34["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}] 35["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}]
35["COUNT", <subscription_id>, {"count": 238}] 36["COUNT", <subscription_id>, {"count": 238}]
37```
36 38
37# Count posts and reactions 39### Count posts and reactions
40
41```json
38["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] 42["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
39["COUNT", <subscription_id>, {"count": 5}] 43["COUNT", <subscription_id>, {"count": 5}]
44```
40 45
41# Count posts approximately 46### Count posts approximately
47
48```
42["COUNT", <subscription_id>, {"kinds": [1]}] 49["COUNT", <subscription_id>, {"kinds": [1]}]
43["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}] 50["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
44``` 51```
diff --git a/53.md b/53.md
index c4789ea..d3cc0af 100644
--- a/53.md
+++ b/53.md
@@ -6,17 +6,17 @@ Live Activities
6 6
7`draft` `optional` 7`draft` `optional`
8 8
9## Abstract
10
11Service providers want to offer live activities to the Nostr network in such a way that participants can easily logged and queried by clients. This NIP describes a general framework to advertise the involvement of pubkeys in such live activities. 9Service providers want to offer live activities to the Nostr network in such a way that participants can easily logged and queried by clients. This NIP describes a general framework to advertise the involvement of pubkeys in such live activities.
12 10
13# Live Event 11## Concepts
12
13### Live Event
14 14
15A special event with `kind:30311` "Live Event" is defined as a _parameterized replaceable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity. 15A special event with `kind:30311` "Live Event" is defined as a _parameterized replaceable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity.
16 16
17For example: 17For example:
18 18
19```js 19```json
20{ 20{
21 "kind": 30311, 21 "kind": 30311,
22 "tags": [ 22 "tags": [
@@ -38,7 +38,7 @@ For example:
38 ["relays", "wss://one.com", "wss://two.com", ...] 38 ["relays", "wss://one.com", "wss://two.com", ...]
39 ], 39 ],
40 "content": "", 40 "content": "",
41 ...other fields 41 ...
42} 42}
43``` 43```
44 44
@@ -52,7 +52,7 @@ Live Activity management clients are expected to constantly update `kind:30311`
52 52
53The activity MUST be linked to using the [NIP-19](19.md) `naddr` code along with the `a` tag. 53The activity MUST be linked to using the [NIP-19](19.md) `naddr` code along with the `a` tag.
54 54
55## Proof of Agreement to Participate 55### Proof of Agreement to Participate
56 56
57Event owners can add proof as the 5th term in each `p` tag to clarify the participant's agreement in joining the event. The proof is a signed SHA256 of the complete `a` Tag of the event (`kind:pubkey:dTag`) by each `p`'s private key, encoded in hex. 57Event owners can add proof as the 5th term in each `p` tag to clarify the participant's agreement in joining the event. The proof is a signed SHA256 of the complete `a` Tag of the event (`kind:pubkey:dTag`) by each `p`'s private key, encoded in hex.
58 58
@@ -60,30 +60,28 @@ Clients MAY only display participants if the proof is available or MAY display p
60 60
61This feature is important to avoid malicious event owners adding large account holders to the event, without their knowledge, to lure their followers into the malicious owner's trap. 61This feature is important to avoid malicious event owners adding large account holders to the event, without their knowledge, to lure their followers into the malicious owner's trap.
62 62
63# Live Chat Message 63### Live Chat Message
64 64
65Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used. 65Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used.
66 66
67```js 67```json
68{ 68{
69 "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>",
70 "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
71 "created_at": "<Unix timestamp in seconds>",
72 "kind": 1311, 69 "kind": 1311,
73 "tags": [ 70 "tags": [
74 ["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"], 71 ["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"],
75 ], 72 ],
76 "content": "Zaps to live streams is beautiful." 73 "content": "Zaps to live streams is beautiful.",
74 ...
77} 75}
78``` 76```
79 77
80# Use Cases 78## Use Cases
81 79
82Common use cases include meeting rooms/workshops, watch-together activities, or event spaces, such as [live.snort.social](https://live.snort.social) and [nostrnests.com](https://nostrnests.com). 80Common use cases include meeting rooms/workshops, watch-together activities, or event spaces, such as [live.snort.social](https://live.snort.social) and [nostrnests.com](https://nostrnests.com).
83 81
84# Example 82## Example
85 83
86Live Streaming 84### Live Streaming
87 85
88```json 86```json
89{ 87{
@@ -107,7 +105,7 @@ Live Streaming
107} 105}
108``` 106```
109 107
110Live Streaming chat message 108### Live Streaming chat message
111 109
112```json 110```json
113{ 111{
diff --git a/56.md b/56.md
index 0c951b5..a2861e3 100644
--- a/56.md
+++ b/56.md
@@ -1,4 +1,3 @@
1
2NIP-56 1NIP-56
3====== 2======
4 3
diff --git a/72.md b/72.md
index 74c7f08..c0fffff 100644
--- a/72.md
+++ b/72.md
@@ -14,7 +14,6 @@ The goal of this NIP is to create moderator-approved public communities around a
14 14
15```json 15```json
16{ 16{
17 ...
18 "created_at": <Unix timestamp in seconds>, 17 "created_at": <Unix timestamp in seconds>,
19 "kind": 34550, 18 "kind": 34550,
20 "tags": [ 19 "tags": [
@@ -34,7 +33,8 @@ The goal of this NIP is to create moderator-approved public communities around a
34 ["relay", "<relay where to send and receive requests>", "requests"], 33 ["relay", "<relay where to send and receive requests>", "requests"],
35 ["relay", "<relay where to send and receive approvals>", "approvals"], 34 ["relay", "<relay where to send and receive approvals>", "approvals"],
36 ["relay", "<relay where to post requests to and fetch approvals from>"] 35 ["relay", "<relay where to post requests to and fetch approvals from>"]
37 ] 36 ],
37 ...
38} 38}
39``` 39```
40 40
@@ -44,12 +44,12 @@ Any Nostr event can be submitted to a community by anyone for approval. Clients
44 44
45```json 45```json
46{ 46{
47 ...
48 "kind": 1, 47 "kind": 1,
49 "tags": [ 48 "tags": [
50 ["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"], 49 ["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
51 ], 50 ],
52 "content": "hello world" 51 "content": "hello world",
52 ...
53} 53}
54``` 54```
55 55
@@ -61,7 +61,6 @@ The post-approval event MUST include `a` tags of the communities the moderator i
61 61
62```json 62```json
63{ 63{
64 ...
65 "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", 64 "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
66 "kind": 4550, 65 "kind": 4550,
67 "tags": [ 66 "tags": [
@@ -70,7 +69,8 @@ The post-approval event MUST include `a` tags of the communities the moderator i
70 ["p", "<port-author-pubkey>", "<optional-relay-url>"], 69 ["p", "<port-author-pubkey>", "<optional-relay-url>"],
71 ["k", "<post-request-kind>"] 70 ["k", "<post-request-kind>"]
72 ], 71 ],
73 "content": "<the full approved event, JSON-encoded>" 72 "content": "<the full approved event, JSON-encoded>",
73 ...
74} 74}
75``` 75```
76 76
@@ -86,7 +86,7 @@ Community clients SHOULD display posts that have been approved by at least 1 mod
86 86
87The following filter displays the approved posts. 87The following filter displays the approved posts.
88 88
89```js 89```json
90[ 90[
91 "REQ", 91 "REQ",
92 "_", 92 "_",
diff --git a/75.md b/75.md
index 3a89f90..f3cf5d0 100644
--- a/75.md
+++ b/75.md
@@ -1,6 +1,8 @@
1# NIP-75 1NIP-75
2======
2 3
3## Zap Goals 4Zap Goals
5---------
4 6
5`draft` `optional` 7`draft` `optional`
6 8
@@ -27,7 +29,7 @@ Example event:
27 ["amount", "210000"], 29 ["amount", "210000"],
28 ], 30 ],
29 "content": "Nostrasia travel expenses", 31 "content": "Nostrasia travel expenses",
30 ...other fields 32 ...
31``` 33```
32 34
33The following tags are OPTIONAL. 35The following tags are OPTIONAL.
@@ -43,7 +45,8 @@ The following tags are OPTIONAL.
43 ["closed_at", "<unix timestamp in seconds>"], 45 ["closed_at", "<unix timestamp in seconds>"],
44 ], 46 ],
45 "content": "Nostrasia travel expenses", 47 "content": "Nostrasia travel expenses",
46 ...other fields 48 ...
49}
47``` 50```
48 51
49The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event. 52The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event.
@@ -54,12 +57,14 @@ Parameterized replaceable events can link to a goal by using a `goal` tag specif
54 57
55```json 58```json
56{ 59{
57 "kind": 3XXXX, 60 ...
61 "kind": 3xxxx,
58 "tags": [ 62 "tags": [
59 ... 63 ...
60 ["goal", "<event id>", "<Relay URL (optional)>"], 64 ["goal", "<event id>", "<Relay URL (optional)>"],
61 ], 65 ],
62 ...other fields 66 ...
67}
63``` 68```
64 69
65## Client behavior 70## Client behavior
diff --git a/84.md b/84.md
index 303cd93..d5f54d4 100644
--- a/84.md
+++ b/84.md
@@ -27,9 +27,14 @@ useful when highlighting non-nostr content for which the client might be able to
27last value of the tag. 27last value of the tag.
28 28
29```json 29```json
30[ "p", "<pubkey-hex>", "<relay-url>", "author" ], 30{
31[ "p", "<pubkey-hex>", "<relay-url>", "author" ], 31 "tags": [
32[ "p", "<pubkey-hex>", "<relay-url>", "editor" ], 32 ["p", "<pubkey-hex>", "<relay-url>", "author"],
33 ["p", "<pubkey-hex>", "<relay-url>", "author"],
34 ["p", "<pubkey-hex>", "<relay-url>", "editor"]
35 ],
36 ...
37}
33``` 38```
34 39
35### Context 40### Context
diff --git a/89.md b/89.md
index 73cb7bd..be3d075 100644
--- a/89.md
+++ b/89.md
@@ -9,10 +9,12 @@ Recommended Application Handlers
9This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds. 9This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds.
10 10
11## Rationale 11## Rationale
12
12Nostr's discoverability and transparent event interaction is one of its most interesting/novel mechanics. 13Nostr's discoverability and transparent event interaction is one of its most interesting/novel mechanics.
13This NIP provides a simple way for clients to discover applications that handle events of a specific kind to ensure smooth cross-client and cross-kind interactions. 14This NIP provides a simple way for clients to discover applications that handle events of a specific kind to ensure smooth cross-client and cross-kind interactions.
14 15
15### Parties involved 16### Parties involved
17
16There are three actors to this workflow: 18There are three actors to this workflow:
17 19
18* application that handles a specific event kind (note that an application doesn't necessarily need to be a distinct entity and it could just be the same pubkey as user A) 20* application that handles a specific event kind (note that an application doesn't necessarily need to be a distinct entity and it could just be the same pubkey as user A)
@@ -22,18 +24,18 @@ There are three actors to this workflow:
22* user B, who seeks a recommendation for an app that handles a specific event kind 24* user B, who seeks a recommendation for an app that handles a specific event kind
23 * Queries for `kind:31989` and, based on results, queries for `kind:31990` 25 * Queries for `kind:31989` and, based on results, queries for `kind:31990`
24 26
25# Events 27## Events
26 28
27## Recommendation event 29### Recommendation event
28```json 30```json
29{ 31{
30 "kind": 31989, 32 "kind": 31989,
31 "pubkey": <recommender-user-pubkey>, 33 "pubkey": <recommender-user-pubkey>,
32 "tags": [ 34 "tags": [
33 [ "d", <supported-event-kind> ], 35 ["d", <supported-event-kind>],
34 [ "a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios" ], 36 ["a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios"],
35 [ "a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web" ] 37 ["a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web"]
36 ] 38 ]
37} 39}
38``` 40```
39 41
@@ -47,34 +49,32 @@ The third value of the tag SHOULD be the platform where this recommendation migh
47## Handler information 49## Handler information
48```json 50```json
49{ 51{
50 "kind": 31990, 52 "kind": 31990,
51 "pubkey": <pubkey>, 53 "pubkey": "<application-pubkey>",
52 "content": "<optional-kind:0-style-metadata>", 54 "content": "<optional-kind:0-style-metadata>",
53 "tags": [ 55 "tags": [
54 [ "d", <random-id> ], 56 ["d", <random-id>],
55 [ "k", <supported-event-kind> ], 57 ["k", <supported-event-kind>],
56 [ "web", "https://..../a/<bech32>", "nevent" ], 58 ["web", "https://..../a/<bech32>", "nevent"],
57 [ "web", "https://..../p/<bech32>", "nprofile" ], 59 ["web", "https://..../p/<bech32>", "nprofile"],
58 [ "web", "https://..../e/<bech32>" ], 60 ["web", "https://..../e/<bech32>"],
59 [ "ios", ".../<bech32>" ] 61 ["ios", ".../<bech32>"]
60 ] 62 ]
61} 63}
62``` 64```
63 65
64* `content` is an optional `metadata`-like stringified JSON object, as described in NIP-01. This content is useful when the pubkey creating the `kind:31990` is not an application. If `content` is empty, the `kind:0` of the pubkey should be used to display application information (e.g. name, picture, web, LUD16, etc.) 66* `content` is an optional `metadata`-like stringified JSON object, as described in NIP-01. This content is useful when the pubkey creating the `kind:31990` is not an application. If `content` is empty, the `kind:0` of the pubkey should be used to display application information (e.g. name, picture, web, LUD16, etc.)
65
66* `k` tags' value is the event kind that is supported by this `kind:31990`. 67* `k` tags' value is the event kind that is supported by this `kind:31990`.
67Using a `k` tag(s) (instead of having the kind onf the NIP-33 `d` tag) provides: 68Using a `k` tag(s) (instead of having the kind onf the NIP-33 `d` tag) provides:
68 * Multiple `k` tags can exist in the same event if the application supports more than one event kind and their handler URLs are the same. 69 * Multiple `k` tags can exist in the same event if the application supports more than one event kind and their handler URLs are the same.
69 * The same pubkey can have multiple events with different apps that handle the same event kind. 70 * The same pubkey can have multiple events with different apps that handle the same event kind.
70
71* `bech32` in a URL MUST be replaced by clients with the NIP-19-encoded entity that should be loaded by the application. 71* `bech32` in a URL MUST be replaced by clients with the NIP-19-encoded entity that should be loaded by the application.
72 72
73Multiple tags might be registered by the app, following NIP-19 nomenclature as the second value of the array. 73Multiple tags might be registered by the app, following NIP-19 nomenclature as the second value of the array.
74 74
75A tag without a second value in the array SHOULD be considered a generic handler for any NIP-19 entity that is not handled by a different tag. 75A tag without a second value in the array SHOULD be considered a generic handler for any NIP-19 entity that is not handled by a different tag.
76 76
77# Client tag 77## Client tag
78When publishing events, clients MAY include a `client` tag in the same format as the recommendation event's `a` tags. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag. 78When publishing events, clients MAY include a `client` tag in the same format as the recommendation event's `a` tags. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag.
79 79
80```json 80```json
@@ -87,43 +87,45 @@ When publishing events, clients MAY include a `client` tag in the same format as
87} 87}
88``` 88```
89 89
90# User flow 90## User flow
91A user A who uses a non-`kind:1`-centric nostr app could choose to announce/recommend a certain kind-handler application. 91A user A who uses a non-`kind:1`-centric nostr app could choose to announce/recommend a certain kind-handler application.
92 92
93When user B sees an unknown event kind, e.g. in a social-media centric nostr client, the client would allow user B to interact with the unknown-kind event (e.g. tapping on it). 93When user B sees an unknown event kind, e.g. in a social-media centric nostr client, the client would allow user B to interact with the unknown-kind event (e.g. tapping on it).
94 94
95The client MIGHT query for the user's and the user's follows handler. 95The client MIGHT query for the user's and the user's follows handler.
96 96
97# Example 97## Example
98 98
99## User A recommends a `kind:31337`-handler 99### User A recommends a `kind:31337`-handler
100User A might be a user of Zapstr, a `kind:31337`-centric client (tracks). Using Zapstr, user A publishes an event recommending Zapstr as a `kind:31337`-handler. 100User A might be a user of Zapstr, a `kind:31337`-centric client (tracks). Using Zapstr, user A publishes an event recommending Zapstr as a `kind:31337`-handler.
101 101
102```json 102```json
103{ 103{
104 "kind": 31989, 104 "kind": 31989,
105 "tags": [ 105 "tags": [
106 [ "d", "31337" ], 106 ["d", "31337"],
107 [ "a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web" ] 107 ["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web"]
108 ] 108 ],
109 ...
109} 110}
110``` 111```
111 112
112## User B interacts with a `kind:31337`-handler 113### User B interacts with a `kind:31337`-handler
113User B might see in their timeline an event referring to a `kind:31337` event 114User B might see in their timeline an event referring to a `kind:31337` event (e.g. a `kind:1` tagging a `kind:31337`).
114(e.g. a `kind:1` tagging a `kind:31337`).
115 115
116User B's client, not knowing how to handle a `kind:31337` might display the event 116User B's client, not knowing how to handle a `kind:31337` might display the event using its `alt` tag (as described in NIP-31). When the user clicks on the event, the application queries for a handler for this `kind`:
117using its `alt` tag (as described in NIP-31). When the user clicks on the event,
118the application queries for a handler for this `kind`:
119 117
120`["REQ", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']` 118```json
119["REQ", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']
120```
121 121
122User B, who follows User A, sees that `kind:31989` event and fetches the `a`-tagged event for the app and handler information. 122User B, who follows User A, sees that `kind:31989` event and fetches the `a`-tagged event for the app and handler information.
123 123
124User B's client sees the application's `kind:31990` which includes the information to redirect the user to the relevant URL with the desired entity replaced in the URL. 124User B's client sees the application's `kind:31990` which includes the information to redirect the user to the relevant URL with the desired entity replaced in the URL.
125 125
126## Alternative query bypassing `kind:31989` 126### Alternative query bypassing `kind:31989`
127Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms to avoid directing users to malicious handlers. 127Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms or querying high-quality restricted relays to avoid directing users to malicious handlers.
128 128
129`["REQ", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']` 129```json
130["REQ", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']
131```
diff --git a/90.md b/90.md
index c498cdd..6017c98 100644
--- a/90.md
+++ b/90.md
@@ -13,11 +13,11 @@ Money in, data out.
13## Kinds 13## Kinds
14This NIP reserves the range `5000-7000` for data vending machine use. 14This NIP reserves the range `5000-7000` for data vending machine use.
15 15
16| Kind | Description | 16| Kind | Description |
17| ---- | ----------- | 17| ---- | ----------- |
18| 5000-5999 | Job request kinds | 18| 5000-5999 | Job request kinds |
19| 6000-6999 | Job result | 19| 6000-6999 | Job result |
20| 7000 | Job feedback | 20| 7000 | Job feedback |
21 21
22Job results always use a kind number that is `1000` higher than the job request kind. (e.g. request: `kind:5001` gets a result: `kind:6001`). 22Job results always use a kind number that is `1000` higher than the job request kind. (e.g. request: `kind:5001` gets a result: `kind:6001`).
23 23
@@ -67,34 +67,34 @@ All tags are optional.
67* `relays`: List of relays where Service Providers SHOULD publish responses to 67* `relays`: List of relays where Service Providers SHOULD publish responses to
68* `p`: Service Providers the customer is interested in. Other SPs MIGHT still choose to process the job 68* `p`: Service Providers the customer is interested in. Other SPs MIGHT still choose to process the job
69 69
70## Encrypted Params 70## Encrypted Params
71 71
72If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. Add a tag `encrypted` as tags. Encryption for private tags will use [NIP-04 - Encrypted Direct Message encryption](https://github.com/nostr-protocol/nips/blob/master/04.md), using the user's private and service provider's public key for the shared secret 72If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. Add a tag `encrypted` as tags. Encryption for private tags will use [NIP-04 - Encrypted Direct Message encryption](https://github.com/nostr-protocol/nips/blob/master/04.md), using the user's private and service provider's public key for the shared secret
73 73
74```json 74```json
75[ 75[
76 [ "i", "what is the capital of France? ", "text" ], 76 ["i", "what is the capital of France? ", "text"],
77 [ "param", "model", "LLaMA-2" ], 77 ["param", "model", "LLaMA-2"],
78 [ "param", "max_tokens", "512" ], 78 ["param", "max_tokens", "512"],
79 [ "param", "temperature", "0.5" ], 79 ["param", "temperature", "0.5"],
80 [ "param", "top-k", "50" ], 80 ["param", "top-k", "50"],
81 [ "param", "top-p", "0.7" ], 81 ["param", "top-p", "0.7"],
82 [ "param", "frequency_penalty", "1" ] 82 ["param", "frequency_penalty", "1"]
83
84] 83]
85 84
86``` 85```
87 86
88This param data will be encrypted and added to the `content` field and `p` tag should be present 87This param data will be encrypted and added to the `content` field and `p` tag should be present
89
90```
91"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
92 "tags": [
93 ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
94 ["encrypted"]
95 ]
96
97 88
89```json
90{
91 "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
92 "tags": [
93 ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
94 ["encrypted"]
95 ],
96 ...
97}
98``` 98```
99 99
100 100
@@ -104,16 +104,17 @@ Service providers publish job results, providing the output of the job result. T
104 104
105```json 105```json
106{ 106{
107 "pubkey": "<service-provider pubkey>", 107 "pubkey": "<service-provider pubkey>",
108 "content": "<payload>", 108 "content": "<payload>",
109 "kind": 6xxx, 109 "kind": 6xxx,
110 "tags": [ 110 "tags": [
111 [ "request", "<job-request>" ], 111 ["request", "<job-request>"],
112 [ "e", "<job-request-id>", "<relay-hint>" ], 112 ["e", "<job-request-id>", "<relay-hint>"],
113 [ "i", "<input-data>" ], 113 ["i", "<input-data>"],
114 [ "p", "<customer's-pubkey>" ], 114 ["p", "<customer's-pubkey>"],
115 [ "amount", "requested-payment-amount", "<optional-bolt11>" ] 115 ["amount", "requested-payment-amount", "<optional-bolt11>"]
116 ] 116 ],
117 ...
117} 118}
118``` 119```
119 120
@@ -123,38 +124,40 @@ Service providers publish job results, providing the output of the job result. T
123 124
124## Encrypted Output 125## Encrypted Output
125 126
126If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text. 127If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text.
127Add a tag encrypted to mark the output content as `encrypted` 128Add a tag encrypted to mark the output content as `encrypted`
129
128```json 130```json
129{ 131{
130 "pubkey": "<service-provider pubkey>", 132 "pubkey": "<service-provider pubkey>",
131 "content": "<encrypted payload>", 133 "content": "<encrypted payload>",
132 "kind": 6xxx, 134 "kind": 6xxx,
133 "tags": [ 135 "tags": [
134 [ "request", "<job-request>" ], 136 ["request", "<job-request>"],
135 [ "e", "<job-request-id>", "<relay-hint>" ], 137 ["e", "<job-request-id>", "<relay-hint>"],
136 [ "p", "<customer's-pubkey>" ], 138 ["p", "<customer's-pubkey>"],
137 [ "amount", "requested-payment-amount", "<optional-bolt11>" ], 139 ["amount", "requested-payment-amount", "<optional-bolt11>"],
138 ["encrypted"] 140 ["encrypted"]
139 141 ],
140 ] 142 ...
141} 143}
142``` 144```
143
144 145
145## Job feedback 146## Job feedback
147
146Service providers can give feedback about a job back to the customer. 148Service providers can give feedback about a job back to the customer.
147 149
148```json 150```json
149{ 151{
150 "kind": 7000, 152 "kind": 7000,
151 "content": "<empty-or-payload>", 153 "content": "<empty-or-payload>",
152 "tags": [ 154 "tags": [
153 [ "status", "<status>", "<extra-info>" ], 155 ["status", "<status>", "<extra-info>"],
154 [ "amount", "requested-payment-amount", "<bolt11>" ], 156 ["amount", "requested-payment-amount", "<bolt11>"],
155 [ "e", "<job-request-id>", "<relay-hint>" ], 157 ["e", "<job-request-id>", "<relay-hint>"],
156 [ "p", "<customer's-pubkey>" ], 158 ["p", "<customer's-pubkey>"],
157 ] 159 ],
160 ...
158} 161}
159``` 162```
160 163
@@ -166,18 +169,19 @@ Service providers can give feedback about a job back to the customer.
166 169
167### Job feedback status 170### Job feedback status
168 171
169| status | description | 172| status | description |
170|--------|-------------| 173| -------- | ------------- |
171| `payment-required` | Service Provider requires payment before continuing. | 174| `payment-required` | Service Provider requires payment before continuing. |
172| `processing` | Service Provider is processing the job. | 175| `processing` | Service Provider is processing the job. |
173| `error` | Service Provider was unable to process the job. | 176| `error` | Service Provider was unable to process the job. |
174| `success` | Service Provider successfully processed the job. | 177| `success` | Service Provider successfully processed the job. |
175| `partial` | Service Provider partially processed the job. The `.content` might include a sample of the partial results. | 178| `partial` | Service Provider partially processed the job. The `.content` might include a sample of the partial results. |
176 179
177Any job feedback event MIGHT include results in the `.content` field, as described in the [Job Result](#job-result) section. This is useful for service providers to provide a sample of the results that have been processed so far. 180Any job feedback event MIGHT include results in the `.content` field, as described in the [Job Result](#job-result) section. This is useful for service providers to provide a sample of the results that have been processed so far.
178 181
179 182
180# Protocol Flow 183# Protocol Flow
184
181* Customer publishes a job request (e.g. `kind:5000` speech-to-text). 185* Customer publishes a job request (e.g. `kind:5000` speech-to-text).
182* Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.). 186* Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.).
183* Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event. 187* Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event.
@@ -207,18 +211,19 @@ This gives a higher level of flexibility to service providers (which sophisticat
207# Appendix 2: Service provider discoverability 211# Appendix 2: Service provider discoverability
208Service Providers MAY use NIP-89 announcements to advertise their support for job kinds: 212Service Providers MAY use NIP-89 announcements to advertise their support for job kinds:
209 213
210```json 214```js
211{ 215{
212 "kind": 31990, 216 "kind": 31990,
213 "pubkey": "<pubkey>", 217 "pubkey": "<pubkey>",
214 "content": "{ 218 "content": "{
215 \"name\": \"Translating DVM\", 219 \"name\": \"Translating DVM\",
216 \"about\": \"I'm a DVM specialized in translating Bitcoin content.\" 220 \"about\": \"I'm a DVM specialized in translating Bitcoin content.\"
217 }", 221 }",
218 "tags": [ 222 "tags": [
219 [ "k", "5005" ], // e.g. translation 223 ["k", "5005"], // e.g. translation
220 [ "t", "bitcoin" ] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains" 224 ["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains"
221 ] 225 ],
226 ...
222} 227}
223``` 228```
224 229
diff --git a/94.md b/94.md
index 0b76c25..95b6a3b 100644
--- a/94.md
+++ b/94.md
@@ -28,9 +28,6 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
28 28
29```json 29```json
30{ 30{
31 "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>,
32 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
33 "created_at": <unix timestamp in seconds>,
34 "kind": 1063, 31 "kind": 1063,
35 "tags": [ 32 "tags": [
36 ["url",<string with URI of file>], 33 ["url",<string with URI of file>],
@@ -47,8 +44,8 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
47 ["summary", <excerpt>], 44 ["summary", <excerpt>],
48 ["alt", <description>] 45 ["alt", <description>]
49 ], 46 ],
50 "content": <caption>, 47 "content": "<caption>",
51 "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> 48 ...
52} 49}
53``` 50```
54 51
diff --git a/98.md b/98.md
index e04c7fc..ca52304 100644
--- a/98.md
+++ b/98.md
@@ -2,7 +2,7 @@ NIP-98
2====== 2======
3 3
4HTTP Auth 4HTTP Auth
5------------------------- 5---------
6 6
7`draft` `optional` 7`draft` `optional`
8 8
@@ -24,22 +24,16 @@ The following tags MUST be included.
24Example event: 24Example event:
25```json 25```json
26{ 26{
27 "id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578734", 27 "id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578734",
28 "pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed", 28 "pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed",
29 "content": "", 29 "content": "",
30 "kind": 27235, 30 "kind": 27235,
31 "created_at": 1682327852, 31 "created_at": 1682327852,
32 "tags": [ 32 "tags": [
33 [ 33 ["u", "https://api.snort.social/api/v1/n5sp/list"],
34 "u", 34 ["method", "GET"]
35 "https://api.snort.social/api/v1/n5sp/list" 35 ],
36 ], 36 "sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184"
37 [
38 "method",
39 "GET"
40 ]
41 ],
42 "sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184"
43} 37}
44``` 38```
45 39
diff --git a/99.md b/99.md
index 9e8f1da..e65920c 100644
--- a/99.md
+++ b/99.md
@@ -1,6 +1,8 @@
1# NIP-99 1NIP-99
2======
2 3
3## Classified Listings 4Classified Listings
5-------------------
4 6
5`draft` `optional` 7`draft` `optional`
6 8