summaryrefslogtreecommitdiff
path: root/docs/Group-Chats.md
diff options
context:
space:
mode:
authorDavid Gumberg <davidzgumberg@gmail.com>2013-09-22 14:15:09 -0700
committerDavid Gumberg <davidzgumberg@gmail.com>2013-09-22 14:15:09 -0700
commit7d1fb4bef0b3c06a2dea9e78f45a45a47039ddb0 (patch)
tree5f13d2c1c5a4783168400dafe0570ffc9d982c95 /docs/Group-Chats.md
parentbb6566e436ffb451f84143288e9b89453aae1ec2 (diff)
A markdown-formatted file had the .txt extension
Diffstat (limited to 'docs/Group-Chats.md')
-rw-r--r--docs/Group-Chats.md71
1 files changed, 71 insertions, 0 deletions
diff --git a/docs/Group-Chats.md b/docs/Group-Chats.md
new file mode 100644
index 00000000..0da6da04
--- /dev/null
+++ b/docs/Group-Chats.md
@@ -0,0 +1,71 @@
1Massive public group chats.
2
3Everyone generates a short term public private key pair right before joining
4the chat.
5
6Note that for public group chats it is impossible to protect the chat from
7being spied on by a very dedicated attacker, encryption is therefor used as a
8form of spam/access control.
9
10## Joining the chats
11
12
13## Protocol
14
15
16Node format:
17```
18[char array (node_id), length=32 bytes][ip (in network byte order), length=4 bytes][port (in network byte order), length=2 bytes][Padding , length=2 bytes]
19```
20
21Get nodes (Request):
22Packet contents:
23```
24[char with a value of 48][Bob's (The reciever's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted with the nonce and private key of the sender:[char with a value of 48][random 8 byte (ping_id)]
25```
26Valid replies: a send_nodes packet
27
28Send_nodes (response):
29```
30[char with a value of 48][Bob's (The reciever's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted with the nonce and private key of the sender:[char with a value of 49][random 8 byte (ping_id)][Nodes in node format, length=40 * (number of nodes (maximum of 6 nodes)) bytes]]
31```
32
33Broadcast packet:
34```
35[char with a value of 48][Bob's (The reciever's) Public key (client_id) (32 bytes))][Alice's (The sender's) Public key (client_id) (32 bytes)][nonce][Encrypted with the nonce and private key of the sender:[char with a value of 50][Data to send to everyone]]
36```
37
38
39Data to send to everyone:
40TODO: signing and spam control + permissions.
41[client_id of sender][uint32_t message number][char with a value representing id of message][data]
42
43Note: the message number is increased by 1 for each sent message.
44
45message ids:
460 - ping
47sent every ~60 seconds by every peer.
48No data.
49
5016 - new_peer
51Tell everyone about a new peer in the chat.
52[uint8_t public_key[public_key_len]]
53
5417 - ban_peer
55Ban a peer
56[uint8_t public_key[public_key_len]]
57
5818 - topic change
59[uint8_t topic[topiclen]]
60
6148 - name change
62[uint8_t name[namelen]]
63
6449 - status change
65[uint8_t (status id)]
66
6764 - chat message
68[uint8_t message[messagelen]]
69
7065 - action (/me)
71[uint8_t message[messagelen]] \ No newline at end of file