You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The usage of the clock is described in the [Clock](#clock) section.
308
309
310
+
### Pubsub topic or shard usage
311
+
312
+
Status network uses static sharding as explained in [Relay Sharding](https://github.com/waku-org/specs/blob/master/standards/core/relay-sharding.md#static-sharding)
313
+
314
+
All communities by default use the default shard `32` for most of their messages and use shard `64` for a few specific messages like community event messages.
315
+
316
+
A community can be assigned a dedicated shard (in the range of 1-1024) after creation in which case all messages of the community are sent on that specific shard except for the community event messages.
317
+
318
+
### Content topic level encryption
319
+
-a universal chat identifier is used for all community chats.
320
+
<!-- Don't enforce any constraints on the unique id generation -->
321
+
322
+
All messages are encrypted before they are handed over to waku ir-respective of the encryption explained above.
323
+
All community chats are encrypted using a symmetric key generated from universal chat id using pbkdf2.
@@ -357,15 +377,15 @@ for i = 0; i < topicLen; i++ {
357
377
contentTopic ="/waku/1/0x"+ topic +"/rfc26"
358
378
```
359
379
360
-
#### Community event messages
380
+
#### Community Requests
381
+
Requests to leave, join, kick and ban, as well as key exchange messages, MUST be sent to the content topic derived from the public key of the community on the common shard.
361
382
362
-
Requests to leave, join, kick and ban, as well as key exchange messages,
363
-
MUST be sent to the content topic derived from the public key of the community.
364
383
The content topic
365
-
MUST be the hex-encoded keccak-256 hash of the public key of the community.
384
+
MUST be the keccak-256 hash of hex-encoded universal chat id (public key appended with fixed string) of the community omitting the first 2 bytes.
@@ -379,6 +399,29 @@ for i = 0; i < topicLen; i++ {
379
399
contentTopic ="/waku/1/0x"+ topic +"/rfc26"
380
400
```
381
401
402
+
#### Community Shard Info
403
+
If a community is assigned a dedicated shard then the shard info for that community is published on a content topic derived from a specialized key. This is useful for users joining the new community so that they can subscribe to this specific content topic.
404
+
405
+
```js
406
+
chatID = publicKey+"-shard-info"
407
+
hash =hex(keccak256(encodeToHex(chatID))[2:])
408
+
409
+
topicLen =4
410
+
iflen(hash) < topicLen {
411
+
topicLen =len(hash)
412
+
}
413
+
var topic [4]byte
414
+
for i =0; i < topicLen; i++ {
415
+
topic[i] = hash[i]
416
+
}
417
+
418
+
contentTopic ="/waku/1/0x"+ topic +"/rfc26"
419
+
```
420
+
421
+
#### Community channels/chats
422
+
423
+
All channels/chats shall use a single content-topic which is derived based on a universal chat id ir-respective of their individual unique chat ids.
424
+
382
425
### Community Management
383
426
384
427
The flows for Community management are as described below.
@@ -391,8 +434,7 @@ according to the wire format "CommunityDescription".
391
434
3. The Community owner publishes the Community metadata on a content topic
392
435
derived from the public key of the Community.
393
436
the Community metadata SHOULD be encrypted with the public key of the Community.
394
-
<!-- TODO: Verify this-->
395
-
The Community metadata MAY be sent during fixed intervals,
437
+
The Community metadata is sent during fixed intervals,
396
438
to ensure that the Community metadata is available to members.
397
439
The Community metadata SHOULD be sent every time the Community metadata is updated.
398
440
4. The Community owner MAY advertise the Community out of band,
0 commit comments