upleb.uk

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

summaryrefslogtreecommitdiff
path: root/89.md
diff options
context:
space:
mode:
authorhodlbod <jstaab@protonmail.com>2024-09-03 13:56:56 -0700
committerGitHub <noreply@github.com>2024-09-03 13:56:56 -0700
commitc02b161d9ed8f2edb7633b467ad2dd25252ed55c (patch)
tree0a9198bac9d1976cf0744c30516400ee5cff26aa /89.md
parent378dfaa5dbf44bd1f17fd70f8727b636b7c99239 (diff)
parentc8dc1eadffe0ff894ec39e291c5b28bb18e6db9e (diff)
Merge pull request #1477 from kehiy/jsonc
format(all): JSON formatting
Diffstat (limited to '89.md')
-rw-r--r--89.md22
1 files changed, 12 insertions, 10 deletions
diff --git a/89.md b/89.md
index 54aa30b..24aa3c5 100644
--- a/89.md
+++ b/89.md
@@ -27,7 +27,7 @@ There are three actors to this workflow:
27## Events 27## Events
28 28
29### Recommendation event 29### Recommendation event
30```json 30```jsonc
31{ 31{
32 "kind": 31989, 32 "kind": 31989,
33 "pubkey": <recommender-user-pubkey>, 33 "pubkey": <recommender-user-pubkey>,
@@ -35,7 +35,8 @@ There are three actors to this workflow:
35 ["d", <supported-event-kind>], 35 ["d", <supported-event-kind>],
36 ["a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios"], 36 ["a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios"],
37 ["a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web"] 37 ["a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web"]
38 ] 38 ],
39 // other fields...
39} 40}
40``` 41```
41 42
@@ -47,7 +48,7 @@ The second value of the tag SHOULD be a relay hint.
47The third value of the tag SHOULD be the platform where this recommendation might apply. 48The third value of the tag SHOULD be the platform where this recommendation might apply.
48 49
49## Handler information 50## Handler information
50```json 51```jsonc
51{ 52{
52 "kind": 31990, 53 "kind": 31990,
53 "pubkey": "<application-pubkey>", 54 "pubkey": "<application-pubkey>",
@@ -59,7 +60,8 @@ The third value of the tag SHOULD be the platform where this recommendation migh
59 ["web", "https://..../p/<bech32>", "nprofile"], 60 ["web", "https://..../p/<bech32>", "nprofile"],
60 ["web", "https://..../e/<bech32>"], 61 ["web", "https://..../e/<bech32>"],
61 ["ios", ".../<bech32>"] 62 ["ios", ".../<bech32>"]
62 ] 63 ],
64 // other fields...
63} 65}
64``` 66```
65 67
@@ -77,13 +79,13 @@ A tag without a second value in the array SHOULD be considered a generic handler
77# Client tag 79# Client tag
78When publishing events, clients MAY include a `client` tag. Identifying the client that published the note. This tag is a tuple of `name`, `address` identifying a handler event and, a relay `hint` for finding the handler event. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag. 80When publishing events, clients MAY include a `client` tag. Identifying the client that published the note. This tag is a tuple of `name`, `address` identifying a handler event and, a relay `hint` for finding the handler event. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag.
79 81
80```json 82```jsonc
81{ 83{
82 "kind": 1, 84 "kind": 1,
83 "tags": [ 85 "tags": [
84 ["client", "My Client", "31990:app1-pubkey:<d-identifier>", "wss://relay1"] 86 ["client", "My Client", "31990:app1-pubkey:<d-identifier>", "wss://relay1"]
85 ] 87 ]
86 ... 88 // other fields...
87} 89}
88``` 90```
89 91
@@ -99,14 +101,14 @@ The client MIGHT query for the user's and the user's follows handler.
99### User A recommends a `kind:31337`-handler 101### 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. 102User 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 103
102```json 104```jsonc
103{ 105{
104 "kind": 31989, 106 "kind": 31989,
105 "tags": [ 107 "tags": [
106 ["d", "31337"], 108 ["d", "31337"],
107 ["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web"] 109 ["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web"]
108 ], 110 ],
109 ... 111 // other fields...
110} 112}
111``` 113```
112 114
@@ -115,7 +117,7 @@ User B might see in their timeline an event referring to a `kind:31337` event (e
115 117
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`: 118User 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`:
117 119
118```json 120```
119["REQ", <id>, { "kinds": [31989], "#d": ["31337"], "authors": [<user>, <users-contact-list>] }] 121["REQ", <id>, { "kinds": [31989], "#d": ["31337"], "authors": [<user>, <users-contact-list>] }]
120``` 122```
121 123
@@ -126,6 +128,6 @@ User B's client sees the application's `kind:31990` which includes the informati
126### Alternative query bypassing `kind:31989` 128### 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 or querying high-quality restricted relays to avoid directing users to malicious handlers. 129Alternatively, 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 130
129```json 131```
130["REQ", <id>, { "kinds": [31990], "#k": [<desired-event-kind>], "authors": [...] }] 132["REQ", <id>, { "kinds": [31990], "#k": [<desired-event-kind>], "authors": [...] }]
131``` 133```