Multi-Chain Routing Decentralization
Rubic has completed another important milestone in the decentralization of Rubic.exchange!
This week, we have added Multi-signature to Rubic’s Multi-Chain Routing Protocol, which will allow Rubic to increase the security of the protocol and its decentralization.
What is a Validator?
A Validator is a software with a dedicated isolated server, that checks the events taking place on the contract, validates the data from the transaction of these events, and in the case of validation, signs the data of this transaction with its private key. Next, it sends this signature to the Relayer.
How did it work before?
Previously, Rubic relied on the following scheme:
This scheme can most aptly be explained with an example:
Imagine that a user selects Token 1 on the Ethereum network and Token 2 on the BSC network. All tokens that have liquidity on a DEX used in Multi-Chain can be selected. The user confirms the transaction by agreeing to the cost of the Network fee and the Protocol fee.
After that, we used to complete the swap through our Multi-chain Routing contract and RBC pools, using one Validator.
1.1. A transaction is a user’s interaction with a Multi-Chain Routing contract — the exchange of Token 1 to RBC via DEX on the Ethereum network.
1.2. RBC tokens received as a result of the exchange fall into the liquidity pool of Multi-Chain Routing in the source network.
2. The verification nodes record this event and initiate an exchange on the contract via DEX on BSC.
3.1. An equivalent amount of BRBC is withdrawn from the Multi-Chain Routing liquidity pool in the target network.
3.2. BRBC is swapped to Token 2.
After switching pools from RBC to USDC, this scheme has changed — and today, we are happy to present to you a new and more decentralized version of our Protocol.
How Does Rubic’s Multi-Chain Routing Now Work?
In this new scheme, there are significant changes. Decentralization is our focus, and we are working on additional steps to make our protocol fully decentralized.
In simple words, Rubic is now relying on separate Validators and several relayers. This has significantly decreased the chances of hacking, and has increased both the stability and the decentralization of our protocol. Several validators are independent from each other and require multi-sign by ⅔ of them.
We have implemented the following multi-validator scheme:
1) The user wants to swap tokens from Blockchain 1 to Blockchain 2. A user makes a transaction on Blockchain 1 — this sends tokens to our Multi-Chain Routing smart contract on Blockchain 1.
2) There are separate validators which catch this event in Blockchain 1. For detailed Validator architecture, see below.
3) Each validator signs the transaction by its own signature, and forwards a message to the relayer.
Validators work completely independently of each other
- Validators know nothing about each other
- no IP addresses
- no blockchain addresses
- no status
- no configuration
4) When the relayer collects two of three signatures from the Validators, it initiates a transaction on Blockchain 2 by calling the function of the Multi-Сhain Routing smart contract in Blockchain 2 — sending tokens to the user.
5) The swap contract verifies that ⅔ of the signatures have been collected, and sends tokens to the user.
How do Validators work?
Validators will be checking the Unique hash of the transaction and passing it to the relayer.
1) User makes a transaction on Blockchain 1 — sends tokens to the contract.
2) Contract in Blockchain 1 emits the event.
3) The Validator scanner catches this event from Blockchain 1.
4) The Validator verifies that the transaction was created by the Multi-Сhain Routing contract, and verifies that it has made a correct event.
5) The Validators sign, by their own private key, a unique hash calculated by the recipient’s user address, token amount, transaction hash from Blockchain 1, and the blockchain number from the contract in the target blockchain.
6) The Validators sign messages to the Relayer.
Why is Rubic using more than one Relayer?
We have created several extra relayers in order to maintain our continuous improvements and growth of Rubic’s Multi-Сhain Routing feature. Validators will scan the final blockchain, for the event of sending tokens from a smart contract using a unique hash (the event is generated when the function of the swap contract is called — sending tokens to the user). If no tokens are sent after a specified period of time, Validators send a message to another Relayer. The smart contract will reject the duplicated transactions with the same unique hash from the Relayers if they were already sent.
For the past month, Rubic has completed several significant steps in terms of security and decentralization. Rubic’s goal is to provide a secure and fully decentralized solution for our users. The implementation of Multisig decentralization for our Multi-Chain Routing will be another huge step towards completing our goal.
Rubic is a Multi-Chain Swap platform which allows you to swap any of 10,000+ tokens, on and between 9 blockchains in one click. Rubic’s Multi-Chain Rotuing Protocol includes on-chain & multi-chain swaps for Ethereum, BSC, Polygon, Avalanche, Moonriver, Fantom, Harmony, Tron & xDai, with fiat on-ramps and more!
The aim of the Rubic project is to deliver a complete “One-Stop, Full-Circle” decentralized trading platform. Rubic.exchange is a place where users can complete Multi-Chain swaps using different solutions to get the best rates from all leading trading protocols.