First release of Matrix Federated Network Peer-to-Peer Client

Experimental client released Riot P2P.


Riot - originally a client for a federated network Matrix. P2P modification adds server implementation and federation to the client without using a centralized DNS through integration libp2p, which is also used in IPFS. This is the first version of the client that saves the session after a page reload, but in the next major updates (for example, 0.2.0) the data will still be deleted. Therefore, using the client for something important is not recommended.

The client implements federation, creating rooms and displaying a global (serverless!) catalog of rooms.

At the same time, the main Matrix network using DNS and the Matrix network on libp2p cannot yet be federated and interact with each other.

To use the client, just click the login button, after which you will receive a generated ID on the network. Data export is not yet supported.

Since this is an unstable presentation of a possible concept, you may run into trouble:

  • You will not be able to log into your account or interact with other clients if the server running as a Service Worker is killed by the browser after a timeout. Such a problem seen on Firefox, which does so after 30 seconds of inactivity].
  • At the libp2p network level, there are limits on the number of actions performed over time, which can cause problems with federation.

The start of work on the P2P version of Matrix is ​​due to the desire of developers to give more freedom to their users. Decoupling from the central server allows you to facilitate communication within local and mesh networks, and in general, in conditions where access to the external network is limited or absent. It also has a positive effect on privacy, due to the minimization of the transmitted metadata, which in such a scenario is stored only by the participants in the correspondence. Ultimately, this leads to thinking about refactoring current Matrix concepts to achieve greater portability and security.

The implementation of the server API is achieved by compiling the server dendrite into WebAssembly code that runs simultaneously with the client as a Service Worker using IndexedDB and SQLite to store data locally, in the case of the web version and the Electron wrapper.
Dendrite is a Go "second-generation" Matrix server in development, focused on complete modularity, which can also be used in a monolithic form. In a modular form, Apache Kafka is used to interact with microservices, and in a monolithic one - Naffka. Documentation for building the P2P version of Dendrite can be found on GitHub.

Dendrite was originally conceived as a general purpose server intended to be a direct replacement for Synapse, written in Python, which has performance and scalability issues. But due to the need for support and serious refactoring of Synapse, the development of Dendrite faded into the background. In the end, development resumed, but the existing codebase was decided not to be developed in a general purpose context, but to focus on adaptation for embedding in portable and low-power client devices such as browsers and phones.

The current implementation of Dendrite is still at an early stage of development, but this is enough for a simple federation:

Client-Server APIs: 34% (227/672 tests) - up from 33%
Federation APIs: 34% (35/103 tests) - up from 27%

This is not the first attempt to implement P2P. Previously, there was an initiative to create CoAP proxy to Yggdrasil network for Synapse.


The developers of the Matrix protocol do not focus on federation alone and experiment with tools for even greater decentralization. For example, an experiment was carried out to reduce costs at the transport layer. Demon evolves pantalaimon - a proxy that any client without encryption support can connect to and interact with encrypted messages. All the initiatives taken are aimed at ensuring that in the future get rid of the binding of the login to the server, by abolishing the MXID by interacting with the network using a public key, which is already partially implemented in Riot P2P.


You can find more detailed information on the concepts of planned implementations at in the FOSDEM 2020 presentation on YouTube ΠΈ recent blog post.

There is also an Android version of Riot P2P based on the old app code. In the future, it is planned to transfer it to the current RiotX.

Moreover

  • Project presented TARDIS (Time Agnostic Room DAG Inspection Service) is a line event graph (DAG) debugger for Matrix rooms based on Riot P2P.

  • In project Conduit (a community-developed server in Rust) is now implemented encryption and attachments.

  • There was an experimental server on Scala - Mascarene.

Source: linux.org.ru

Add a comment