diff options
| author | kehiy <kehiiiiya@gmail.com> | 2024-09-03 20:41:31 +0330 |
|---|---|---|
| committer | kehiy <kehiiiiya@gmail.com> | 2024-09-03 20:41:31 +0330 |
| commit | e6552476aa2e5ca7256be572a9aa226ec8a022ee (patch) | |
| tree | 46f14902bd2bfb85e5f3369ece456c46b697b1a2 /89.md | |
| parent | b4a2561df7325b8624bc5ffad154ec946ade2f1e (diff) | |
format(all): json formatting
Diffstat (limited to '89.md')
| -rw-r--r-- | 89.md | 22 |
1 files changed, 12 insertions, 10 deletions
| @@ -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. | |||
| 47 | The third value of the tag SHOULD be the platform where this recommendation might apply. | 48 | The 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 |
| 78 | When 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. | 80 | When 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 |
| 100 | User 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. | 102 | User 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 | ||
| 116 | User 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`: | 118 | User 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` |
| 127 | Alternatively, 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. | 129 | Alternatively, 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 | ``` |