A lightweight, embedded homeserver written in Rust.
  • Rust 99.7%
  • Go 0.1%
  • Dockerfile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kegan Dougal 13b677b8f9
Merge pull request #177 from JadedBlueEyes/jade/backgrounding
fix: Prevent cancellation of room creation by clients
2026-11-10 09:23:59 +01:00
.cargo build(xtask): add cargo xtask CLI (compile/publish/complement) 2026-06-03 14:30:57 +01:00
.claude/skills Significantly redo docs and comments 2026-10-27 11:15:20 +00:00
.github Remove android build tooling 2026-07-22 15:56:20 +01:00
complement Significantly redo docs and comments 2026-10-27 11:15:20 +00:00
crates Merge pull request #177 from JadedBlueEyes/jade/backgrounding 2026-11-10 09:23:59 +01:00
docker/complement Review comments 2026-10-26 13:47:20 +00:00
mscs Significantly redo docs and comments 2026-10-27 11:15:20 +00:00
tools Increase database persistence level to fsync on commit 2026-11-05 15:46:21 +00:00
vendor Bound the group response delay and send group requests NON 2026-11-04 15:23:51 +00:00
.dockerignore Initial commit 2026-05-11 14:52:18 +01:00
.gitignore Initial commit 2026-05-11 14:52:18 +01:00
ARCHITECTURE.md Add group support to CoAP requests 2026-11-04 14:56:59 +00:00
Cargo.lock Report notifiable events to the host over FFI 2026-11-09 13:19:41 +00:00
Cargo.toml Remove async-compat, we don't use it anymore 2026-07-22 11:36:13 +01:00
CLAUDE.md Significantly redo docs and comments 2026-10-27 11:15:20 +00:00
LICENSE-AGPL-3.0 add licenses 2026-07-08 15:26:02 +02:00
README.md Significantly redo docs and comments 2026-10-27 11:15:20 +00:00

Neutrino

Neutrino is an experimental lightweight embedded Matrix homeserver written in Rust.

We're releasing the code at a very early stage for transparency, and it comes with some serious caveats:

  1. Neutrino has been written specifically to experiment with P2P Matrix dialects.
  2. It is not intended to run as a standalone homeserver.
    • Instead, it's runnable from the P2P branch of Element X Android, embedded within the Android app.
  3. It is very deliberately NOT SECURE for use on the public internet.
    • Again, please DO NOT USE NEUTRINO ON UNTRUSTED NETWORKS (e.g. the internet) yet.
    • Events are unsigned and unverified by default; signing is opt-in (NEUTRINO_TRUSTED_NETWORK=0).
  4. It does not speak or interoperate with normal Matrix yet.
  5. It is deliberately very feature poor; it only supports room membership (join/leave/invite/kick/ban) and sending messages.
    • It has no E2EE, or file transfer, or typing notifications, or read receipts, etc. etc.
  6. It is deliberately not at all optimised yet - e.g. it has no caching.
  7. It only implements the very latest room versions (Hydra Phase 2 and (in future) 3 - e.g. State DAGs: MSC4242)
  8. Gives us somewhere to evaluate Hydra and state resets in the harshest conditions (i.e. P2P)

Separately, it's worth noting that:

  • Neutrino is not the future of Synapse or Synapse Pro, although we expect Neutrino and Synapse to share Rust code in future
  • This not a re-run of Dendrite (which was built as a horizontally scalable successor to Synapse, but in the end its learnings got subsumed into Synapse and Synapse Pro)
  • Instead, we want a dedicated embeddable minimal homeserver for P2P, rather than forcing a serverside homeserver to run clientside
  • We also want somewhere to experiment freely with new ideas (e.g. temporal state storage) which can get backported and/or shared with Synapse & Synapse Pro.
  • Neutrino development has been accelerated significantly via use of Claude Opus and Fable. We are very mindful of the ethical and environmental aspects of using LLMs, but have concluded that using big tech to accelerate decentralisation of communication is net positive in this instance.

Overview

See ARCHITECTURE.md for how the crates fit together.

Neutrino makes use of the xtask pattern for the developer tasks that don't fit a plain cargo invocation; run cargo xtask --help for the command reference.

Building

Prerequisites

To build Neutrino you'll need a working Rust toolchain.

Development

You can run the homeserver locally during development to test against arbitrary clients:

$ cargo run --bin neutrino

By default, this starts the server on http://localhost:8008.

You can also reverse-proxy the development server into an Android emulator running the mainline element-x-android:

$ adb reverse tcp:8008 tcp:8008

You can then use the same URL as above as the homeserver URL when logging in.

Embedding

Neutrino is embedded in Element X Android as a pre-built UniFFI binding artifact (.aar), rather than built from Rust source by the app. That artifact is produced and published by the neutrino-iroh repository, which composes this workspace over its iroh/BLE federation medium and ships a single .aar carrying the whole embedded API. Binding generation, ABI builds, Maven publishing, and the tag-triggered release workflow all live there — see that repository's README for the build and release process.

License

Neutrino is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). For discussion around alternative licensing please contact licensing@element.io