Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 0ea94a8

Browse files
committed
fix numbering starting from #4
1 parent ec6b125 commit 0ea94a8

File tree

1 file changed

+10
-10
lines changed
  • docs/Protocol Specifications/P2 Extensions

1 file changed

+10
-10
lines changed

docs/Protocol Specifications/P2 Extensions/chat.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ title: polyproto-chat
1919

2020
[Semantic versioning v2.0.0](https://semver.org/spec/v2.0.0.html) is used to version this specification.
2121

22-
## 4. Federating direct/group messages
22+
## 1. Federating direct/group messages
2323

24-
### 4.1 Direct messages
24+
### 1.1 Direct messages
2525

2626
Federating direct messages is straightforward. When Alice sends a message to Bob, their client will send the message to Bob's home server via an API request. Bob's home server will then send the message to Bob's client via an established WebSocket connection, and vice versa.
2727

28-
### 4.2 Group messages
28+
### 1.2 Group messages
2929

3030
Group messages work just like guilds, in the sense that data is stored by the home server of the group's creator, meaning that all group members will have to communicate with the group creator's home server. If the group creator leaves the group, the ownership of the group is transferred to another member. The group chat stays on the group creator's home server.
3131

3232
<!--Potential work could be done to think of a system which allows group chat members to vote for a migration of the conversation to another server. Consent is needed from all involved parties, because otherwise, data cannot ethically be transfered from one server to another another.-->
3333

34-
## 6. Encrypted channels and groups
34+
## 2. Encrypted channels and groups
3535

3636
Note, that in the below sequence diagrams, the MLS Welcome message and the MLS Group notify message are all encrypted using the identity key of the recipient.
3737

38-
### 6.1 Encrypted guild channels
38+
### 2.1 Encrypted guild channels
3939

4040
Encrypting a guild channel is done by a client with the `MANAGE_CHANNEL` permission. Upon successfully requesting enabling encryption of a channel, all future messages in it will be encrypted. Joining an encrypted channel is done by sending a join request to the server. The server will then notify the channels' members of the join request. The members will then decide whether to accept or reject the join request. If the join request is accepted by any member, that member will initiate the MLS welcoming process. If the member finds that the join request is invalid (perhaps due to an invalid `KeyPackage`), the join request must be denied. It is imperative that join requests are verified correctly by the server.
4141

@@ -50,7 +50,7 @@ participant Bob
5050
5151
Charlie->>Server: Channel join request + KeyPackage
5252
Server->>Alice: Notify group of join request
53-
Alice->>Server:
53+
Alice->>Server:
5454
Server->>Alice: Channel join request + Charlie's KeyPackage
5555
Alice->>Bob: Verify Charlie's KeyPackage
5656
Bob->>Alice: Verified
@@ -63,7 +63,7 @@ Server->>Charlie: Forward: encrypted MLS Welcome
6363

6464
Fig. 3: Sequence diagram of a successful encrypted channel join in which Alice acts as a gatekeeper. The sequence diagram assumes that Alice can verify Charlies' public key to indeed belong to Charlie, and that Alice accepts the join request.
6565

66-
### 6.2 Encrypted direct messages
66+
### 2.2 Encrypted direct messages
6767

6868
Adding another person to a direct message is not possible, and would not make much sense, as the new person cannot see any messages that were sent before they joined the group. If Alice wants to add Charlie to a direct message with Bob, she will have to create a new direct message with Bob and Charlie.
6969

@@ -84,7 +84,7 @@ Server->>Bob: Forward encrypted MLS Welcome
8484

8585
Fig. 4: Sequence diagram of a successful encrypted direct message creation.
8686

87-
### 6.3 Encrypted group messages
87+
### 2.3 Encrypted group messages
8888

8989
Encrypted group messages work by using the traditional MLS protocol, with the additional concept of group owners. Only group owners can add new members to the group and forcibly remove others from the group. The Group owner is determined by the Client-Server API.
9090

@@ -115,11 +115,11 @@ Server->>Charlie: Forward encrypted MLS Welcome
115115

116116
Fig. 5: Sequence diagram of a successful encrypted group creation with 3 members.
117117

118-
### 6.4 Joining new devices from existing users
118+
### 2.4 Joining new devices from existing users
119119

120120
Regardless of channel or group permissions, a user join request from a new device should be accepted by default.
121121

122-
### 6.5 Best practices
122+
### 2.5 Best practices
123123

124124
- In case of encrypted guild channel join requests, it may be a good idea to treat multiple join requests from the same user with different clients as a single join request, when it comes to UI/UX.
125125
- Joining an encrypted channel, even from an already established member with a new device, should be an event distinctly visible to all members of the channel. This is to prevent a malicious user from joining a channel without the other members noticing.

0 commit comments

Comments
 (0)