🟦Symbiosis Relayers Network
Last updated
Last updated
The Symbiosis Relayers Network is a peer-to-peer (P2P) network that enables the reliable and secure transmission of data required for cross-chain operations within the Symbiosis network. As the off-chain component of the Symbiosis protocol, it facilitates communication between blockchain networks.
Why is there a need to transfer data between networks? By design, blockchain networks operate in isolation, unaware of events occurring outside their boundaries. While this approach works well for operations limited to a single chain, cross-chain operations require an off-chain component to facilitate communication and coordinate actions across multiple networks. The Symbiosis Relayers Network fulfills this role by ensuring data integrity and accuracy during cross-chain operations handled by the Symbiosis protocol.
In this section we will focus on how the Relayers Network works. An explanation of the on-chain part of the Symbiosis protocol (smart contracts) can be found here: Cross-chain liquidity engine.
There are several definitions that are important for further explanation.
Relayer
A relayer is a node with special software running on it with two requirements for that entity:
The node and staker addresses are registered in the Staking contract. The node address corresponds to the node’s private key; the staker address is used to manage staked SIS tokens and withdraw rewards. All addresses in the Staking contract are unique: one staker address can only be associated with one node address and vice versa.
A stake of a certain size is deposited from the staker address into the Staking contract for that entity.
If the requirements are met, the node can participate in the Relayers Network, and the staker associated with that node can receive rewards for the node’s work. From now on, we will refer to such an entity as (a) relayer.
Node runner
A node runner is an individual or an organization that provides SIS tokens for staking, runs a relayer, and receives rewards for staking and bridging blockchains.
S-chain
S-chain is a service blockchain for the Symbiosis protocol in general. The Staking and On-chain configuration contracts that are critical to the Relayers Network are deployed on this blockchain.
Epoch
An epoch is a period of time during which relays use an MPC key. The duration of an epoch is 24 hours during normal operation.
MPC key
A Multi-Party Computation (MPC) key is a private key that is divided among multiple parties to create a signature without revealing the key fragments to each other.
MPC address
An MPC address is an address derived from the public key corresponding to an MPC key.
The relayers ecosystem consists of the following parts (Scheme 1):
The Symbiosis Relayers Network is a P2P network where each peer is a node running special software. The node information is registered in the Staking contract (2). Each relayer receives rewards for participating in the network operation if certain conditions are met. The purpose of the Symbiosis Relayers Network is the fast, accurate, and secure transfer of information about cross-chain operations between blockchains supported by the Symbiosis protocol.
The On-chain configuration contract contains some information important for the collaboration of relayers. For instance, a number of nodes in the MPC group, an actual address of the Staking contract, etc. Each relayer checks the contract for updates when an epoch changes.
The Staking contract contains information about relayers (addresses, status, stake, reward amounts, etc.), epochs, MPC addresses, etc. The Staking contract is essential for the operation of the Relayers Network.
The BridgeV2 contract connects the off-chain and on-chain parts of the Symbiosis protocol: the Relayers Network and Symbiosis contracts. An instance of the BridgeV2 contract is deployed on each blockchain supported by Symbiosis.
Please refer to the document Symbiosis Routing Contracts for more information about the workflow of the core Symbiosis contracts.
Microservice Broadcaster sends transactions with calldata signed by relayers to blockchains.
WebApp for Node Runners is a web-based application provided by Symbiosis that helps node runners to interact with the Staking contract: register their relayers and manage stakes and rewards.
Before we continue, we should emphasize three important points:
Important: Multisig Contracts Staking, BridgeV2, and On-chain configuration have functionality that allows the owner of the contracts to change the states of the contracts. The owner role is assigned to the address of the Multisig contract. Symbiosis administrators can only change the states of the contracts with multisig. That significantly reduces the impact of loss or compromise of private keys and the human factor.
Important: Microservices We have isolated some of the relayer’s functionalities into Advisor and Broadcaster microservices to speed up software development while minimizing potential problems associated with the interaction of different components of the system. The microservices cannot modify transaction data and do not have any access to the user's or node runner's funds at any time. However, no matter how simple, secure, and reliable the microservices are, they remain centralized elements. Therefore, in the future, we may consider moving to a decentralized solution. For instance:
Running multiple instances of the microservice of each type and handing them off to microservice runners for a fee.
Merging the functions of the microservices back into the relayer’s software.
Running the microservices as a separate service on a group of relayers.
Important: RPC consensus Each relayer in the Relayers Network parses blocks from all blockchains supported by the Symbiosis protocol, looking for specific events emitted by the Staking and BridgeV2 contracts. There are two ways to trust to the source of the blocks and events:
Full nodes: a node runner supports full nodes for all supported blockchains. In this case, the relayer node gets information about blocks and events from a trusted source.
RPC consensus: a node runner cannot afford to support full nodes for all blockchains. In this case, the relayer node uses multiple RPCs per blockchain. And the relayer considers an event valid if it receives information about the event from at least 2 RPCs (the RPC consensus may differ from this model for blockchains that have problems with RPCs).
The Symbiosis Relayers Network is a P2P network with built-in crypto-economic incentive mechanisms. The Relayers Network is an off-chain part of the Symbiosis protocol. The main purpose of the network is to provide fast, accurate, and secure transmission of information about cross-chain operations performed via the Symbiosis protocol.
During operation, the Relayers Network is divided into the groups shown in Scheme 2 below.
The Symbiosis Relayers Network is a set of all relayers (see the definition of a relayer). The network is built as follows:
Symbiosis admins define the set size (the maximum number of relayers) in the Staking contract,
Node runners stake and register their nodes in the Staking contract.
The Bootstrap group includes relayers that provide information about relayers currently connected to the Symbiosis Relayers Network to newly joining relayers. Although the relayer software comes with a configuration file that lists default bootstrapping nodes, any relayer node connected to the Relayers Network can be used as a bootstrapping relayer.
The MPC Group is an active group of the current epoch. The group is defined by an algorithm that runs on each relayer at the beginning of the epoch. Its functions include:
Validating and signing the calldata form Oracle requests emitted by the BridgeV2 contracts and routing the signed calldata to appropriate blockchains. 2/3 of the MPC group is enough to create a valid signature.
Generating and storing an MPC key (each relayer of the MPC group keeps a fragment of the key).
Replacing the MPC address of the previous epoch stored in the BridgeV2 contracts with a new one.
The Veto Group includes trusted relayers. All relays of this group must participate in creating every signature generated by the MPC group. If at least one signature of a veto group member is missing, the signature is invalid, and the Symbiosis protocol does not proceed calldata with such a signature. Thus, the Veto Group itself does not suppress anything by a separate ban; instead, the relayers of this group do not sign transactions that look suspicious. That is, they veto not by action but by inaction.
A special flag set for a relayer in the Staking contract indicates a trusted relayer. Currently, the setting the veto group is the responsibility of the Symbiosis sysadmins. In the future, however, the Relayers Network will set the veto group in a decentralized manner.
When connecting to the Relayers Network (while starting or reconnecting), a relayer node connects to the bootstrapping nodes listed in its configuration file.
The relayer node that received the connect request identifies the connecting relayer node:
Verifies that the address of the connecting relayer is in the Staking contract and that the relayer is not blocked,
Obtains confirmation that the connecting relayer node has a private key that matches the address.
Once a relayer has authenticated a new connecting relayer node, the relayer:
Broadcasts the information about that node to the Relayers Network,
Sends the list of active connections to the connecting relayer node. The connecting relayer node establishes secure connections with all currently running relayer nodes.
All relayer nodes, after authentication, maintain active connections with each other over encrypted channels.
For more information about the keys used by a relayer node, please refer to Symbiosis Relayer.
In fact, this is the essential function for which the Relayers Network exists: to transfer a message that contains instructions for a cross-chain operation from one blockchain to another.
An instance of the BridgeV2 contract is deployed on each blockchain supported by the Symbiosis protocol. The BridgeV2 contract issues an OracleRequest
event when there is a need to send data about a cross-chain operation to another blockchain.
For more information about what happens on-chain during cross-chain operations, please refer to Symbiosis Routing Contracts. In this document, we focus on the Relayers Network.
Each relayer in the Relayers Network parses blocks from all blockchains supported by the Symbiosis protocol looking for OracleRequest
events issued by the BridgeV2 contracts.
Each OracleRequest
event has calldata consisting of:
The destination network information (the network ID and the BridgeV2 contract address on that blockchain),
Instructions for Symbiosis contracts on the destination blockchain.
Relayers should take the calldata, validate, sign, and send it according to the information from the calldata (Scheme 3 below).
The BridgeV2 contract on Blockchain A emits an OracleRequest
event.
Each relayer of the Relayers Network discover the OracleRequest
event.
The leader of the MPC group is the relayer with the largest stake in the group.
The leader checks the sufficiency of the approved fee from the OracleRequest
event with Advisor. For the explanation of fees for cross-chain operations, please refer to Gas Fees for Cross-chain Operations via Symbiosis.
Relayers use the Hierarchical Threshold Signature Scheme (HTSS) to create TSS signatures. The leader initiates the generation of the TSS signature for the calldata from the OracleRequest
event within the MPC group. Each relayer in the MPC group validates the calldata, signs it with its MPC key, and sends it back to the leader.
The leader collects signatures to complete the TSS signature and sends the signed calldata to Broadcaster.
Broadcaster fetches the optimal gas price from Advisor.
Broadcaster signs a transaction containing the signed calldata and sends the transaction to an appropriate blockchain.
The use of the Hierarchical Threshold Signature Scheme (HTSS) ensures that all members of the veto group participate in the creation of the TSS signatures. 2/3 of the MPC group is sufficient to create a valid signature.
An epoch is a period of time during which relayrs use one MPC key. The epoch duration is 24 hours in normal operation. The entire epoch change process takes no more than 1 minute.
The epoch change process can be divided into four stages:
Initiating the epoch change.
Epoch change preparation. This stage includes:
Formation of a new MPC group,
Generation of a new MPC key,
Approval of the epoch change by holders of 2/3 of the total stake.
Epoch change in the Staking contract.
MPC address change in the BridgeV2 contracts.
Scheme 4 shows Steps 1-3, and Scheme 7 shows Step 4.
Each relayer in the Relayers Network parses blocks from S-chain looking for the events issued by the Staking contract.
The PrepareEpochChange
event generated by the Staking contract initiates the relayers to change the current epoch.
Currently, initiating an epoch change is the responsibility of the Symbiosis sysadmins. In the future, however, the Relayers Network will initiate epoch changes in a decentralized manner.
Each relayer should discover the PrepareEpochChange
event. After confirming a PrepareEpochChange
event, each relayer determines a new RPC group (see next section: Epoch Change Preparation).
All relayers (except blocked and offline relayers) in the Relayers Network participate in the epoch change procedure.
The epoch change Preparation consists of three stages:
New MPC group formation,
New MPC key generation,
Epoch change approval.
2.1. New MPC group formation
After confirming a PrepareEpochChange
event, each relayer determines a new MPC group as follows:
Retrieve a list of all non-blocked relayers from the Staking contract. The list will include both online and offline relayers.
Shuffles the list using the seed from the PrepareEpochChange
event. Since each relayer uses the same algorithm and the same input for the algorithm, the output is an ordered list that is the same for each relayer.
Determines the base of the new MPC group: the top 15 + 3 of the ordered list is the base for the new MPC group: 15 is the target MPC group size, and 3 is a reserve.
Determines the leader of the new MPC group: the leader is the relayer with the largest stake in the base for the new MPC group.
Since every relayer has the same ordered list, every relayer knows if it is at the top of the list or not. The leader goes through the base of the new MPC group and chooses the top 15 which are online for the leader. That’s the new MPC group.
This method allows any relayer (regardless of the size of its stake) to become a member of the MPC group and receive rewards. It also reduces the risk of malicious plotting within the Relayers Network.
All MPC groups always include all relayers of the veto group.
2.2. New MPC key generation (by the new MPC group)
All relayers of the new MPC group participate in generating private and public MPC keys. Each relayer obtains its segment of the private MPC key during the algorithm execution. The MPC address is written to the logs of each relayer of the new MPC group.
2.3. Approval of the epoch change (by the Relayers Network)
Once the new MPC key is ready, the Relayers Network should :
The leader of the new MPC group obtains the signature base for epoch change from the Staking contract, signs it with its own private key, and broadcasts it to the Relayers Network.
Each relayer verifies the signature base, signs it with its own private key, and sends it back to the leader of the new MPC group.
The leader of the new MPC group collects the signatures.
After collecting all responses, the leader of the new MPC group sends the collection to Broadcaster.
Broadcaster signs a transaction containing the data received from the leader and sends it to S-chain. The transaction calls the Staking contract to change the current epoch.
The epoch is changed when the following conditions are met:
2/3 of the total stake have signed the epoch change,
All members of the veto group have signed the epoch change,
All members of the new MPC group have signed the epoch change.
There are two ways to change the current epoch in the Staking contract:
The transaction with the necessary data prepared by relayers changes the epoch,
Symbiosis administrators manually change the current epoch using the data prepared by the new MPC group (the MPC address and the list of the relayers of the new MPC group). Such an action may be necessary in the following cases: it’s the zero epoch, or an issue occurs. For instance, many relayers are offline, and the Relayers Network cannot provide enough signatures to change the current epoch.
Once the epoch is changed in the Staking contract, the contract emits the EpochChanged
event. This event signals the relayers to change the MPC address stored in the BridgeV2 contracts to the new one.
3.1. Reward distribution
Once the epoch is changed in the Staking contract, the rewards for the previous epoch are distributed among the following relayers:
Members of the MPC group of the changed epoch,
Those who signed the epoch change (this group is omitted if the epoch was changed by the Symbiosis team).
The distributed rewards will be added to the stake of each eligible relayer when the epoch changes again. The relayers can then claim rewards for withdrawal.
Each relayer of the Relayers Network parses blocks from S-chain looking for the events issued by the Staking contract.
The EpochChanged
event generated by the Staking contract initiates relayers to replace the MPC address stored in the BridgeV2 contracts with a new one (Scheme 5 below).
An instance of the BridgeV2 contract is deployed on each blockchain supported by the Symbiosis protocol. Each BridgeV2 contract stores an MPC address and only processes requests signed by the corresponding MPC key.
Relayers track information about MPC addresses stored in each BridgeV2 contract and sign calldata with an appropriate MPC key for every blockchain. The Relayers Network always strives to update MPC addresses stored in the BridgeV2 contracts to the MPC address stored in the Staking contract.
The Staking contract emits an EpochChanged
event.
Each relayer discovers the EpochChanged
event.
The leader of the MPC group is the relayer with the largest stake in the group.
The leader initiates the generation of the TSS signature for the calldata to change the MPC address on the BridgeV2 contract within the MPC group. Each relayer in the MPC group validates the calldata, signs it with its MPC key, and sends it back to the leader. Relayers use the Hierarchical Threshold Signature Scheme (HTSS) to create TSS signatures.
The leader collects the signatures to complete the TSS signature and sends the signed calldata to Broadcaster.
Broadcaster signs a transaction containing the signed calldata and sends the transaction to an appropriate blockchain.
Once the transaction is mined, the MPC address in the contract is changed and the contract emits the LogChangeMPC
event.
Each relayer of the Relayers Network discovers the LogChangeMPC
event and locally updates the data for the blockchain. In this way, each relayer knows which MPC key should be used for each blockchain.
The BridgeV2 contracts on different blockchains may have MPC addresses corresponding to different epochs. The MPC group with an MPC key corresponding to the MPC address stored in the BridgeV2 contract will replace the address with a new one in that contract.
The Hierarchical Threshold Signature Scheme (HTSS) ensures that all members of the veto group participate in the creation of the TSS signatures. 2/3 of the MPC group is sufficient to create a valid signature.
In some cases, Symbiosis administrators need to manually change the MPC address stored in the BridgeV2 contract manually. For instance, a blockchain has been offline for a few days, several epochs have passed, and the MPC group with the corresponding MPC key cannot provide a quorum to create a valid TSS signature to change the MPC address.
Microservice Advisor estimates gas prices on the blockchains supported by Symbiosis. Please refer to for more information about Advisor.