Published: April 04, 2022
Since we released SimpleX Chat mobile apps couple of weeks ago we've had a lot of excitement from our users - nearly 2000 people downloaded the app after the announcement!
Huge thanks to everybody who downloaded and connected to us via the chat - there were many great questions and suggestions, and on some days I spent most of the time chatting to our users :)
Since we released the app, we've added and released:
Once you install the app, you can connect to anybody:
See demo video that shows how two users connect and send the first messages.
We are building SimpleX Chat because we believe that privacy is a fundamental human right, and that protecting our personal network of contacts is even more important than the content of the messages - sharing this network can lead to various adverse consequences, from manipulating us into buying goods we don't need, manipulating election processes, and in some cases, prosecuting innocent people. For example, Mohamedou Ould Salahi was detained in Guantanamo prison for 15 years after a single "wrong" phone call. His story is told in his memoir and in The Mauritanian movie.
Our first users realized that what we take for granted in messaging apps - instant message notifications - is missing in our first release of SimpleX Chat apps. Quite a few people thought that it was a bug, rather than a missing feature. Sorry to disappoint!
SimpleX Chat is the first and the only messenger we know of that operates without user identities of any kind. There are no phone numbers, emails, usernames, public keys, or any other addresses or identifiers to uniquely identify the users to the network or servers. That is why we say it is 100% private by design, and fundamentally different than other chat platforms.
Instead, SimpleX Chat assigns these identifiers to unidirectional message queues. What looks to SimpleX Chat users like contacts and groups [1], to SimpleX servers looks like an unorganized and unrelated collection of unidirectional message queues. Our servers do not know which queues belong to which users, contacts or groups. Even a single conversation can happen via two different servers (one for sent and another for received messages). This makes our personal network of contacts invisible to the servers.
But it also creates a problem for instant notifications - all push notification services require having a device token.
So, how can we operate without identities and still have instant notifications?
[1] yes, we have groups in our terminal app, and the UI to manage them is coming to mobile apps soon. Some users have already firgured out how to create groups via chat console.
After some research into how push notifications work on Android, and open-source alternatives to Google push notifications, we discovered how to avoid sharing device tokens with any servers.
We have implemented message reception as a background service (in Android terminology, a "foreground service" showing a notification icon when the service is running) following the same design as ntfy.sh created by Philipp Heckel, who, in turn, credits the design to the blog post by Roberto Huertas. Big thanks to them!
How does it work? When the app is first started on an Android device, it starts the background service that keeps the TCP connections to the messaging servers open with almost no traffic (only doing periodic checks that connections still exist). It consumes only a few percents of battery per day, depending on how stable your internet connection is, and delivers message notifications as soon as messages arrive.
This service continues running when the app is switched off, and it is restarted when the device is restarted even if you don't open the app - so the message notifications arrive instantly every time. To maximize battery life, it can be turned off by switching off "Private notifications". You will still receive notifications while the app is running or in the background.
So, for Android we can now deliver instant message notifications without compromising users' privacy in any way. The app version 1.5 that includes private instant notifications is now available on Play Store, in our F-Droid repo and via direct APK downloads!
Please let us what needs to be improved - it's only the first version of instant notifications for Android!
iOS is much more protective of what apps are allowed to run on the devices, and the solution that worked on Android is not viable on iOS.
We already have background refresh in the iOS app that periodically checks for new messages, and if you use the app every day it delivers notifications within 10 or 20 minutes. It is not instant, but it may be usable for some. If you use the app infrequently, however, this delay can become several hours, or your phone may stop checking for the new messages completely. This is not ideal!
The only solution known to us is using Apple's push notifications service (APN) to deliver push notifications.
We planned for it, so we added to v1 of SMP (the protocol used by our servers) an extension allowing the client to subscribe to notifications from message queues, via separate queue addresses, and using separate cryptographic keys for each queue. This has to be enabled by the client for each queue separately. We haven't used this extension so far, and now we are building a SimpleX notification service based on it.
If the user enables push notifications, then for each contact the app would enable a notification subscription and pass credentials to the notification server together with the device token required to deliver push notifications to user's device.
The notification server will subscribe to these notifications from SMP servers. The notifications do not include any message content, only the signal that a message has arrived to the server. Notification server is only allowed to send 2-3 hidden notifications per hour to the device. The notification is end-to-end encrypted and contains information about which server has a message, so that the client can connect to the server, retrieve and decrypt the message, and show the notification to the users including sender name and the message content. None of this information is shared with any server.
If the user receives more than 2-3 messages per hour, the notification server can send additional visible notifications that would simply say "you have a new message", and the user will have to open the app to receive and see these messages. We are also investigating whether we can use "mutable-content" notifications that allow doing some processing when the notification arrives before showing it to the users.
It is a substantial amount of development, we are aiming to release it later this month.
This design is a compromise between privacy and convenience. The notification server will have to have a device token to deliver notifications. Several things we did (or plan to do) to improve this compromise:
So, with the notification servers added, our network design will look like this:
User's iOS device Internet Servers
--------------------- | ------------------------ | -------------------------
| |
| | (can be self-hosted now)
+--------------+ | | +----------------+
| SimpleX Chat | -------------- TLS --------------- | SimpleX |
| client |------> SimpleX Messaging Protocol (SMP) ---> | Messaging |
+--------------+ ---------------------------------- | Server |
^ | | | +----------------+
| | | | | |
| | | | | S | T
| | | | | M | L
| | | | | P | S
| | | | | |
| | | | +----------------+ +----------------+
| | -------------- TLS --------------- | SimpleX | | SimpleX |
| |-----------> Notifications management ----> | Notifications | ----> | Push |
| ---------------------------------- | Subscriber | | Server |
| | | +----------------+ +----------------+
| | | (can be self-hosted |
| | | in the future) |
| | | V
| -------------- TLS --------------- +-----------------+
|----------------- Notification delivery <----------------------------- | Apple PN server |
---------------------------------- +-----------------+
| |
Please let us know what you think about this design and about this privacy / usability trade-off:
Thank you!