Matrix and Solid: a design sketch
There is no Matrix↔Solid bridge, bot or library. This page sketches what an integration could look like. Nothing here is installable, and nothing here is a standard.
Solid stores personal data in "pods" under the user's control and identifies people by WebID, a URL that resolves to an RDF profile. Logins use Solid-OIDC. Standardisation continues in the W3C Linked Web Storage Working Group.
1. Linking a Matrix account to a WebID
From WebID to Matrix. The FOAF idiom for "this person has an account" is foaf:account (foaf:holdsAccount is its deprecated old name). Don't use owl:sameAs, which would claim the person is the account. The account can be named with a matrix: URI, which has been in the spec since v1.2:
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#me> foaf:account <matrix:u/alice:example.org> .
<matrix:u/alice:example.org> a foaf:OnlineAccount ;
foaf:accountName "@alice:example.org" .
From Matrix to WebID. Since spec v1.16, users can set custom profile fields (MSC4133). A client could store a WebID under a namespaced key it controls, such as org.example.webid; that key name is only an example. A verifier would trust the link only when both sides point at each other.
2. Archiving a room to a pod
A bot in the room could write messages to a pod. To be readable in SolidOS, it should follow the layout the SolidOS chat code uses (solid-ui/src/chat/chatLogic.js):
- the channel is
index.ttl#this, typedmeeting:LongChat(a class used by the SolidOS code, not defined in the published meeting ontology); - messages go in
YYYY/MM/DD/chat.ttl; - the channel links each message with
wf:message(http://www.w3.org/2005/01/wf/flow#); - a message has
sioc:content,dct:createdandfoaf:maker; - edits use
dct:isReplacedBy, and deletions useschema:dateDeleted.
@prefix wf: <http://www.w3.org/2005/01/wf/flow#> .
@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<../../../index.ttl#this> wf:message <#msg1> .
<#msg1> sioc:content "Hello from Matrix" ;
dct:created "2026-10-18T09:30:00Z"^^xsd:dateTime ;
foaf:maker <https://alice.example/profile/card#me> .
Open problems: many senders have no WebID; Matrix redactions would need to reach the archive; and media needs authenticated download (spec v1.11) before it can be copied.
3. Consent and privacy
Archiving your own messages is your choice. Archiving other people's messages is not:
- Ask first. People in a Matrix room did not agree to have their messages copied to a third-party store. Announce the bot, explain where the data goes, and only archive rooms where members have agreed, or archive only the messages of users who opt in.
- Keep it private. Write the archive to a private container with access control. Never put other people's messages in a public folder.
- Encrypted rooms. To archive an encrypted room, the bot must be a member that decrypts every message. That defeats what members expected from end-to-end encryption, so don't do it without explicit agreement.
- Honour deletions. When a Matrix message is redacted, delete it from the archive too. Under laws such as the GDPR, people may also ask you to remove their data.
- Mind the law. Storing other people's personal data can make you a data controller, with legal duties that depend on where you and they are.