Direct Communication

The MPC nodes can be configured to communicate with each other using direct node-to-node connections.

To do this, each MPC node must enable an MPC server and specify on which port to listen for incoming connections. This can be either a TCP server:

[MPCTCPServer]
  Port = 9000

or a WebSocket server:

[MPCWebSocketServer]
  Port = 9000

In addition, each MPC node configuration file must contain the address of the other nodes. For example, in a TSM with three MPC nodes with player index 0, 1, 2, the MPC node with player index 0 must have the following in its configuration file:

[Players.1]
  Address = "tcp://player1:9000"
  PublicKey = ""

[Players.2]
  Address = "ws://player2:9000"
  PublicKey = ""

The logic is that MPC nodes with lower player indices open connections to higher numbered players, so the Address is not needed for players with a lower player index than the index of the node itself.

πŸ“˜

Direct Communication and Dynamic Node Configuration

When using direct node-to-node communication, only the MPC node with the smallest player index can be dynamically configured. This player does not need to enable the MPC server, and the other MPC nodes do not need to specify that nodes' public key in their config files, but can instead provide the public key dynamically, when an MPC session is created. To enable more than one MPC node to be dynamically configured, message broker communication must be used.

There are a number of options not covered here. See the example file for more about these.


What’s Next