diff --git a/diagrams/connection.mmd b/diagrams/connection.mmd new file mode 100644 index 0000000000..189e20eeaf --- /dev/null +++ b/diagrams/connection.mmd @@ -0,0 +1,24 @@ +sequenceDiagram + participant Alice + participant App A + participant Server A + participant Server B + participant App B + participant Bob + Alice ->> App A: Alice shows as QR code on the screen
(Alice's public key for Bob's eyes only) + Bob ->> App B: Bob requests app to add connection + App A ->> App B: Bob's app reads via the camera + App B ->> Server B: Bob's app encrypts "connection request" (including and Bob's profile) and sends it to Bob's servers
{from: , to: , message: } + Server B ->> Server A: Bob's servers use to locate Alice's servers
and forward encrypted message to all Alice's servers (when they are different from Bob's servers) + Server A ->> App A: Alice's servers send the message to Alice's app + App A ->> Alice: Alice's app uses to identify Bob
and decrypts Bob's request with to show it + Alice ->> App A: Alice identifies Bob's profile and accepts the connection
(Bob is now added to Alice's list of connections as "pending") + App A ->> Server A: Alice's app creates "connection accepted" message (including Alice's profile) and sends it to Alice's servers
{from: , to: , message: } + Server A ->> Server B: Alice's servers use to locate Bob's servers
and forward encrypted message to all Bob's servers (when they are different from Alice's servers) + Server B ->> App B: Bob's servers send the message to Bob's app + App B ->> Bob: Bob's app uses to identify Alice
and decrypts the acceptance with Bob's + App B ->> Bob: Bob's app adds Alice to the list of connections + App B ->> Server B: "connection acknowledgement" message + Server B ->> Server A: "connection acknowledgement" message + Server A ->> App A: "connection acknowledgement" message + App A ->> Alice: Bob is now in the Alice's list of connections as "established" diff --git a/diagrams/connection.svg b/diagrams/connection.svg new file mode 100644 index 0000000000..6cfe90e894 --- /dev/null +++ b/diagrams/connection.svg @@ -0,0 +1,498 @@ +AliceApp AServer AServer BApp BBobAlice shows <AB public key> as QR code on the screen(Alice's public key for Bob's eyes only)Bob requests app to add connectionBob's app reads <AB public key> via the cameraBob's app encrypts "connection request" (including <BA public key> and Bob's profile) and sends it to Bob's servers{from: <BA public key hash>, to: <AB public key hash>, message: <request encrypted with AB public key>}Bob's servers use <AB public key hash> to locate Alice's serversand forward encrypted message to all Alice's servers (when they are different from Bob's servers)Alice's servers send the message to Alice's appAlice's app uses <AB public key hash> to identify Boband decrypts Bob's request with <AB private key> to show itAlice identifies Bob's profile and accepts the connection(Bob is now added to Alice's list of connections as "pending")Alice's app creates "connection accepted" message (including Alice's profile) and sends it to Alice's servers{from: <AB public key hash>, to: <BA public key hash>, message: <encrypted with AB public key>}Alice's servers use <BA public key hash> to locate Bob's serversand forward encrypted message to all Bob's servers (when they are different from Alice's servers)Bob's servers send the message to Bob's appBob's app uses <AB public key hash> to identify Aliceand decrypts the acceptance with Bob's <BA private key>Bob's app adds Alice to the list of connections"connection acknowledgement" message"connection acknowledgement" message"connection acknowledgement" messageBob is now in the Alice's list of connections as "established"AliceApp AServer AServer BApp BBob \ No newline at end of file diff --git a/diagrams/message.mmd b/diagrams/message.mmd index bfae499388..94ea8e7bbc 100644 --- a/diagrams/message.mmd +++ b/diagrams/message.mmd @@ -7,6 +7,6 @@ sequenceDiagram participant Bob Alice ->> App A: Alice writes the message to Bob in the app App A ->> Server A: The message (including ID & timestamp) is encrypted with Bob's and sent to all Alice's servers
{from: , to: , message: } - Server A ->> Server B: Alice's servers use to locate Bob's servers
and forward encrypted message to all Bob's servers (when they are different from Alice's servers + Server A ->> Server B: Alice's servers use to locate Bob's servers
and forward encrypted message to all Bob's servers (when they are different from Alice's servers) Server B ->> App B: Bob's servers send the message to Bob's app App B ->> Bob: Bob's app uses to identify Alice
and decrypts the messages with Bob's diff --git a/diagrams/message.svg b/diagrams/message.svg index 1df8c99d11..46a6fe2540 100644 --- a/diagrams/message.svg +++ b/diagrams/message.svg @@ -1,49 +1,49 @@ -AliceApp AServer AServer BApp BBobAlice writes the message to Bob in the appThe message (including ID & timestamp) is encrypted with Bob's <BA public key> and sent to all Alice's servers{from: <AB public key hash>, to: <BA public key hash>, message: <encrypted with BA public key>}Alice's servers use <BA public key hash> to locate Bob's serversand forward encrypted message to all Bob's servers (when they are different from Alice's servers)Bob's servers send the message to Bob's appBob's app uses <AB public key hash> to identify Aliceand decrypts the messages with Bob's <BA private key>AliceApp AServer AServer BApp BBob \ No newline at end of file diff --git a/readme.md b/readme.md index ab34038f27..c2a28191dc 100644 --- a/readme.md +++ b/readme.md @@ -75,6 +75,12 @@ Client apps should provide the following: ## Sequence diagrams +Prepared with [mermaid-js](https://mermaid-js.github.io/mermaid-live-editor) + +### Adding connection + +![Adding connection](/diagrams/connection.svg) + ### Sending message -![Sending message](/diagrams/message.svg) \ No newline at end of file +![Sending message](/diagrams/message.svg)