Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mousse-net: the open networking engine for Mousse

mousse-net

The open networking engine for Mousse.

CI License: MIT

mousse-net is the Rust engine behind Bridge, which lets you work with agents on your other computers from Mousse. The engine handles device identity, pairing, host grants, encrypted sessions and routing.

Devices can pair in person with a QR code or remotely with a Send link and a six-digit code (CPace). Sessions use TLS 1.3 with short-lived certificates signed by each device and hybrid post-quantum key exchange on native targets. Computers that support protocol minor 3 can make calls in both directions over one connection, subject to each computer's grant.

Pairing grants one direction. The other direction can be asked for later over the same connection, with no new code. The host picks the grant's access level (role) when it approves, can change it later, and can end the peer's access while keeping its own access to the peer.

Each code carries one way to reach the host: same Wi-Fi, Tailscale, a port forward, a tunnel or a relay. The helper reports which ways are ready. Before joining, the other device can see whether a link can work from where it is, and check that the host answers without pairing anything.

Connections can use the local network, your own routes (such as Tailscale, SSH, a port forward or a tunnel), or a relay. When a relay route is configured, the helper tries it first while it checks whether a direct route can take over. Mousse can add a managed tunnel to new codes, or withdraw it, while the helper runs.

Status

  • Phases 0, 1a and 1b added the core, simulator, owner test kit, desktop pairing and user-provided routes. The engine is integrated into the Mousse desktop app.
  • Phases 3 and 4 added the self-hosted relay, headless daemon and the engine's side of Mousse Plus relay admission, leases and usage reporting. The relay has tooling for reproducible builds and minisign signing.
  • The pairing flow added one-way pairing, one chosen way per code, link checks, grant roles and ending one direction of a pairing. A relay-only link pairing also survives a crash right after it completes.
  • On the roadmap are native phone support (Phase 2), a browser client (Phase 5) and shared rosters (Phase 6).

Mousse builds fetch a pinned commit of this repository, compile mousse-helper from source and bundle the binary with the app. Pinned commit · Build script

What's here

Path What it is
crates/mousse-net-core State machines for identity, pairing (CPace), grants, session, mux, path choice, allow-sets and the relay protocol. No I/O; builds for wasm32.
crates/mousse-net-io tokio adapters: TLS sessions, TCP/SSH/WebSocket pipes, the session driver, keystores and mDNS discovery.
crates/mousse-sim Seeded, deterministic simulator for core and relay drills. Every drill replays from a seed.
crates/mousse-helper Desktop helper, CLI and headless server daemon: pairing, link checks, grants and roles, path switching and terminal channels.
crates/mousse-relay Self-hosted relay binary that joins authorized connections and forwards encrypted traffic.
crates/mousse-relay-plus Hosted relay side of Mousse Plus: pinned issuer keys, lease admission and usage reports.
crates/mousse-check Owner test kit. Its automated checks use controls that must fail.
spec/ The wire spec, CPace, relay spec, test vectors, threat model and privacy notes.
checks/ Check manifests for each phase and the pairing flow, device roster and signed results.
interop/ A second implementation written from the spec alone.
release/ Reproducible container build, OCI image, minisign signing and installer for mousse-relay.
tools/ Scripts the owner checks use to run the helper inside the Mousse app and to smoke-test release builds.
app/ The Mousse revision those app checks run against.
docs/ Phase plan, per-phase designs, the pairing flow design, limits, headless daemon guide and relay release guide.

Build and test

Needs Rust 1.96 and the wasm32-unknown-unknown target. On Linux, also libdbus-1-dev and pkg-config for the keystore.

cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace
cargo check -p mousse-net-core --target wasm32-unknown-unknown

The core's tests also run on wasm32 under Node, with wasm-bindgen-test-runner 0.2.130 (from wasm-bindgen-cli, the same version as wasm-bindgen) on PATH:

CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner \
  cargo test -p mousse-net-core --target wasm32-unknown-unknown

Run a phase's checks and must-fail controls, or report the results already stored. Available sets are phase0, phase1a, phase1b, phase3, phase4, pairing-flow, pairing-roles, pairing-revoke and pairing-relay-completion.

cargo run -p mousse-check -- phase0
cargo run -p mousse-check -- report phase0

Read more

License

MIT

Pinning the Rust engine

Pin both mousse-net-core and mousse-net-io to the same Git tag. Tags use v<wire-major>.<wire-minor>.<patch>. Each protocol minor starts at patch 0. Subsequent releases compatible with that wire minor increment the patch. The first tag for protocol 1.3 is v1.3.0. Tags identify the tested commit on main and stay fixed once published.

On Android, call mousse_net_io::init_android_tls from JNI with the application context before dialing secure WebSockets or relays. Include the platform verifier's Android library in the app. Use default-features = false when using app-owned identity storage.

The phone spike found release-only failures in some path renewal, port change and candidate timing tests. The same tests passed in debug on the Android emulator and iOS simulator.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages