Skip to content

RelayMessage

Purpose

A RelayMessage is used to relay an encrypted EngineMessage via multiple routing hops. It is sent between two nodes and encapsulates either an EngineMessage or another RelayMessage.

Type

Reception:

RelayMessageV1

Record with fields:

Source Node ID

Destination Node ID

Transport preferences for outgoing messages

  • expiry: Option

Expiry time for outgoing messages

  • msg: Vec

Encrypted and padded EngineMessageV1 or RelayMessageV1

  • sig: Signature

Signature over the above fields by src

Triggers:

EngineMessage

Behavior

When the router receives a RelayMessage from a remote node via the Transport engine, it processes it the following way:

  1. It checks whether it is configured to allow relaying either from the source node or to the destination node.
  2. If not, it drop the message
  3. It decrypts the contained EngineMessage or RelayMessage, and processes it.

Message flow

sequenceDiagram

%% --8<-- [start:sequence]
Router -) Router: RelayMessage
Router -) Router: EngineMessage
%% --8<-- [end:sequence]