upleb.uk

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

summaryrefslogtreecommitdiff
path: root/29.md
diff options
context:
space:
mode:
authorpablof7z <pfer@me.com>2024-09-28 17:39:41 -0500
committerpablof7z <pfer@me.com>2024-09-28 17:39:41 -0500
commitfcc32565795f3f60151cde030700159502186d71 (patch)
tree2f400600397443e6b5896c24872da1f81b9b4321 /29.md
parent9f9ab83ee9809251d0466f22c188a0f13abd585a (diff)
parenta736e629be5c4c9125d98bdb4965851d8110c483 (diff)
Merge branch 'master' into cashu-wallet
Diffstat (limited to '29.md')
-rw-r--r--29.md44
1 files changed, 30 insertions, 14 deletions
diff --git a/29.md b/29.md
index 74dfd66..6232f8b 100644
--- a/29.md
+++ b/29.md
@@ -16,7 +16,7 @@ Normally a group will originally belong to one specific relay, but the community
16 16
17## Relay-generated events 17## Relay-generated events
18 18
19Relays are supposed to generate the events that describe group metadata and group admins. These are parameterized replaceable events signed by the relay keypair directly, with the group _id_ as the `d` tag. 19Relays are supposed to generate the events that describe group metadata and group admins. These are _addressable_ events signed by the relay keypair directly, with the group _id_ as the `d` tag.
20 20
21## Group identifier 21## Group identifier
22 22
@@ -42,14 +42,14 @@ Relays should prevent late publication (messages published now with a timestamp
42 42
43This is the basic unit of a "microblog" root text note sent to a group. 43This is the basic unit of a "microblog" root text note sent to a group.
44 44
45```js 45```jsonc
46 "kind": 11, 46 "kind": 11,
47 "content": "hello my friends lovers of pizza", 47 "content": "hello my friends lovers of pizza",
48 "tags": [ 48 "tags": [
49 ["h", "<group-id>"], 49 ["h", "<group-id>"],
50 ["previous", "<event-id-first-chars>", "<event-id-first-chars>", ...] 50 ["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
51 ] 51 ]
52 ... 52 // other fields...
53``` 53```
54 54
55- *threaded text reply* (`kind:12`) 55- *threaded text reply* (`kind:12`)
@@ -63,14 +63,14 @@ This is the basic unit of a "microblog" reply note sent to a group. It's the sam
63 63
64This is the basic unit of a _chat message_ sent to a group. 64This is the basic unit of a _chat message_ sent to a group.
65 65
66```js 66```jsonc
67 "kind": 9, 67 "kind": 9,
68 "content": "hello my friends lovers of pizza", 68 "content": "hello my friends lovers of pizza",
69 "tags": [ 69 "tags": [
70 ["h", "<group-id>"], 70 ["h", "<group-id>"],
71 ["previous", "<event-id-first-chars>", "<event-id-first-chars>", ...] 71 ["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
72 ] 72 ]
73 ... 73 // other fields...
74``` 74```
75 75
76- *chat message threaded reply* (`kind:10`) 76- *chat message threaded reply* (`kind:10`)
@@ -83,7 +83,7 @@ Similar to `kind:12`, this is the basic unit of a chat message sent to a group.
83 83
84Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them. 84Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them.
85 85
86```js 86```json
87{ 87{
88 "kind": 9021, 88 "kind": 9021,
89 "content": "optional reason", 89 "content": "optional reason",
@@ -93,17 +93,31 @@ Any user can send one of these events to the relay in order to be automatically
93} 93}
94``` 94```
95 95
96- *leave request* (`kind:9022`)
97
98Any user can send one of these events to the relay in order to be automatically removed from the group. The relay will automatically issue a `kind:9001` in response removing this user.
99
100```json
101{
102 "kind": 9022,
103 "content": "optional reason",
104 "tags": [
105 ["h", "<group-id>"]
106 ]
107}
108```
109
96- *moderation events* (`kinds:9000-9020`) (optional) 110- *moderation events* (`kinds:9000-9020`) (optional)
97 111
98Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log. 112Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log.
99 113
100```js 114```json
101{ 115{
102 "kind": 90xx, 116 "kind": 90xx,
103 "content": "optional reason", 117 "content": "optional reason",
104 "tags": [ 118 "tags": [
105 ["h", "<group-id>"], 119 ["h", "<group-id>"],
106 ["previous", ...] 120 ["previous", /*...*/]
107 ] 121 ]
108} 122}
109``` 123```
@@ -120,6 +134,7 @@ Each moderation action uses a different kind and requires different arguments, w
120| 9005 | `delete-event` | `e` (id hex) | 134| 9005 | `delete-event` | `e` (id hex) |
121| 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` | 135| 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` |
122| 9007 | `create-group` | | 136| 9007 | `create-group` | |
137| 9008 | `delete-group` | |
123 138
124- *group metadata* (`kind:39000`) (optional) 139- *group metadata* (`kind:39000`) (optional)
125 140
@@ -127,7 +142,7 @@ This event defines the metadata for the group -- basically how clients should di
127 142
128If the group is forked and hosted in multiple relays, there will be multiple versions of this event in each different relay and so on. 143If the group is forked and hosted in multiple relays, there will be multiple versions of this event in each different relay and so on.
129 144
130```js 145```jsonc
131{ 146{
132 "kind": 39000, 147 "kind": 39000,
133 "content": "", 148 "content": "",
@@ -139,7 +154,7 @@ If the group is forked and hosted in multiple relays, there will be multiple ver
139 ["public"], // or ["private"] 154 ["public"], // or ["private"]
140 ["open"] // or ["closed"] 155 ["open"] // or ["closed"]
141 ] 156 ]
142 ... 157 // other fields...
143} 158}
144``` 159```
145 160
@@ -160,8 +175,9 @@ The list of capabilities, as defined by this NIP, for now, is the following:
160- `add-permission` 175- `add-permission`
161- `remove-permission` 176- `remove-permission`
162- `edit-group-status` 177- `edit-group-status`
178- `delete-group`
163 179
164```js 180```json
165{ 181{
166 "kind": 39001, 182 "kind": 39001,
167 "content": "list of admins for the pizza lovers group", 183 "content": "list of admins for the pizza lovers group",
@@ -170,7 +186,7 @@ The list of capabilities, as defined by this NIP, for now, is the following:
170 ["p", "<pubkey1-as-hex>", "ceo", "add-user", "edit-metadata", "delete-event", "remove-user"], 186 ["p", "<pubkey1-as-hex>", "ceo", "add-user", "edit-metadata", "delete-event", "remove-user"],
171 ["p", "<pubkey2-as-hex>", "secretary", "add-user", "delete-event"] 187 ["p", "<pubkey2-as-hex>", "secretary", "add-user", "delete-event"]
172 ] 188 ]
173 ... 189 // other fields...
174} 190}
175``` 191```
176 192