@@ -20,17 +20,53 @@ title: polyproto-chat
20
20
[ Semantic versioning v2.0.0] ( https://semver.org/spec/v2.0.0.html ) is used to version this specification.
21
21
22
22
- [ p2-Extension: polyproto-chat] ( #p2-extension-polyproto-chat )
23
- - [ 1. Federation of Group Messages] ( #1-federation-of-group-messages )
24
- - [ 2. Encrypted channels and groups] ( #2-encrypted-channels-and-groups )
25
- - [ 2.1 Encrypted guild channels] ( #21-encrypted-guild-channels )
26
- - [ 2.2 Encrypted direct messages] ( #22-encrypted-direct-messages )
27
- - [ 2.3 Encrypted group messages] ( #23-encrypted-group-messages )
28
- - [ 2.4 Joining new devices from existing users] ( #24-joining-new-devices-from-existing-users )
29
- - [ 2.5 Best practices] ( #25-best-practices )
23
+ - [ 1. Trust model] ( #1-trust-model )
24
+ - [ 2. Federation Principles] ( #2-federation-principles )
25
+ - [ 2.1 Messaging Groups] ( #21-messaging-groups )
26
+ - [ 2.1.1 Private messages] ( #211-private-messages )
27
+ - [ 2.1.2 Group messages] ( #212-group-messages )
28
+ - [ 2.2 Guilds and Guild channels] ( #22-guilds-and-guild-channels )
29
+ - [ 3. Encrypted channels and groups] ( #3-encrypted-channels-and-groups )
30
+ - [ 3.1 Encrypted guild channels] ( #31-encrypted-guild-channels )
31
+ - [ 3.2 Encrypted direct messages] ( #32-encrypted-direct-messages )
32
+ - [ 3.3 Encrypted group messages] ( #33-encrypted-group-messages )
33
+ - [ 3.4 Joining new devices from existing users] ( #34-joining-new-devices-from-existing-users )
34
+ - [ 3.5 Best practices] ( #35-best-practices )
30
35
- [ polyproto-chat specific glossary] ( #polyproto-chat-specific-glossary )
31
36
- [ General glossary] ( #general-glossary )
32
37
33
- ## 1. Federation of Group Messages
38
+ ## 1. Trust model
39
+
40
+ polyproto-chat inherits its trust model from the core polyproto specification. In addition, the
41
+ following trust assumptions are added:
42
+
43
+ 1 . Unencrypted messages can only be read by users with the necessary permissions to access the channel
44
+ the message was sent to, at the point the message was sent, or in the future. In addition,
45
+ server moderators, -administrators and other entities who can access the infrastructure the
46
+ server is hosted on are always able to read unencrypted messages, whether through directly
47
+ accessing this information or because of a report that was filed by another user.
48
+ 2 . Unencrypted metadata can be accessed by the same set of people described in 1.
49
+ 3 . Server moderators, -administrators, other entities who may gain access to the infrastructure the
50
+ server is hosted on and other polyproto-chat users can not read encrypted messages or -metadata in
51
+ plain text, if they are not themselves part of the MLS group the message was sent in.
52
+ 4 . Extending 3., server moderators, -administrators and other entities have ** no way** to gain insight
53
+ into the contents of an encrypted message, if they are not themselves part of the MLS group the
54
+ message was sent in.
55
+ 5 . Compromise of an encrypted communications channel will not expose past communications.
56
+ 6 . After an encrypted communications channel has been compromised, it is possible to re-establish
57
+ the security/secrecy guarantees (post-compromise security).
58
+
59
+ !!! danger
60
+
61
+ Human error, faulty software or malicious actions can always lead to unauthorized access to
62
+ information, encrypted or not. This is true for every user-facing application employing encryption
63
+ *ever*, not just polyproto-chat.
64
+
65
+ ## 2. Federation Principles
66
+
67
+ This section explains how the federation in different parts of polyproto-chat works.
68
+
69
+ ## 2.1 Messaging Groups
34
70
35
71
Every messaging group is also an MLS group. Messaging groups are always encrypted using the MLS
36
72
protocol and shared cipher suites. A direct messaging group between two actors is also treated as
@@ -47,6 +83,8 @@ they send on the server which acts as their primary service provider for the pol
47
83
With multiple servers participating in a conversation, a server outage only affects the messages
48
84
stored on that server, not the entire messaging group.
49
85
86
+ ### 2.1.1 Private messages
87
+
50
88
The below sequence diagram showcases how a private messaging channel between two actors with different
51
89
service providers works.
52
90
@@ -87,7 +125,12 @@ opt Alice wants to fetch her message at a later point
87
125
end
88
126
```
89
127
90
- * Fig. 1: Message sending and message retrieval in a messaging group.*
128
+ * Fig. 1: Message sending and message retrieval in a private messaging group.*
129
+
130
+ If the actors use the same primary service provider for the ` chat ` service, steps (4) and (9) do
131
+ not apply.
132
+
133
+ ### 2.1.2 Group messages
91
134
92
135
Below, you can find a condensed sequence diagram showcasing how a messaging group with > 2 actors
93
136
works:
@@ -121,23 +164,26 @@ end
121
164
note over a,c: Fetching messages works the same way as showcased in Fig. 1.
122
165
```
123
166
124
- vvv
167
+ * Fig. 2: Message sending and message retrieval in a messaging group.*
168
+
169
+ If two actors have the same primary service provider for the ` chat ` service, steps facilitating
170
+ communication across servers do not apply.
171
+
172
+ ## 2.2 Guilds and Guild channels
173
+
174
+ Unlike messaging groups, guild channels are not encrypted by default.
125
175
126
- Group messages work just like guilds, in the sense that data is stored by the home server of the
127
- group's creator, meaning that all group members will have to communicate with the group creator's
128
- home server. If the group creator leaves the group, the ownership of the group is transferred to
129
- another member. The group chat stays on the group creator's home server.
176
+ !!! question "Why are guild channels not encrypted by default?"
130
177
131
- <!-- Potential work could be done to think of a system which allows group chat members to vote for
132
- a migration of the conversation to another server. Consent is needed from all involved parties,
133
- because otherwise, data cannot ethically be transfered from one server to another another.-->
178
+ In the real world, most guilds are used as spaces for open communities where people join and leave
179
+ freely.
134
180
135
- ## 2 . Encrypted channels and groups
181
+ ## 3 . Encrypted channels and groups
136
182
137
183
Note, that in the below sequence diagrams, the MLS Welcome message and the MLS Group notify
138
184
message are all encrypted using the identity key of the recipient.
139
185
140
- ### 2 .1 Encrypted guild channels
186
+ ### 3 .1 Encrypted guild channels
141
187
142
188
Encrypting a guild channel is done by a client with the ` MANAGE_CHANNEL ` permission. Upon
143
189
successfully requesting enabling encryption of a channel, all future messages in it will be
@@ -174,7 +220,7 @@ Fig. 3: Sequence diagram of a successful encrypted channel join in which Alice a
174
220
The sequence diagram assumes that Alice can verify Charlies' public key to indeed belong to
175
221
Charlie, and that Alice accepts the join request.
176
222
177
- ### 2 .2 Encrypted direct messages
223
+ ### 3 .2 Encrypted direct messages
178
224
179
225
Adding another person to a direct message is not possible, and would not make much sense, as the
180
226
new person cannot see any messages that were sent before they joined the group. If Alice wants
@@ -200,7 +246,7 @@ Server->>Bob: Forward encrypted MLS Welcome
200
246
201
247
Fig. 4: Sequence diagram of a successful encrypted direct message creation.
202
248
203
- ### 2 .3 Encrypted group messages
249
+ ### 3 .3 Encrypted group messages
204
250
205
251
Encrypted group messages work by using the traditional MLS protocol, with the additional concept
206
252
of group owners. Only group owners can add new members to the group and forcibly remove others
@@ -235,12 +281,12 @@ Server->>Charlie: Forward encrypted MLS Welcome
235
281
236
282
Fig. 5: Sequence diagram of a successful encrypted group creation with 3 members.
237
283
238
- ### 2 .4 Joining new devices from existing users
284
+ ### 3 .4 Joining new devices from existing users
239
285
240
286
Regardless of channel or group permissions, a user join request from a new device should be
241
287
accepted by default.
242
288
243
- ### 2 .5 Best practices
289
+ ### 3 .5 Best practices
244
290
245
291
- In case of encrypted guild channel join requests, it may be a good idea to treat multiple join
246
292
requests from the same user with different clients as a single join request, when it comes to UI/UX.
0 commit comments