SimpleX-Chat/README.md

107 lines
2.3 KiB
Markdown
Raw Normal View History

2020-10-11 11:00:25 +01:00
# simplex-messaging
2020-10-18 21:28:37 +01:00
2021-01-11 19:14:54 +00:00
The released version is [v0.1.0.0](https://github.com/simplex-chat/simplex-messaging/tree/v0.1.0.0)
2020-10-18 21:28:37 +01:00
## SMP server demo
2020-10-18 21:31:51 +01:00
This is a demo implementation of SMP ([simplex messaging protocol](https://github.com/simplex-chat/protocol/blob/master/simplex-messaging.md)) server.
2020-10-18 21:28:37 +01:00
2020-10-22 14:13:06 +01:00
It has a very limited utility (if any) for real applications, as it lacks the following protocol features:
2020-10-18 21:28:37 +01:00
- cryptographic signature verification, instead it simply compares provided "signature" with stored "public key", effectively treating them as plain text passwords.
- there is no transport encryption
2020-10-22 14:13:06 +01:00
Because of these limitations, it is easy to experiment with the protocol logic via telnet.
2020-10-18 21:28:37 +01:00
You can either run it locally or try with the deployed demo server:
```bash
telnet smp.simplex.im 5223
```
## Run locally
[Install stack](https://docs.haskellstack.org/en/stable/install_and_upgrade/) and `stack run`.
## Usage example
Lines you should send are prefixed with `>` character, you should not type them.
2020-10-22 14:13:06 +01:00
Comments are prefixed with `--`, they are not part of transmissions.
2020-10-18 21:28:37 +01:00
2020-10-22 14:13:06 +01:00
`>` on its own means you need to press `return` - telnet should be configured to send it as CRLF.
2020-10-18 21:28:37 +01:00
1. Create simplex message queue:
```telnet
>
2020-12-28 16:28:57 +00:00
> abcd -- correlation ID, any string
2020-10-18 21:28:37 +01:00
>
2020-10-22 14:13:06 +01:00
> NEW 1234 -- 1234 is recipient's key
2020-10-18 21:28:37 +01:00
2020-12-28 16:28:57 +00:00
abcd
2020-10-18 21:28:37 +01:00
2020-10-22 14:13:06 +01:00
IDS QuCLU4YxgS7wcPFA YB4CCATREHkaQcEh -- recipient and sender IDs for the queue
2020-10-18 21:28:37 +01:00
```
2020-10-22 14:13:06 +01:00
2. Sender can send their "key" to the queue:
2020-10-18 21:28:37 +01:00
```telnet
> -- no signature (just press enter)
2020-12-28 16:28:57 +00:00
> bcda -- correlation ID, any string
2020-10-18 21:28:37 +01:00
> YB4CCATREHkaQcEh -- sender ID for the queue
> SEND :key abcd
2020-12-28 16:28:57 +00:00
bcda
2020-10-18 21:28:37 +01:00
YB4CCATREHkaQcEh
OK
```
3. Secure queue with sender's "key"
```telnet
2020-10-18 21:31:51 +01:00
> 1234 -- recipient's "signature" - same as "key" in the demo
2020-12-28 16:28:57 +00:00
> cdab
2020-10-18 21:28:37 +01:00
> QuCLU4YxgS7wcPFA -- recipient ID
> KEY abcd -- "key" provided by sender
2020-12-28 16:28:57 +00:00
cdab
2020-10-18 21:28:37 +01:00
QuCLU4YxgS7wcPFA
OK
```
4. Sender can now send messages to the queue
```telnet
2020-10-18 21:31:51 +01:00
> abcd -- sender's "signature" - same as "key" in the demo
2020-12-28 16:28:57 +00:00
> dabc -- correlation ID
2020-10-18 21:31:51 +01:00
> YB4CCATREHkaQcEh -- sender ID
2020-10-18 21:28:37 +01:00
> SEND :hello
2020-12-28 16:28:57 +00:00
dabc
2020-10-18 21:28:37 +01:00
YB4CCATREHkaQcEh
OK
```
5. Recipient recieves the message and acknowledges it to receive further messages
```telnet
2020-12-28 16:28:57 +00:00
-- no correlation ID for messages delivered without client command
2020-10-18 21:28:37 +01:00
QuCLU4YxgS7wcPFA
MSG ECA3w3ID 2020-10-18T20:19:36.874Z 5
hello
> 1234
2020-12-28 16:28:57 +00:00
> abcd
2020-10-18 21:28:37 +01:00
> QuCLU4YxgS7wcPFA
> ACK
2020-12-28 16:28:57 +00:00
abcd
2020-10-18 21:28:37 +01:00
QuCLU4YxgS7wcPFA
OK
```
2020-10-18 21:31:51 +01:00
## Design
2020-10-18 21:28:37 +01:00
![server design](design/server.svg)