ecosistema-social-decentral.../protocols/matrix.md

84 lines
5.5 KiB
Markdown
Raw Normal View History

2020-02-25 09:17:09 +01:00
# Matrix
Matrix is a protocol for replicating a signed history of JSON objects in realtime across a set of nodes with (optional) end-to-end encryption.
2020-06-10 00:07:14 +02:00
Matrix is designed to support multiple communication cases - Chat, VoIP, IoT, VR/AR, Social etc, but so far effort has been concentrated on providing a federated chat experience with good UX at scale.
2020-06-02 20:17:38 +02:00
### Data Storage/Message Persistance
Matrix messages are stored in per-conversation Merkle DAG data structures, and conversations are replicated across all participating servers. Matrix is architecturally most similar to Git.
### Network Structure
Matrix has a federated and a p2p version.
2020-06-10 00:07:14 +02:00
#### Federated
2020-06-02 20:17:38 +02:00
2020-06-10 02:01:39 +02:00
In the federated version of Matrix, all messages are currently sent out full-mesh within a conversation. A node broadcasts in parallel to every other node present in the room. Experimental work on stochastic spanning tree "fan-out" approaches to improve efficiency are being researched.
2020-06-02 20:17:38 +02:00
2020-06-10 05:43:45 +02:00
30% of publicly visible users are on the matrix.org homeserver. There are many smaller servers as well.
2020-06-02 20:17:38 +02:00
2020-06-10 00:07:14 +02:00
#### P2p
2020-06-02 20:17:38 +02:00
2020-06-10 02:01:39 +02:00
Matrix has released a p2p version that runs client-side. P2p Matrix avoids the problem of homeservers accumulating metadata, and simplifies signup by not requiring new users to pick a homeserver. The new p2p implementation runs the homeserver on the client. The p2p network is currently separate from the federated network, but the end goal is to connect the two in a hybrid federated/p2p model. Network transports being considered for p2p Matrix include libp2p, Yggdrasil, or hyperswarm.
2020-06-02 20:17:38 +02:00
2020-06-10 02:01:39 +02:00
https://matrix.org/blog/2020/06/02/introducing-p-2-p-matrix
2020-05-18 02:29:35 +02:00
### Identity
2020-06-10 02:01:39 +02:00
Matrix has a more flexible identity solution than many decentralized protocols - users have a Matrix user ID, but can also use 3rd party IDs.
2020-06-10 02:01:39 +02:00
A matrix user ID includes the username along with the user's homeserver. For example:
2020-05-18 02:29:35 +02:00
2020-06-02 20:17:38 +02:00
`@bob:matrix.org`
2020-06-10 02:01:39 +02:00
As for 3rd party IDs, a Matrix account can link to IDs such as email addresses, social accounts, and phone numbers. A globally federated cluster of trusted identity servers verify and replicate the mappings, although this is considered a stopgap solution until a fully decentralized identity solution is adopted.
User IDs used in conversations will soon be decoupled from permanent IDs, allowing one to decorrelate users from their messages.
2020-05-18 02:29:35 +02:00
### Moderation/Reputation
2020-06-02 20:17:38 +02:00
The Matrix team has been working intensively on tools for moderation, detailed [here](https://matrix.org/docs/guides/moderation/).
Most moderation takes place at the room level. Rooms have moderators who can remove undesirable content. A redaction, or 'remove message', can request all participating servers to remove a message. Users can also remove their own messages. However, due to the decentralized nature of Matrix, if the client does not remove the redaction, the message will not be removed. Moderators can kick or ban users from rooms. They can also ban servers from rooms, in cases where malicious traffic must be avoided.
Users in a room have 'power levels', a number between 0 and 100 that indicates how much power the user has in the room. A higher level has more permissions. Moderators have ability to change power level permissions. Users can report abusive content to the server admin, which has the ability to remove it. Users can also block other users to prevent them from contacting them.
2020-05-18 02:29:35 +02:00
### Social/Discovery
2020-06-10 02:01:39 +02:00
All conversations on Matrix take place through rooms, which people either join (if public), peek into (if viewable), or are invited to.
2020-06-02 20:17:38 +02:00
2020-06-10 02:01:39 +02:00
Features supporting more advanced social functionality are being developed, such as this proposal for tracking events related to existing events:
2020-06-02 20:17:38 +02:00
[Proposal for Aggregation via Relations](https://github.com/matrix-org/matrix-doc/blob/matthew/msc1849/proposals/1849-aggregations.md)
2020-05-18 02:29:35 +02:00
### Privacy and Access Control
2020-06-10 02:01:39 +02:00
Matrix homeservers have access to metadata about conversations, because the homeservers of all users in a given conversation have to store that conversation's metadata. P2p Matrix mitigates this privacy issue.
2020-06-02 20:17:38 +02:00
Matrix recently introduced end-to-end encryption by default for private messages. This was on the roadmap since the beginning, because conversations are replicated over every server participating in a room, and there is no guarantee against servers looking into conversations.
[olm e2e encryption](https://matrix.org/blog/2016/11/21/matrixs-olm-end-to-end-encryption-security-assessment-released-and-implemented-cross-platform-on-riot-at-last)
[encryption for private messages](https://matrix.org/blog/2020/05/06/cross-signing-and-end-to-end-encryption-by-default-is-here)
2020-05-18 02:29:35 +02:00
2020-06-02 20:17:38 +02:00
### Monetization and Governance
2020-05-18 02:29:35 +02:00
2020-06-02 20:17:38 +02:00
Matrix is governed by [The Matrix.org Foundation CIC](https://matrix.org/foundation) (a UK non-profit foundation), with the largest contributor being [New Vector](https://vector.im), a startup formed by the original Matrix dev team, which raised $8.5M series A in October 2019. Income primarily comes from contracts with governments and large clients.
2020-05-18 02:29:35 +02:00
### Interop with other systems
2020-06-02 20:17:38 +02:00
Matrix can be bridged with IRC, Slack, Discord, Telegram and others.
2020-05-18 02:29:35 +02:00
2020-06-10 00:07:14 +02:00
### Applications
2020-06-10 02:01:39 +02:00
The public network currently (Feb 2020) has 17.9M known addressable users (as of June 2020), with more in private federations or on servers which don't report stats.
2020-06-10 00:07:14 +02:00
Matrix supports multiple clients (most notably [Riot](https://riot.im), the flagship app from the core team), and has bridges to many other chat systems (IRC, Slack, Discord, Telegram etc).
2020-05-18 02:29:35 +02:00
### Scalability
2020-06-02 20:17:38 +02:00
Scalability study: https://arxiv.org/pdf/1910.06295.pdf
2020-05-18 02:29:35 +02:00
### Links
2020-06-02 20:17:38 +02:00
[matrix.org](https://matrix.org/)