This week we've spent a lot of time getting our own Matrix homeserver up and running. We used a pre-built Python backend called Synapse, but there are many others, like Maelstrom and Conduit. If you haven't heard of it (I wouldn't be surprised, it is quite young), Matrix is an open source project working on an open chat standard being developed by the people over at the Matrix.org Foundation. What makes Matrix so very cool, and important, is that it is built around three core values: security, decentralization, and instantaneity. I think Matrix describes their vision well:
Imagine a world...
...where it is as simple to message or call anyone as it is to send them an email.
...where you can communicate without being forced to install the same app.
...where you can choose who hosts your communication.
...where your conversations are secured by E2E encryption.
...where there’s a simple standard HTTP API for sharing real-time data on the web.
In brief, this means that, with Matrix, you can be confident and comfortable while talking to your friends or colleagues. You can use whatever client suits your style, even build your own, while having a secure and private conversation with, and only with, the people you want to.
In not-so-brief, to explain what exactly this means and how the Matrix standard is used, let me provide you with a brief example. Skip this if you don't care about the details (but you really should care about the details). Bob has two friends, Alice and Charlie. Alice has her own Matrix homeserver running on personal hardware, and Bob has an account on Alice's homeserver. Charlie, on the other hand, has an account residing on their work's homeserver, that we'll just call "Company".
Bob is using the Element client app on his phone, while Charlie prefers to use a client on their desktop that was custom-built by their company (if the mention of client's is adding any confusion, don't worry too much, there will be more on clients later). On the Element app, Bob is able to send a chat request to Charlie through their global Matrix identifier (something like @charlie:company.com). This request is sent to Bob's homserver on his friend Alice's hardware, which passes the request to the homeserver given in the earlier mentioned global identifier, Company's homeserver (requiring a signed certificate), which knows who Charlie is and passes the request down to them. Charlie is then able to accept this request on her custom desktop client. This request also could have happened the other way around, custom client to Element. It doesn't matter, that's what's so cool about it!
At this point, Bob and Charlie's conversation can be end-to-end encrypted, or E2EE. With this encryption, only Bob and Charlie can see what is being sent between them. Nobody else has a way of seeing the information sent, not even the homeservers. As a final security measure, Charlie can optionally complete a very short verification process with Bob. This just ensures that both users are in fact who they say they are and that no one is standing in the middle of the conversation, telling Charlie that they're Bob and Bob that they are Charlie. Even though this is an optional step, it is highly recommended.
So, through the Matrix standard, even though Bob and Charlie are using as different setups as can be imagined, they can confidently have a secure chat, call, or video call. This confidence is born from the encryption and verification techniques used by Matrix, the fact that the project is open source, and the knowledge of which homeservers are housing their data.
An important note: This is just an example of one configuration. Charlie's work could be blocking outside communication or not allowing them to join certain types of rooms. Bob and Charlie could both be on the offical Matrix homeserver. Bob and Charlie could both be on their own self-hosted homeserver. All that matters is that both are on a homeserver that allows for communication between these two users.
Another important note: It is recommended that you host your own homeserver, but definitely not necessary. There are many public homeservers that you can create an account under, including our own. There's also a good way to meet in the middle with official Matrix hosting services, which allow you to have your own homeserver without all the fuss. No matter who you are, there's a way to tap in to the Matrix that's right for you!
Now, this has all just been the backend communication talk, but what about the frontend? Since Matrix is an open standard using simple APIs and SDKs, anybody is able to securely communicate with the homeservers in any way they wish (even from a Nintendo DS). For us here at JATAS, we've tested Element (also on both iOS and Android), Nekho, and Mirage, which all boast E2EE and a simple, intuitive UI reminiscent of Slack or Discord. Element is the most well known of them all and has been picked up the the French government, the German Educational System, Mozilla, and many others. Nheko and Mirage have both had less time and manpower than Element, leading to a few quirks, but are definitely still usable and have some unique features when it comes to things like customisability. One that we haven't had a chance to try, but that seems very interesting, is Weechat. Weechat is a terminal interface for Matrix, written in Python, and provides a unique, barebones experience that may make some users who live on the command line feel right at home. Now that we have our own homeserver set up, we've been playing with the idea of creating our own client, if time allows. In the meantime, we'll probably just stick with Element due to it's reliability and usability.
Lastly on our list of important Matrix topics is it's name. Or, rather, where it gets it's name. Matrix is the connection between many existing platforms and real-time data types, creating a matrix of communication and information.
When it comes to bridging together platforms, Matrix has official support for bridges to Slack, IRC, XMPP, and Gitter, while the Matrix community has provided bridges to some popular communication apps like Discord, WhatsApp, Signal, and quite a few others. Matrix has made it a goal to make bridges easy to write, so you could hopefully create a bridge to any other platform you wanted. This means you can talk to your friends on Slack, for example, while you use Matrix!
The Matrix communication standard can handle any type of information, not just chat messages. This paves the way to the integration of many apps that have already been built, like Jitsi, YouTube, or even simply sticker packs to spice up your conversations. This lessens the load on the developers of servers and clients while providing an expansive list of features to the end-user, you!
The Matrix protocol is built around text chats and VoIP, which already provides support for features such as chat bots, file transfer, message formatting, and voice and video calls. However, Matrix can handle any type of real-time data. This means that the Matrix standard could be used in a diverse list of situations. Two situations that the Matrix.org Foundation feels Matrix would be extremely useful in are IoT and AR/VR. Currently IoT devices have no standard and different companies are free to have proprietary communication standards, which leads to dreams of smart houses becoming pretty dumb. If smart devices were to pick up the Matrix standard, data would be able to be sent to any other smart device quickly and securely, allowing for greater integration between devices. A similar situation is happening in the AR/VR sector. The companies behind different headsets are all using their own standards, which can make communication across different headsets and devices difficult if not impossible. Matrix aims to be the solution to these types of problems.
The Matrix open messaging protocol, by the Matrix.org Foundation, is a young data-transfer standard. This standard provides a secure, fast, decentralized way to communicate with people or devices, with the user always knowing what exactly is happening to their data. Anybody is free to write their own server or client, or just use an existing one, and these can even integrate with other devices or platforms. No matter who you are, you have a use for Matrix!
Come chat with us on our homeserver!
This Week I Learned is an ongoing project where one of us here at JATAS writes a short article on an interesting topic we learned some new (to us) information about this week. Even if there isn't a large quantity of information to share, you can be sure it is quality!
This artical was written by Ryan.