HomeServicesContactBlog

A Guide to Matrix

Original post on TJournal

We all use one messenger or another. The most common ones in Russia right now are WhatsApp and Telegram. What do they have in common? They are centralized, and corporations collect and monetize your data in exchange for their services while you use them. This is where the Matrix protocol comes to the rescue.

matrix.cleaned.jpg

At the beginning of this year, WhatsApp introduced a new privacy policy that caused a lot of concern. Following that, Telegram is encroaching on free speech and removing content from its platform. Isn't it time to come to our senses and switch messengers? Fortunately, there is an alternative in the form of the Matrix protocol, which will help us significantly reduce the influence of large corporations and move to a free network that guarantees privacy.

The Matrix Protocol

Matrix is an open protocol for decentralized real-time communication. It can be used for text messaging, group chats, audio/video calls, and creating bots. It has been developed by enthusiasts from the Matrix.org Foundation since 2014.

Being an open standard, Matrix has united a huge number of enthusiasts. This means there will always be a good group of people passionate about keeping Matrix operational.

The protocol specifications, as well as the client-server part, are publicly available, unlike Telegram, which currently only keeps its client open source, raising many questions about the security of the MTProto protocol.

Features

Federation

The principles of federation were already touched upon in the previous article "Guide to the Fediverse". As for Matrix — thanks to the federated nature of the protocol, users from different servers can communicate with each other. Servers can connect to each other, thereby forming a federation.

Currently, the Matrix network has over 75 thousand nodes and 40 million users. You can register on any open server or set up your own server. And this server can be either open or closed. For example, you might want to set up a server for your friends and family. This is entirely possible. And if in the future you want to connect it to the wider network, you can do so.

You can run your own Matrix server physically at home, perhaps using an old PC lying around, or on a single-board computer like a Raspberry Pi. If you really want to, you can use a cloud solution and host it on a VPS. But the real advantage is being the master of your own equipment and hosting it close to you.

Replication

The most unusual feature of the protocol is replication. Room contents are replicated across all participating servers, meaning there is no single point of control or failure. But you can create a local room accessible only to server users.

Key Synchronization

What sets Matrix apart from other Open Source solutions is key synchronization in encrypted rooms — meaning you can switch from one device to another and still see all messages.

Encryption

Server-to-server traffic is mandatorily wrapped in TLS. Client-server traffic is encrypted at the transport layer.

Moreover, Matrix supports end-to-end encryption based on an open source mechanism that works in both group and private chats. Unlike public channels hosted on Telegram.

Bridges

Another unusual feature is bridges. They allow you to gather all your chats in one place and communicate with users of different messengers. This is actually why Matrix is named that way — it unites many different services into one matrix. It's common to find rooms where users of IRC, XMPP, and Telegram communicate.

bridges.cleaned.png

Matrix has several officially supported bridges. These include Slack, IRC, XMPP, and Gitter. But since there is an active community around Matrix, there are many others to choose from. For example, Discord, Facebook Messenger, Telegram, Signal, WhatsApp, VK, SMS, Instagram, and many others.

Widgets

Widgets allow you to integrate third-party applications into rooms. Currently available widgets include collaborative document editing, a calendar, and much more. Custom widgets are also available. They are often used for alerts. An extremely useful feature.

Bots

Matrix is open for creating bots. The Element client already supports some bots out of the box, such as a bot for integrating RSS feeds into rooms and many others.

bots.png

Device Verification

The Element client uses device verification with cross-signing to ensure the identity of conversation participants and their devices, tracking every device connected to an encrypted conversation. If a new unknown device joins the conversation, you can use device verification to ensure it's really that person. If you suspect a trusted device has fallen into the wrong hands, you can revoke its access to the current encrypted conversation.

Device verification protects against Man-in-the-Middle attacks.

Free Registration

Popular messengers only allow registration by phone number, which adds at least two vulnerabilities: attackers can reissue your SIM card and gain access to your account, and your phone number can be linked to your account.

Matrix solves these problems: a phone number and email are not required for registration — you can use only a login and password.

If you want to use contact information for others to find you, you can connect an identity server in the Element client settings so you can be discovered by email or phone number. Using the discovery feature is not necessary, as you can easily be found by your personal address, which looks like @username:domain.tld

Clients

To use WhatsApp, you must download it and only it — you are tied to that application. With Matrix, it works differently. And this brings us to another strength of Matrix. Since Matrix is an open standard, anyone can implement the protocol in their own application.

This means there is no single Matrix client — there are over 150 applications based on Matrix, ranging from open source to commercial proprietary solutions. You get a huge number of clients for various platforms that focus on different capabilities, offer various features, and support different devices. Element is one of the most popular Matrix clients.

Element

element.cleaned.png Mobile Element client view
Source: matrix.org

Element is a free cross-platform messenger; the desktop version uses the Electron framework. I know, it's not the best solution, but in that case you can use the web version or another client.

The Element client has all the modern features inherent in other popular messengers. Of course, Telegram is more loved for its UI/UX — but Element currently is in no way inferior to Telegram in terms of functionality:

Text Messages

Everything is standard here; the only thing worth noting is message formatting using Markdown or a visual editor, whichever you prefer.

Audio/Video Calls

Audio/video calls are implemented via WebRTC. One of the recent updates added voice messages to the Element Android client.

Rooms

Rooms (group chats) can be created as private — only invited users can find and join — or public — anyone can find and join the room. A room's status can be changed later. You can also set restrictions for users from other nodes, so the room is used only by internal users on your server. Room admins have flexible access and user permission settings, as well as the ability to appoint new administrators and moderators.

Spaces

To put it simply, this is a room for rooms. Or a method of grouping rooms and users, similar to Workspaces in the corporate messenger Slack.

room.cleaned.png _Desktop Element client view
Author: Vulphere _

Conclusion

It's hard to describe how great the potential of Matrix is right now, and I don't know if Matrix is the future, but it's definitely a big part of it. From this article alone, you can see that there are a huge number of options that allow you to create the service you want, right down to the specific client. And you can configure everything to your liking.

The ecosystem based on Matrix is growing inexorably. Various startups based on Matrix already exist, such as Famedly and Beeper. Large businesses like Thales, Ericsson, Dataport, and Sopra Steria, and many leading organizations such as Red Hat, Mozilla, Uber, Samsung, TADHack, W3F, and UpCloud, use Matrix-based solutions for internal communication. This allows them to create their own secure communication applications. In Russia, the Magnit retail chain uses Matrix.

In February 2021, the largest free software conference, FOSDEM, which was forced to take place online due to the pandemic, was held on Matrix. The online event was attended by over 30,000 users. The team used the full range of functionality to make users comfortable — bots for automating room creation on schedule, widgets for schedules and for messages filtered by the number of emoji reactions from users, bridges to each of the more than 500 rooms on IRC and XMPP. Matrix has clearly conquered the open source community!

I would also like to convince readers that Matrix is open to everyone, not just geeks and "anonymous." Matrix will be useful to absolutely everyone, regardless of whether you care about privacy or not.

To get started with Matrix, you can register on the Matrix.org server. To do this, simply download the Element app or use the web client.

The Matrix network has a Russian-speaking space with over 40 rooms. In short, join and welcome to the Internet!