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
+
320
+
-a universal chat identifier is used for all community chats.
321
+
<!-- Don't enforce any constraints on the unique id generation -->
322
+
323
+
All messages are encrypted before they are handed over to waku ir-respective of the encryption explained above.
324
+
All community chats are encrypted using a symmetric key generated from universal chat id using pbkdf2.
@@ -357,15 +378,16 @@ for i = 0; i < topicLen; i++ {
357
378
contentTopic ="/waku/1/0x"+ topic +"/rfc26"
358
379
```
359
380
360
-
#### Community event messages
381
+
#### Community Requests
382
+
383
+
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
384
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
385
The content topic
365
-
MUST be the hex-encoded keccak-256 hash of the public key of the community.
386
+
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 +401,30 @@ for i = 0; i < topicLen; i++ {
379
401
contentTopic ="/waku/1/0x"+ topic +"/rfc26"
380
402
```
381
403
404
+
#### Community Shard Info
405
+
406
+
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.
407
+
408
+
```js
409
+
chatID = publicKey+"-shard-info"
410
+
hash =hex(keccak256(encodeToHex(chatID))[2:])
411
+
412
+
topicLen =4
413
+
iflen(hash) < topicLen {
414
+
topicLen =len(hash)
415
+
}
416
+
var topic [4]byte
417
+
for i =0; i < topicLen; i++ {
418
+
topic[i] = hash[i]
419
+
}
420
+
421
+
contentTopic ="/waku/1/0x"+ topic +"/rfc26"
422
+
```
423
+
424
+
#### Community channels/chats
425
+
426
+
All channels/chats shall use a single content-topic which is derived from a universal chat id irrespective of their individual unique chat ids.
427
+
382
428
### Community Management
383
429
384
430
The flows for Community management are as described below.
@@ -391,8 +437,7 @@ according to the wire format "CommunityDescription".
391
437
3. The Community owner publishes the Community metadata on a content topic
392
438
derived from the public key of the Community.
393
439
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,
440
+
The Community metadata is sent during fixed intervals,
396
441
to ensure that the Community metadata is available to members.
397
442
The Community metadata SHOULD be sent every time the Community metadata is updated.
398
443
4. The Community owner MAY advertise the Community out of band,
Copy file name to clipboardexpand all lines: waku/informational/23/topics.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -120,15 +120,26 @@ As an example, here's the content topic used for an upcoming testnet:
120
120
121
121
### Content Topic Naming Recommendations
122
122
123
-
Application names should be unique to avoid conflicting issues with other protocols.
124
-
Applications should specify their version (if applicable) in the version field.
123
+
Application names SHOULD be unique to avoid conflicting issues with other protocols.
124
+
Applications SHOULD specify their version (if applicable) in the version field.
125
125
The `{content-topic-name}` portion of the content topic is up to the application,
126
126
and depends on the problem domain.
127
127
It can be hierarchical, for instance to separate content, or
128
128
to indicate different bandwidth and privacy guarantees.
129
129
The encoding field indicates the serialization/encoding scheme
130
130
for the [WakuMessage payload](../../standards/core/14/message.md/#payloads) field.
131
131
132
+
### Content Topic usage guidelines
133
+
134
+
Applications SHOULD be mindful while designing/using content topics so that a bloat of content-topics does not happen.
135
+
A content-topic bloat causes performance degradation in Store and Filter protocols while trying to retrieve messages.
136
+
137
+
Store queries have been noticed to be considerably slow (e.g doubling of response-time when content-topic count is increased from 10 to 100) when a lot of content-topics are involved in a single query.
138
+
Similarly number of filter subscriptions increase, which increases complexity on client side to maintain and manage these subscriptions.
139
+
140
+
Applications SHOULD analyze the query/filter criteria for fetching messages from the network and select/design content topics to match such filter criteria.
141
+
e.g: even though applications may want to segregate messages into different sets based on some application logic, if those sets of messages are always fetched/queried together from the network, then all those messages SHOULD use a single content-topic.
142
+
132
143
## Differences with Waku v1
133
144
134
145
In [5/WAKU1](../../deprecated/5/waku0.md) there is no actual routing.
0 commit comments