# IXO Matrix

> What IXO Matrix is: encrypted, federated rooms where people, services and agents share messages, files and live documents attached to IXO records.

IXO Matrix is the encrypted messaging and data layer of IXO. It gives each domain a Matrix space
with rooms, where people, services and agents share messages, files and live documents. Rooms are
end-to-end encrypted, and only their members can read them. That includes the operators of the
service.

Read this page to understand what goes in a room and what does not, and how shared documents stay
in step when several people and agents edit them at once. For setup, use the
[IXO Matrix Client SDK](/sdk-reference/matrix-client-sdk).

## What IXO Matrix is for

| Use | What happens in the room |
| --- | --- |
| Data rooms | Partners exchange evidence and files under explicit membership and permissions |
| Review | Reviewers discuss a claim's evidence in a private room |
| Messaging | People, apps and services send each other events |
| Workflow state | Room events and bots move a workflow forward |
| Per-user storage | An agentic oracle keeps each user's conversation in that user's own encrypted room |

The chain holds what several parties must check without trusting each other. Most working
material, such as evidence files, messages, review discussions and shared documents, lives in
rooms, and the chain holds only their hashes. A room holds the discussion. It does not hold the
rubric or the decision. See [How the pieces fit](/the-stack).

## How it works

- **Federated.** IXO Matrix uses the [Matrix](https://matrix.org) protocol. Participants exchange
  events across trusted homeservers, and each room keeps its own access controls.
- **Encrypted.** Rooms are end-to-end encrypted.
- **Tied to records.** A domain's Matrix space has sub-spaces and rooms. A room can be attached to a
  programme, a project, a domain, a claim or a Flow, so the discussion stays with the record it is
  about.
- **History.** Each room keeps its event history.

## Live shared documents

Some rooms hold a document that several people and agents edit at the same time. IXO keeps that
document's state inside the Matrix room as a CRDT (a conflict-free replicated data type), using
Yjs to synchronise it.

The room carries the membership, access control, event history and encryption. Yjs holds the
document. Everyone, human or agent, edits the same state:

- concurrent changes merge automatically, without locking
- edits made offline are reconciled when the editor reconnects
- an agent works on the same document as people, not on a copy it sends back

IXO uses this for documents, Flow pages, specifications and policies that keep changing
while several parties work on them.
See [Qi](/articles/qi-intelligent-cooperating-system).

## Build with it

| Package | Use it for |
| --- | --- |
| IXO Matrix Client SDK (`@ixo/matrixclient-sdk`) | Matrix-specific operations: rooms, membership and events |
| IXO MultiClient SDK (`@ixo/impactxclient-sdk`) | Applications that work with the chain and with Matrix |
| Matrix state bot | Automated, rule-driven updates to room state. See the [Matrix state bot API](/api-reference/matrix-state-bot-api) |

## Where to go next

<CardGroup cols={2}>
  <Card title="IXO Matrix Client SDK" icon="code" href="/sdk-reference/matrix-client-sdk">
    Packages, setup and calls for working with rooms.
  </Card>
  <Card title="Matrix state bot API" icon="server" href="/api-reference/matrix-state-bot-api">
    The endpoints for automated room state.
  </Card>
  <Card title="Design a POD" icon="building-columns" href="/guides/users/build-a-pod">
    Plan the rooms a Qi workspace needs.
  </Card>
  <Card title="How the pieces fit" icon="layer-group" href="/the-stack">
    What is on chain, what is in rooms, and who runs what.
  </Card>
</CardGroup>
