Under the Hood: THORChain Transaction Delays

THORChain University
4 min readSep 6, 2022

--

Have you ever made a transaction on THORChain and experienced a bit of panic, as you see the spinning wheel and wonder when your transaction will be completed? Here we will lay out the designed “delays” that blockchains and THORChain specifically have intentionally built-in to ensure optimal security.

1- UTXO confirmations before spending

“Unspent Transactions Output” or UTXO is the way some chains (e.g. Bitcoin and its forks) keep track of coins in the network. Most frontends would require 2–3 block confirmations of a freshly transferred UTXO before being able to use it (e.g. swapping or depositing LP into THORChain). This is the usual cause of the “Insufficient UTXO confirmations” error message that some frontends will display.

2- Waiting for inbound transaction to be confirmed

Once you have successfully submitted a transaction, it goes to the mempool, while waiting for nodes/miners to actually process it. On some chains, this could be just a few seconds. On Ethereum, depending on congestion and the gas fee that was paid, this could be a few minutes up to days (if you had severely underpaid the gas). On Bitcoin, block times are on average 10 minutes each, so it could be 20–30 minutes if it took a few blocks before your transaction is confirmed.

3- Inbound confirmation counting

Once your transaction is confirmed, only then does THORChain observe it. For some instant finality chains (e.g. Cosmos Hub Gaia), THORChain will try to process it immediately. It may take still a few THORChain blocks (which are around six seconds each) depending on THORChain congestion, and when exactly the THORChain nodes reach observational consensus regarding your transaction.

However, for probabilistic finality chains (e.g. Bitcoin or Ethereum), there is the concept of Inbound Confirmation Counting. Let’s use Bitcoin as an example. Each fresh Bitcoin block mined generates a certain fresh Bitcoin reward to the miner (currently it is 6.25 BTC, tied to Bitcoin’s halving cycle). The total BTC inbound into THORChain in a single Bitcoin block, will be compared vs the 6.25 BTC block reward to determine the number of block confirmation counting, before all the transactions in this block is accepted by THORChain.

E.g. if you submitted a 5 BTC transaction (< 6.25), and no other THORChain inbound transaction was in the same block, then a single BTC block confirmation is enough.

If you submitted a 5 BTC transaction, but other users submitted a 10 BTC inbound transaction into THORChain in the same BTC block (total 15 BTC < 6.25 x 3), then THORChain will wait for three BTC block confirmations before accepting these transactions.

This could lead to long inbound delays for chains with small block rewards. E.g. BCH currently has 6.25 BCH block rewards, with an average of 10 minutes block time. That means $10000 total inbound transaction (depending on BCH price, around 90 BCH < 6.25 x 15) will need 15 block confirmations = average of 150 minutes before THORChain will accept the transaction.

Update: In Aug-2024, maximum inbound block confirmations (regardless of total value of inbound transactions) were implemented: Bitcoin (three), Ethereum (fourteen), Bitcoin Cash (fifteen), Litecoin (twelve) & Doge (forty).

4- Streaming swap delay

Depending whether you chose a Streaming Swap (and the parameters of the swap), the streaming can take up to 24 hours to complete.

5- Outbound delay

The outbound delay gives the node operators, developers, and community an opportunity to manually flag and pause the network if there were suspicions of an ongoing exploit. This delay is only for outbounds to external chains, and not applicable for native RUNE or THORChain synthetics outbounds. The delay is a maximum of 720 blocks (around one hour depending on exact blocktimes), and depends on multiple factors such as other ongoing outbounds from other users. So if other users are making large outbounds around the same time, your transaction will also be delayed accordingly. This is to avoid an exploiter which tries to break his exploit into multiple smaller transactions.

You can check your transaction (including outbound delay countdown) here: https://track.ninerealms.com/

6- Waiting for outbound transaction to be confirmed

Finally, after the outbound delay, THORChain submits that transaction into the mempool, and again there is the wait for nodes/miners to actually process it, similar to Step 2.

A Final Suggestion

Learn how to check block explorers for all the chains you are interacting with. For THORChain itself, that would be https://runescan.io/ or https://thorchain.net. There are other block explorers for other chains that will give you detailed information about the status of your pending transactions.

Reference: https://docs.thorchain.org/network/security

Feel free to hop into the TC University Discord to chat about this, or any other THORChain questions that you may have.

Explore THORChain: Website, X, Telegram, Developer Discord.

Explore Maya Protocol, the first friendly fork of THORChain: Website, X, Discord, Telegram.

Decentralized, permissionless, non-custodial, trust-minimized, open-sourced, economic-secured, non-wrapped, native-to-native cross-chain swaps, savings and soon, lending!

--

--

THORChain University
THORChain University

Written by THORChain University

THORChain University aims to educate communtiy users on how to optimally engage with the @THORChain Network

Responses (1)