How Does THORChain's Cross-Chain Trades Work (The Mechanics Behind the Trade)


Photo Source


Let's face it, one way or the other, trading is at the heart of the cryptosphere. Whether we like it or not, we need a diversity of tokens within our wallets to accomplish different tasks or to invest in that 'new hot token'. Or, how many times have you needed native Ethereum but was only holding native Bitcoin?

Well folks, THORChain to the rescue.

THORChain is a decentralized automated market maker which enables its users to exchange native tokens across various blockchains. It's users can trade their native tokens across certain Layer 1 blockchains receiving native tokens in a permissionless, non-custodial manner.

In practicality, THORChain removes the intermediary centralized exchange, usually required for this type of exchange, from the equation. As such, THORChain removes the usual problems associated with centralized exchanges from cross-chain swaps (counterparty risk, speed, regulatory risk, theft risk, and cost).

The THORChain protocol and mechanisms it utilizes are novel as it supports a great number of native tokens across many blockchains. For this reason, THORChain is uniquely poised to deliver on its stated purpose of becoming a decentralized exchange between any cryptocurrency [see, e.g. THORChain. Introduction. (Accessed October 9, 2021).

This article is submitted as a supplement to the THORChain Coin Guide, and two versions are contained herein. A technical version is submitted first followed by an overly simplified presentation of THORChain's mechanics. It is also submitted as a contribution to the Alpha Project - #LeoAlpha advanced by @khaleelkazi.


20211009 2.png
Photo Source

THORChain employs a network of nodes and liquidity providers to make the cross-chain swaps it offers possible. RUNE, THORChain's native token serves three purposes within the ecosystem:

  1. it provides network security;
  2. it is the currency in which fees are collected; and,
  3. it serves as the common quote currency for each trade in the ecosystem's swap mechanism maximizing asset liquidity in the AMM.

At it's core, THORChain is merely a vault manager without a leader, and the mechanism employed to make the THORChain protocol operate may be broken into four distinct components as set forth in the official THORChain webpage:

  1. One-Way State Pegs (syncing the state from the external chains);
  2. A State Machine (coordinator of the asset exchange logic and to delegate the redemptions);
  3. BiFrost Chain Client (converts the generated redemptions to chain specific transactions); and
  4. A TSS Protocol (enabling distributed threshold key signing).


Within the THORChain swap mechanism, the nodes are connected to the required blockchain utilizing one-way state pegs which employ created addresses across the chains, all controlled by the THORChain nodes. [One-Way State Pegs: "Nodes are connected to BNB, BTC, ETH (and other) chains via Bifröst modules. Once nodes are done syncing, they begin watching vault addresses on each chain. If they ever see an inbound transaction concerning a vault address they watch, they deserialise it and convert it into a witness transaction." THORChain. It Starts with One Way State Pegs. (Accessed October 9, 2021)].

Witness transaction parameters are basically the same for each chain and are as follows:

20211009 3.png
Photo Source

Nodes used by THORChain employ MPC (Multi-Party Computation) technology like, for example, TSS (Threshold Signature Schemes) and DKG (Distributed Key Generation) so that one single node can not gain control over any user's assets.

Each observed transaction is processed by THORChain collecting 'signers' (the keys of every node reporting a 100% identical transaction) and once a supermajority (67%) of nodes agree, the transaction progresses from a 'pending state' to a 'finalized state'.

20211009 5.png
Photo Source

In the system, each chain client contains only the logic necessary to connect that particular chain. It is the observer that bears the weight of most logic"

Photo Source


Finalized transactions occur as a result of the operation of the 'state machine' which is likewise responsible for ordering transactions, computing state changes, and outbound vault delegation:

Photo Source

A 'txOut' is then created which provides the following details: the chain on which the transaction should be sent; destination address; the vault the transaction should be sent from; and, the maximum gas to be spent.

The 'txOut' appears as follows:

20211009 7.png
Photo Source

Notice that the 'txOut' contains both an 'InHash' and 'OutHash' item. These are utilized to identify the originating transaction and the accounting completion transaction.


When the finalized transaction is created by the state machine, it is the function of the Signer to load and serialize it into the correct form for the destination chain using the applicable chain client.

20211009 10.png
Photo Source


From the chain client, the final transaction is sent to the TSS Module where it goes through designated key signing coordination. And once the coordination is complete, the finalized transaction is broadcast to the appropriate blockchain node.

20211009 11.png
Photo Source


  • THORChain Asset Vaults: There are two types of vaults: 1). Asgard TSS Vaults which are large committee inbound vaults requiring 27 of 40 TSS; and, 2). Yddgrasil Vaults which are single signer outbound vaults (1 of 1). This design provides security of the large committee vaults to hold most of the system's assets, while the smaller and faster vaults are delegated the outgoing assets as have been system approved. All 100 system nodes run an outbound vault enabling the node to process approximately 1 transaction/vault/second.
  • Multi-Realm Asgard Vaults: When it becomes necessary to increase the outbound nodes beyond 40, the system automatically shards Asgard Vaults in 2 (this occurs when the system approaches the 'MaxNodesForAsgard' constant). The system runs constant checks on the vaults and the vault exhibiting the highest security is sent user funds.
  • Managing Outbound Funding: The State Machine operates as a monitor of the Yddgrasil Vaults and tops up each to the extent of 25% of the Nodes bond. When a node churns out its assets are simply returned to an Asgard Vault automatically.
  • Migration: When the network churns, funds are migrated forward and new public keys are created. The process is divided into 5 separate transactions and takes several hours to complete. Users are advised to only send funds to the newest vault, but the retiring vaults are still monitored. The retiring vault is discarded and no longer monitored when all 5 of the migrations are completed.


THORChain allows it's users to swap tokens from different blockchains in their native form (without wrapping or pegging) all while maintaining an environment free from third party risk and being non-custodial in nature.
Using THORChain, a user who wants to swap let's say Ethereum for BNB (BSC) would not be forced to resort to a centralized exchange, nor would the user face the hassle of dealing with synthetic (wrapped) versions of the assets. The swap may be done on THORChain, all while sending and receiving native tokens.

Photo Source

How does THORChain achieve this high degree of interoperability in its ecosystem? The answer to this question lies in its use of the native RUNE token through it's vaults. Using the ETH to BNB (BSC) swap contemplated above, the transaction would be perform in the following manner. The THORChain protocol would break the transaction into two separate transactions automatically: 1.) It would first swap ETH for RUNE tokens; and, 2.) then swap RUNE tokens for BNB (BSC). By using this mechanism to conduct swaps the ability is present for THORChain to perform cross-chain swaps.

[Nagoda, K. THORChain (RUNE) vs Polkadot (DOT). (Accessed October 10, 2021)


THORChain has not been without it's problems due to hacking, however, it dealt with the hacks in an trustworthy and professional fashion. Nonetheless, the cross-chain exchange of native asset mechanisms employed by THORChain work, and work very well. It is a clean and efficient mechanism that is poised to bring the THORChain ecosystem much success in the future as it provides an essential service to the entire cryptosphere.

Posted Using LeoFinance Beta