#relay #mpc #secure-communication #tss #e2ee #crypto

app mpc-relay

Noise protocol websocket relay for MPC/TSS applications

4 releases (breaking)

0.4.0 Jun 19, 2023
0.3.0 Jun 14, 2023
0.2.0 Jun 14, 2023
0.1.0 Jun 13, 2023

#736 in Cryptography

MIT/Apache

105KB
2K SLoC

MPC Relay

End-to-end encrypted relay service designed for MPC/TSS applications built using the noise protocol and websockets for the transport layer.

The service facilitates secure communication between peers but it does not handle public key exchange nor meeting points.

For clients to use the relay service they must know the public key of the server and the public keys of all the participants for a session.

Creating a meeting point that shares the session identifier between participants to execute an MPC/TSS protocol is left up to the application. Typically, this can be achieved by encoding the session identifier in a URL and sharing the URL with all the participants.

Server Installation

cargo install mpc-relay

Documentation

  • protocol Message types and encoding
  • server Websocket server library
  • client Websocket client library
  • cli Command line interface for the server

The client implementation uses web-sys for webassembly and tokio-tungstenite for other platforms.

Development

Getting Started

You will need the rust toolchain and a few other tools:

cargo install cargo-make
cargo install wasm-pack

Minimum supported rust version (MSRV) is 1.68.1.

Server

First generate a keypair:

cargo run -- generate-keypair server.pem

Then start the server:

cargo run -- server config.toml

Documentation

cargo make doc

Tests

Server Key

Generate a server key for the test specs and print the public key:

cargo run -- generate-keypair tests/test.pem

Copy the hex-encoded public key into the file tests/server_public_key.txt.

Native Client

To run the tests using the native client:

cargo make test

Web Client

To test the web client using webassembly, first start a test server:

cargo run -- server -b 127.0.0.1:8008 tests/config.toml

Now you can run the webassembly tests:

cargo make test-wasm

License

The driver crate is GPLv3 all other code is either MIT or Apache-2.0.

Dependencies

~8–23MB
~321K SLoC