Matrix (protocol)

From Wikipedia, the free encyclopedia
Matrix
Communication protocol
[matrix]
PurposeFederated messaging and data synchronization
Developer(s)The Matrix.org Foundation CIC
IntroductionSeptember 2014; 9 years ago (2014-09)[1][failed verification]
Based onHTTP, WebRTC
OSI layerapplication layer
Port(s)unknown value, unknown value
Websitematrix.org

Matrix (sometimes stylized as [matrix]) is an open standard and communication protocol for real-time communication.[2] It aims to make real-time communication work seamlessly between different service providers, in the way that standard Simple Mail Transfer Protocol email currently does for store-and-forward email service, by allowing users with accounts at one communications service provider to communicate with users of a different service provider via online chat, voice over IP, and videotelephony. It therefore serves a similar purpose to protocols like XMPP, but is not based on any existing communication protocol.

From a technical perspective, it is an application layer communication protocol for federated real-time communication. It provides HTTP APIs and open source reference implementations for securely distributing and persisting messages in JSON format over an open federation of servers.[3][4] It can integrate with standard web services via WebRTC, facilitating browser-to-browser applications.

History[edit]

The initial project was created inside Amdocs, while building a chat tool called "Amdocs Unified Communications",[5] by Matthew Hodgson and Amandine Le Pape [fr]. Amdocs then funded most of the development work from 2014 to October 2017.[6] Matrix was the winner of the Innovation award at WebRTC 2014 Conference & Expo,[7] and of the "Best in Show" award at WebRTC World in 2015.[8] The protocol received praise mixed with some cautionary notes after it launched in 2014. Reviewers noted that other attempts at defining an open instant messaging or multimedia signalling protocol of this type had difficulties becoming widely adopted—e.g. XMPP and IRCv3—and have highlighted the challenges involved, both technological and political.[9] Some were unclear if there was enough demand among users for services which interoperate among providers.[10][11] In 2015, a subsidiary of Amdocs was created, named "Vector Creations Limited", and the Matrix staff was moved there.[12]

In July 2017, the funding by Amdocs was announced to be cut and in the following weeks the core team created their own UK-based company, "New Vector Limited",[13] which was mainly built to support the development of Matrix and Riot, which was later renamed to Element.[14] During this time period, there were multiple calls for support to the community and companies that build on Matrix,[15] to help pay for the wages of at least part of the core team. Patreon and Liberapay crowdfunding accounts were created,[16] and the core team started a video podcast, called Matrix "Live" to keep the contributors up to speed with ongoing developments.[17] This was expanded by a weekly blog format, called "This Week in Matrix", where interested community members could read, or submit their own, Matrix-related news.[18] The company was created with the goal of offering consultancy services for Matrix and paid hosting of Matrix servers (as a platform called modular.im, which was later renamed to Element matrix services[19]) to generate income.[20]

In the early weeks after its creation, the Matrix team and the company Purism published plans to collaborate in the creation of the Librem 5 phone.[21] The Librem 5 was intended to be a Matrix native phone, where the default pre-installed messaging and caller app should use Matrix for audio and video calls and instant messaging.[22]

In 2017, KDE announced it was working on including support for the protocol in its IRC client Konversation.[23]

In late January 2018, the company received an investment of US$5 million from Status,[24][25] an  Ethereum based startup.

In April 2018, the French Government announced plans to create their own instant messaging tool.[26] Work on the application based on Riot and Matrix protocol—called Tchap [fr] after French scientist Claude Chappe—had started in early 2018,[27] and the program was open-sourced and released on iOS and Android in April 2019.[28]

In October 2018, a Community Interest Company called "The Matrix.org Foundation C.I.C."[29] was incorporated, to serve as a neutral legal entity for further development of the standard.[30]

In February 2019, the KDE community announced plans to adopt Matrix for its internal communications needs, as a decentralized alternative to other instant messaging servers like Telegram, Slack, and Discord, and operate its own server instance.[31]

In April 2019, Matrix.org suffered a security breach in which the production servers were compromised.[32] This breach was not an issue with the Matrix protocol and did not directly affect home servers other than matrix.org.

In June 2019, the Matrix protocol left beta phase with the version 1.0 across all APIs (and Synapse, at the time the reference home server), and the Matrix foundation was officially launched.[33][34]

In October 2019, New Vector raised an additional US$8.5 million to develop Matrix.[35]

In December 2019, German Ministry of Defense announced a pilot project called BwMessenger for secure instant messaging tool based on Matrix protocol, Synapse server and Riot application. This is modeled after French Tchap project. The long-term goal of the Federal Government is the secure use of messenger services that covers all ministries and subordinate authorities.[36]

In December 2019, Mozilla announced that it would begin to use Matrix as a replacement for IRC. In the announcement, they said that they would be completing the move in late January 2020. The Mozilla IRC server, irc.mozilla.org, is said to be removed "no later than March of next year [2020]".[37] In March 2020, the IRC server was turned off and users were directed to join chat.mozilla.org, Mozilla's Element instance.[38]

In May 2020, Matrix enabled end-to-end encryption by default for private conversations.[39]

In October 2020, Element acquired Gitter from GitLab.[40] This meant that all Gitter users would be transitioned over to Matrix.[41]

In March 2021, matrix.org announced that there are 28 million global visible accounts.[42]

In September 2022, some security issues were found in the implementation of one client-side encryption library.[43] Due to the interoperable architecture, only the affected client applications needed upgrade and third-party implementations were not affected.[43] All critical issues were fixed, with the remaining ones being either non-exploitable in practice, or already prominently warned for in the client.[43]

In June 2023, Beeper became the first member of The Matrix Foundation.[44]

Protocol[edit]

Matrix network

Matrix targets use cases like voice over IP, Internet of things and instant messaging, including group communication, along with a longer-term goal to be a generic messaging and data synchronization system for the web. The protocol supports security and replication, maintaining full conversation history, with no single points of control or failure. Existing communication services can integrate with the Matrix ecosystem.[3]

Client software is available for open-federated Instant Messaging (IM), voice over IP (VoIP) and Internet of Things (IoT) communication.

The Matrix standard specifies RESTful HTTP APIs for securely transmitting and replicating JSON data between Matrix-capable clients, servers and services. Clients send data by PUTing it to a ‘room’ on their server, which then replicates the data over all the Matrix servers participating in this ‘room’. This data is signed using a git-style signature to mitigate tampering, and the federated traffic is encrypted with HTTPS and signed with each server's private key to avoid spoofing. Replication follows eventual consistency semantics, allowing servers to function even if offline or after data-loss by re-synchronizing missing history from other participating servers.

The Olm library provides for optional end-to-end encryption on a room-by-room basis via a Double Ratchet Algorithm implementation.[1] It can ensure that conversation data at rest is only readable by the room participants. With it configured, data transmitted over Matrix is only visible as ciphertext to the Matrix servers, and can be decrypted only by authorized participants in the room. The encryption protocol is called Olm; Megolm is an expansion of Olm to better suit the need for bigger rooms. There are two main implementations:

  • vodozemac, the current reference implementation, written in Rust. In 2022, it has been audited by Least Authority, whose findings are publicly available[45] and have been addressed by the Matrix team.[46] The review was partially funded by Germany's national agency for the healthcare system digitalisation (Gematik [de]).
  • libolm, the former reference implementation, has been subject of a cryptographic review by NCC Group, whose findings are publicly available,[47] and have been addressed by the Matrix team.[48] The review was sponsored by the Open Technology Fund.

Bridges[edit]

Matrix supports bridging messages from different chat applications into Matrix rooms. These bridges are programs that run on the server and communicate with the non-Matrix servers. Bridges can either be acting as puppets or relays, where in the former the individual user's account is visibly posting the messages, and in the latter a bot posts the messages for non-puppeteered user accounts.

Currently there are official bridges for:

Bridges for the following notable applications are maintained by the community:

Clients[edit]

Element is the reference implementation of a client. The following client implementations exist; a possibly more complete list can be found on Matrix's website:

Client Implementations
Project Main Language Comment Platforms Status Repository
Cinny JavaScript Focuses primarily on having a simple and secure interface; written in React on the top of matrix-js-sdk Web and desktop Stable GitHub: ajbura/cinny
Element JavaScript Made by the matrix.org core team Web, desktop, iOS, and Android Stable GitHub: vector-im/element-web
FluffyChat Dart Written in Flutter Web, desktop, iOS, and Android Stable GitHub: krille-chan/fluffychat
Fractal Rust GNOME desktop Stable GitLab: GNOME/fractal
NeoChat C++ Fork of Spectral, using KDE frameworks, most notably Kirigami,

KConfig and KI18n

Desktop, Plasma Mobile, and Android Stable Kde: network/neochat
Nheko C++ made using Qt and C++17 Desktop (Linux, macOS, Windows and others[60]) Stable GitHub: Nheko-Reborn/nheko
Quaternion C++ cross-platform Qt5-based client, a reference desktop application using Quotient Desktop (macOS, Windows, Linux and others[61]) Stable GitHub: quotient-im/Quaternion

Servers[edit]

Synapse is the reference implementation of a Matrix home server, written in Python.[62] A "second generation Matrix home server"[63] called Dendrite is being developed by the Matrix core team. Dendrite is in beta.

The following server implementations exist; a possibly more complete list can be found on Matrix's website:

Server Implementations
Project Main Language Comment Status Repository
Synapse[62] Python Synapse is a Matrix "homeserver" implementation developed by the matrix.org core team, written in Python 3/Twisted. Production ready GitHub: element-hq/synapse
Dendrite Go Dendrite is a second-generation Matrix homeserver written in Go. It intends to provide an efficient, reliable and scalable alternative to Synapse. Beta GitHub: matrix-org/dendrite
Construct[64] C++ Construct is a performance-oriented homeserver with minimal dependencies.

It is the first actively federating Matrix server developed independently by the community.

Beta (since 2020-04-28)[65] GitHub: matrix-construct/construct
Conduit[66] Rust An efficient Matrix homeserver that aims to be easy to set up and just work.

It is designed to run on low-powered mini computers such as a Raspberry Pi to host for a user's "friends, family, or company."

Beta (since 2021-09-01) GitLab: famedly/conduit
Mascarene[67] Scala Mascarene is an open source homeserver implementation of the Matrix protocol. Under development GitLab: mascarene/mascarene
Ligase Go Ligase is a Golang-based implementation of Matrix home server, following the Matrix spec as defined at matrix.org.

It has been used in production by an array of financial institutions in various scenarios.[non-primary source needed]

Appears to be dead (no commit since Sep 22, 2021) GitHub: finogeeks/Ligase
Maelstrom Rust A high-performance Matrix Home-Server written in Rust designed to have a plugable storage engine, scalable, and light on resources. Appears to be dead. No commit since 2020 GitHub: maelstrom-rs/maelstrom

Adoption[edit]

Communication among the public agents of France's central administration happens on a Matrix-based internal network, named Tchap [fr]. [68] The project is developed by the Interministerial Directorate for Digital Affairs (DINUM [fr]) with the explicit goals of security and digital sovereignty, both of which were deemed to be impossible through WhatsApp, Telegram and Slack. [69]

Germany's national healthcare system's internal communication network uses a Matrix-based [70] system (Ti-Messenger) for real-time communication among Germany's healthcare organizations and sharing of sensitive patient data, and is developed by the national agency for the digitalisation of the healthcare system (Gematik [de] GmbH). [71] Reasons for choosing Matrix included federated identity management, which allows to reuse the existing identity infrastructure into the new chat system; the decentralized architecture, which allows cross-linking data from disparate sources; and the open protocol, which ensures interoperability and future-proof data exchange and prevents vendor lock-in. [72]

Employees of the Bundeswehr (Germany's armed forces) communicate with each other, and share classified documents (German VS-NfD), on a private Matrix network, with a customized version of the Matrix Element app. [73] [74]

Luxembourg has developed a Matrix-based chat service for government officials, named Luxchat4Gov, planned to be released in the second quartal of 2023. [75]

The Swedish Social Insurance Agency (Försäkringskassan) is using Matrix for internal communications. [76]

Rocket.chat is based on Matrix since version 4.7.0.[77] It is used in private networks of public governmental offices, private companies and NGOs, across the world.[78]

The FOSDEM was held on Matrix in 2021[79] and 2022.[80][81] The hosting was provided by Element Matrix Services, which published the technical details for public review soon after the event for 2021 [82] and 2022.[83]

See also[edit]

References[edit]

  1. ^ a b Ermoshina, Ksenia; Musiani, Francesca; Halpin, Harry (September 2016). "End-to-End Encrypted Messaging Protocols: An Overview". In Bagnoli, Franco; et al. (eds.). Internet Science. INSCI 2016. Lecture Notes in Computer Science. Vol. 9934. Florence, Italy: Springer. pp. 244–254. doi:10.1007/978-3-319-45982-0_22. ISBN 978-3-319-45982-0.
  2. ^ "What Is the Matrix Protocol and How Does It Work?". MUO. 2021-10-27. Retrieved 2023-07-24.
  3. ^ a b Nathan Willis (2015-02-11). "Matrix: a new specification for federated realtime chat". LWN.net. Retrieved 2015-06-28.
  4. ^ Adrian Bridgwater (2014-09-09). "Matrix.org Reloads Inside "Illusion of Control" Vortex". Dr. Dobb's Journal. Retrieved 2015-07-20.
  5. ^ "Unified Communications". amdocs. Archived from the original on 2014-10-03. Retrieved 2018-11-04.
  6. ^ "Who is Matrix.org?". matrix.org. 2019-02-20. Archived from the original on 2019-03-29. Retrieved 2018-10-20.[self-published source]
  7. ^ "Award Winners of the WebRTC 2014 Conference & Expo". Upperside Blog. 2014-12-23. Archived from the original on 2015-03-15. Retrieved 2015-06-28.
  8. ^ Phil Edholm (2015-05-18). "WebRTC World Miami Wrap Up and Review". WebRTC. Retrieved 2015-06-28.
  9. ^ Andrew Prokop (2015-02-23). "Solving the WebRTC Interoperability Problem - Post". No Jitter. Retrieved 2015-06-28.
  10. ^ Ian Scales (2015-05-11). "To interop or not to interop? Is Matrix.org the answer for silo'd comms services?". TelecomTV. Retrieved 2015-06-22.
  11. ^ Matt Weinberger (2014-09-16). "Matrix wants to smash the walled gardens of messaging". ITworld. Retrieved 2015-07-20.
  12. ^ "Linkedin entry for Vector Creations Limited". Retrieved 2018-10-22.[self-published source]
  13. ^ "Free company information from Companies House (UK Government)". Companies House. Retrieved 2018-07-30.
  14. ^ "New Vector - We believe the future will be open and decentralized". New Vector. Retrieved 2018-10-20.[self-published source]
  15. ^ "A Call to Arms: Supporting Matrix!". matrix.org. 2017-07-07. Retrieved 2018-10-20.[self-published source]
  16. ^ "Hello world! | Matrix.org on Patreon". Patreon. Retrieved 2018-11-04.[self-published source]
  17. ^ Matrixdotorg (2017-07-21), Matrix Live - Episode 1: July 14th 2017, retrieved 2018-10-22[self-published source]
  18. ^ "This Week in Matrix". matrix.org. Retrieved 2023-07-26.[self-published source]
  19. ^ "Element Secure instant messenger | Riot.im download | End-to-end messages encryption and open network". Element. Retrieved 2020-11-01.
  20. ^ "Awesome hosting for Matrix". www.modular.im. Retrieved 2018-10-20.[self-published source]
  21. ^ Armasu, Lucian (2018-06-06). "Purism's Privacy-Focused Librem 5 Smartphone's On Track For A Jan '19 Release". Tom's Hardware. Retrieved 2018-11-04.
  22. ^ "Librem 5 – A Security and Privacy Focused Phone". shop.puri.sm. Retrieved 2018-11-04.[self-published source]
  23. ^ https://blogs.kde.org/2017/09/05/konversation-2x-2018-new-user-interface-matrix-support-mobile-version[self-published source]
  24. ^ Rogers, Stewart (2018-01-29). "Status invests $5 million in Matrix to create a blockchain messaging superpower". VentureBeat. Retrieved 2018-10-20.
  25. ^ "Status Invests $5M In Riot.im". Status Blog. 2018-01-29. Archived from the original on 2018-01-30. Retrieved 2018-10-20.[self-published source]
  26. ^ Rosemain, Mathieu. "France builds WhatsApp rival due to surveillance risk". U.S. Retrieved 2018-11-04.
  27. ^ Kaminsky, Jean (2018-04-22). "L'Etat lance un "Telegram" à la française cet été, ouvert à tous". Solutions Numériques (in French). Retrieved 2019-12-28. Après 3 mois de développement pour un coût très limité [...]
  28. ^ Cimpanu, Catalin. "French government releases in-house IM app to replace WhatsApp and Telegram use". ZDNet. Retrieved 2019-12-28.
  29. ^ "THE MATRIX.ORG FOUNDATION – Overview (free company information from Companies House)". Companies House. Retrieved 2018-11-04.
  30. ^ "Introducing the Matrix.org Foundation (Part 1 of 2)". matrix.org. 2018-10-29. Retrieved 2018-11-04.[self-published source]
  31. ^ Michael Larabel (2019-02-20). "KDE To Support Matrix Decentralized Instant Messaging". Phoronix. Retrieved 2019-02-20.
  32. ^ "We have discovered and addressed a security breach". Matrix.org. Retrieved 2019-04-12.[self-published source]
  33. ^ "Introducing Matrix 1.0 and the Matrix.org Foundation". Matrix blog.
  34. ^ "Synapse 1.0.0 released". Matrix blog.
  35. ^ "New Vector scores $8.5M to plug more users into its open, decentralized messaging Matrix". TechCrunch. 10 October 2019. Retrieved 2019-12-18.[permanent dead link]
  36. ^ online, heise (24 December 2019). "Open Source: Bundeswehr baut eigene verschlüsselte Messenger-App". heise online (in German). Retrieved 2019-12-28.
  37. ^ "Synchronous Messaging at Mozilla: The Decision". 19 December 2019.
  38. ^ "Moznet IRC is dead; long live Mozilla Matrix!". Matrix blog. Retrieved 2020-10-31.
  39. ^ "Cross-signing and End-to-end Encryption by Default is HERE!!!". Matrix blog.
  40. ^ "Gitter is joining Element". Element Blog. 2020-09-30. Retrieved 2020-11-01.
  41. ^ "Welcoming Gitter to Matrix!". Matrix blog. Retrieved 2020-11-01.
  42. ^ "FOSDEM 2021: Building massive virtual communities in Matrix". YouTube. Retrieved 31 March 2021.
  43. ^ a b c "Upgrade now to address E2EE vulnerabilities in matrix-js-sdk, matrix-ios-sdk and matrix-android-sdk2".
  44. ^ https://matrix.org/blog/2023/06/beeper-joins-the-foundation/. {{cite web}}: Missing or empty |title= (help)
  45. ^ "Archived copy" (PDF). leastauthority.com. Archived from the original (PDF) on 16 May 2022. Retrieved 22 May 2022.{{cite web}}: CS1 maint: archived copy as title (link)
  46. ^ "Independent public audit of Vodozemac, a native Rust reference implementation of Matrix end-to-end encryption". Matrix blog.
  47. ^ Alex Balducci; Jake Meredith (18 November 2016). "Matrix Olm Cryptographic Review". www.nccgroup.trust. Archived from the original on 2018-10-20. Retrieved 2018-10-20.
  48. ^ "Matrix's 'Olm' End-to-end Encryption security assessment released – and implemented cross-platform on Riot at last!". matrix.org. 2016-11-21. Retrieved 2018-10-20.[self-published source]
  49. ^ "matrix-org/matrix-appservice-gitter". GitHub. 2018-09-27. Retrieved 2018-10-20.[self-published source]
  50. ^ "matrix-org/matrix-appservice-irc". GitHub. Retrieved 2018-10-20.[self-published source]
  51. ^ "matrix-org/matrix-appservice-slack". GitHub. Retrieved 2018-10-20.[self-published source]
  52. ^ GitHub - matrix-org/matrix-appservice-purple: General purpose bridging using libpurple ., matrix.org, 2018-12-29, retrieved 2018-12-31[self-published source]
  53. ^ "Half-Shot/matrix-appservice-discord". GitHub. Retrieved 2018-10-20.[self-published source]
  54. ^ "tulir/mautrix-facebook". GitHub. Retrieved 2020-04-27.[self-published source]
  55. ^ A Matrix-Signal puppeting bridge, Tulir Asokan, 2021-02-06, retrieved 2021-02-06[self-published source]
  56. ^ skype-bridge, matrix.org, 2020-05-16, retrieved 2020-05-16[self-published source]
  57. ^ "tulir/mautrix-telegram". GitHub. Retrieved 2018-10-20.[self-published source]
  58. ^ "tulir/mautrix-whatsapp". GitHub. Retrieved 2018-10-20.[self-published source]
  59. ^ "beeper/linkedin". GitLab. Retrieved 2022-07-03.[self-published source]
  60. ^ "nheko-reborn.github.io". nheko-reborn.github.io. Retrieved 2022-12-29.
  61. ^ "GitHub: quotient-im/Quaternion". GitHub.
  62. ^ a b "matrix-org/synapse". GitHub. Retrieved 2020-04-27.[self-published source]
  63. ^ "matrix-org/dendrite". GitHub. Retrieved 2020-04-27.[self-published source]
  64. ^ "matrix-construct/construct". GitHub. Retrieved 2020-04-27.[self-published source]
  65. ^ "About the server · matrix-construct/construct Wiki". GitHub. Retrieved 2021-12-28. Entered beta-testing stage around 2020-04-28.
  66. ^ "Famedly / Conduit". GitLab. Retrieved 2020-11-01.
  67. ^ "mascarene/mascarene". Gitlab. Retrieved 2020-04-27.[self-published source]
  68. ^ "French government launches in-house developed messaging". European Commission.
  69. ^ "Open Source Software powering the newly developed internal messaging service of the French government". European Commission. 18 October 2019.
  70. ^ "TI-Messenger | gematik". www.gematik.de.
  71. ^ "Germany's national healthcare system adopts Matrix!". Matrix blog.
  72. ^ "German health professionals will communicate with each other through the open source Matrix protocol". 6 August 2021.
  73. ^ "Bundeswehr | BwMessenger | Matrix | Defence case study".
  74. ^ "German armed forces testing open source chat". 16 January 2020.
  75. ^ "Luxembourg launches open source chat for officials and citizens". 16 February 2023.
  76. ^ "dSam and eSam endorse Matrix for secure and federated communications in the Swedish public sector". December 2022.
  77. ^ "Welcoming Rocket.Chat to Matrix!".
  78. ^ "Organizations which choose Rocket.Chat".
  79. ^ "Troubleshooting Matrix at FOSDEM 2021".
  80. ^ "FOSDEM 2022's communication infrastructure was provided by Element Matrix Services". Element Blog. 2022-02-14. Retrieved 2023-01-25.
  81. ^ "Troubleshooting Matrix at FOSDEM 2022".
  82. ^ "How we hosted FOSDEM 2021 on Matrix".
  83. ^ "Hosting FOSDEM 2022 on Matrix".

External links[edit]