Decentralized exchanges have been gaining more and more traction. It has been observed that a total of $1.48 billion in trading volume occured in UniswapV3 alone. Although protocols such as Uniswap, Curve, and SushiSwap significantly provide the exchange services within the Ethereum ecosystem. However, these exchanges do not support the swap between the different blockchain networks. So the question is, is there any way to swap native assets to other blockchains? For example, trade between Binance and Avalanche blockchain.
Here the THORChain comes as the solution to this.
THORChain is a decentralized cross-chain liquidity protocol that allows its users to trade digital assets from one blockchain to another in a frictionless, secured and decentralized manner. There are no custodians and wrappings. Users are paid to stake their assets in the liquidity pool to earn a fee at every swap.
Before we take a deep delve into the mechanics of THORChain, let's have a quick view of its history.
THORChain was founded in 2018 in a Binance Chain hackathon by a pseudorandom team. The team hasn’t come up with the real identity until now, but they have continued their research even after the hackathon. Later, advancements in Tenderment, Cosmos SDK, and working implementation of threshold signature scheme- TSS have helped them develop a fully cross-chain decentralized exchange. The TSS here is a cryptographic primitive for distributed key generation and signing.
THORChain will start by allowing trades of Ether(ETH), Bitcoin(BTC), Litecoin(LTC), and Binance Chain(BNB). But more is coming shortly as a limited mainnet called "Multichain ChaosNet" was also released in April 2021.
Also read about Tendermint and Cosmos SDK.
One important thing to mention here is that the native token of THORChain is RUNE. Every token in the THORChain has an equal value associated with the RUNE token in that blockchain.
RUNE is the native coin of THORChain, which empowers its economic ecosystem while providing incentives to the network. It serves as a settlement asset or liquidity in the network, providing security and governance to the THORChain network. The total supply available of RUNE is $484 million, while 50% of its supply has been burnt.
The network has specific roles. These are the following roles in the THORChain network.
Liquidity providers are the users who add their assets to the pool to gain incentives and rewards.
Swappers use liquidity to swap their asset by paying some amount of fee to the pool.
Node operators are those who validate transactions, reach consensus and add that transaction to the blockchain.
Traders are responsible for maintaining the pool by paying fees with the intent to earn a profit.
Churning is a mechanism in which only one node is active and can sign the transaction while others are waiting on standby. For every 50,000 blocks, the churning mechanism hits the system to replace the older nodes with the set of standby nodes. It makes sure that each node that fulfills the criteria must have a turn in the system to verify the transactions. Even though a high amount of RUNE is required for a fully functioning node, nodes with less RUNE can still verify the transaction without signing it.
THORNode services the THORChain network. THORChain is designed in such a way that anybody with funds can join the secured network. However, it has taken a step further with a high churn schedule that continuously emits the nodes. THORNodes comprises multiple independent servers which run a full node for each connected chain.
Bifrost is a protocol that provides the service of connecting each chain. Once all the nodes are in sync, the observer starts monitoring the vault address. Whenever they see any inbound transactions, they validate them and convert them into witness transactions. THORChain observes each transaction and collects it's node signer to confirm that they both are identical. As the nodes reach consensus, the transaction moves from the pending state to the finality state.
The state machine is responsible for performing the finalized transaction's logic and delegating them to the outbound vault.
As the transaction reaches a finalized state, the signer marks the valid transaction to their respective chains. This transaction is then sent to the TSS module, where it performs key-signing and broadcasts it to their respective chains.
The THORChain protocol is a network built with Tendermint in a Cosmos SDK ecosystem in which the application layer is not attached to the consensus and networking layers.
The consensus mechanism in THORChain is significant as the nodes inside the protocol must work together to record the transactions coming from different blockchains. To understand how it works, let’s take a simple example over here.
Let’s assume Alice wants to initiate a trade between ETH on the Ethereum network and BNB on the Binance Smart Chain. Alice will send a transaction to her ETH vault, where it keeps being monitored by the THORChain network. Here a Bifrost protocol will act as a connecting layer between the THORChain and the other blockchain networks. Its function is to keep track of the vault address and the inbound transactions. First, ETH is traded to RUNE in the Ethereum network, and as the nodes reach the consensus, the RUNE is then traded into BNB.
One thing which is essential to mention is that if a person wants to trade ETH against BNB. The user will be responsible for paying the ETH gas fee, while the BNB trade fee will be deducted from the outbound.
THORChain envisions empowering its economic ecosystem, and with continuous growth is proving its vision. More and more nodes are adding, increasing the trading volume and total locked value of the network.
Also read ConsenSys Quorum Blockchain