THORChain (RUNE)

From CryptoWiki

Revision as of 09:01, 23 January 2022 by 5imp5on (talk | contribs) (1 revision imported)

THORChain
TypeCross chain swaps
Consensus mechanismDPoS
Total supply500.000.000
Websitehttps://thorchain.org/

Basics

"THORChain describes itself as a decentralized liquidity network that allows users to swap assets instantly at manipulation-resistant market prices. Swaps are done through permissionless cross-chain liquidity pools that allow users to stake their assets to earn trading fees. Traders can monitor pool prices and earn by arbitraging back to fair market prices. Projects can reportedly stake their treasuries to give their tokens deep liquidity."

History

Audits & Exploits

"An additional audit is being scoped, capped at $125k."

Bugs/Exploits

"In late June, an attacker made off with $140,000 in Ether and ERC20 tokens after a "logic error in the ETH Bifrost.""

"During a live attack, the network has been halted. Approximately 4,000 ETH of value was extracted from the protocol. While the treasury has the funds to cover the stolen amount, we request the attacker get in contact with the team to discuss return of funds and a bounty commensurate with the discovery.

Node operators, liquidity providers and swappers - Your funds will be available when the issue has been patched & the network resumes. Any in-progress swaps will be finalised at this time. Problems like this highlight the resiliency of decentralized communities - Without any admin/dev intervention the community identified & halted THORChain within an hour."

"The code contains an over-ride loop, designed only for use in vaultTransferEvent transactions, which the hacker was able to manipulate. The hacker was able to wrap the router with their own contract, allowing them to access this over-ride. Although the code contains a comment that explicitly states... "it is important to keep this part outside the above loop" … the vulnerability was left open, and looks to have been a costly oversight for the ThorChain team. It seems this is something that could have been foreseen and prevented long ago."

"The only entity that will wear the burden will be the THORChain treasury, approx $5m will be used to donate to ETH LPs. This is the purpose of the treasury during Chaosnet, to insure the network funds."

Had another hack on 23-7-2021 in which the hacker said that a 10% VAR bounty could have prevented it. Discord messages indicated that devs were not listening to warnings.

  • From Rekt (26-7-2021):

"A second strike saw them lose another $8M. The hacker left a clear message for THORChain, but apparently it was not clear enough, as THORChain initially believed they had lost just $800k to a whitehat hacker. An attacker targeted the Thorchain Bifrost component through the ETH Router contract. The hacker targeted a refund logic. The attack can be named as Lack of proper multi-event handling.

Just as with the previous exploit, a vulnerability present due to decisions actively made by developers was found within the RUNE token contract code. Hours after the attack, many addresses began to receive a previously unknown token; UniH. Those who tried to sell this token had their full RUNE balances drained upon approving its use.

As can be seen in the code’s comments this was a vulnerability that the team had foreseen, and had been acknowledged as “non-standard”. Another instance of the THORChain devs leaving instructions for the hackers.

Governance

  1. "Staked capital drives the network direction (listed assets and chains)
  2. Developers respond to the network, delivering tested and validated code
  3. Nodes choose to run backwards-compatible software
  4. Nodes are anonymous and do not communicate, coordinate, or socially-signal
  5. Nodes are second-class citizens that service the network"

"The voting and delegation model is similar to systems seen in Tezos or Cosmos. THORChain validators can accept delegations from any RUNE token holder, thus boosting their overall stake and voting power. But block rewards get evenly distributed among validators, incentivizing delegators to seek out validators with a lower stake weight. The design aims to minimize voting power centralization at the top of the Validator Set (i.e., the top 100 validators). Prospective validators that exist outside of the top 100 are known are Standby Validators.

The Æsir protocol consists of two distinct layers. One allows for delegators to vote on proposals (or submit a proposal) inside of a Staking Pool. The other layer lets Validators "signal" the voting results from each Staking Pool to see if a network-wide change has either passed or failed.

The validator for each Staking Pool can vote on behalf of every active delegator should they choose not to participate. This mechanism "serves as a hybrid between direct and representative democracy." But the goal is to achieve 100% voter turnout within each pool. THORChain also plans to implement Quadratic Voting within Staking Pools to inhibit plutocracies. As part of the network's consensus mechanism, delegators can re-delegate at any time. Staking Pool votes must achieve a simple majority (51% threshold) to pass and move on to the Validator signaling stage.

As for the signaling layer, Validators will be able to read all current proposals as well as nominate their own changes each block. Unlike the Staking Pools, proposals at the Validator level must receive a supermajority (two-thirds or 67%) for the change to take effect. Validators that don't participate in the signaling period will get part of their stake slashed and redistributed to other Validators.

Validators can also implement a grace period prior to voting, depending on the severity of the proposed amendment. Similar to Tezos, THORChain validators can opt to run "sweeping architectural changes" on the project's testnet before implementing them to the mainnet."

  • From their docs (8-2020)

"THORChain aims to have as little governance baked into the system as possible. This is done so that nodes don't communicate or learn who one another are. This is important for security because it makes sure that nodes don't act together to take control.

THORChain governance decides:

  1. which assets are listed/delisted
  2. which chains are listed/delisted
  3. when the protocol gets upgraded
  4. the economic limit – how many nodes can participate

Emergency changes are difficult to coordinate because nodes cannot communicate. To handle an emergency, nodes should leave the system. When the number of nodes falls below 4, funds are paid out and the system can be shut-down. This process is called Ragnarök.

There are only so many nodes who can participate on the network. This is because there's a minimum bond amount and a fixed supply of Rune. If the system is ever found to be always under-bonded or over-bonded, the minimum bond limit can be changed."

DAO

Treasury

"The treasury comprises of $11m USD liquid and $14m in RUNE, total of $25m. The treasury is at $25m, sufficient for the roadmap. Community grants can be allocated. The Protocol Reserves total 212,108,851 RUNE, worth $742m. These are allocated for Chaosnet & Mainnet emissions, as well as community campaigns. The current project runway is at 18+ months and is more than sufficient. Planned Obsolescence is set for July 2022."

  • After the ETH bridge got attacked, it was decided that the treasury would make up for the lost funds. From their twitter (16-7-2021):

"The only entity that will wear the burden will be the THORChain treasury, approx $5m will be used to donate to ETH LPs. This is the purpose of the treasury during Chaosnet, to insure the network funds."

Token

Launch

"The sale ran on Binance DEX, a decentralized exchange launched by Binance on its blockchain network. THORChain sold 7 million RUNE (out of a proposed 20 million) during the IDO at an average price of $0.032, raising $224,000 worth of BNB in the process.

The project also completed a Seed round and a pre-sale before launching its IDO. The Seed round distributed 60 million RUNE priced at $0.01, while the pre-sale sold 70 million tokens at a 30% max discount compared to the IDO price (which was about $0.023)."

Token allocation

"RUNE initially had a 1 billion max supply when tokens were first minted in Jun. 2019. But in Oct. 2019, the project opted to burn all of the "unused" reserve RUNE, which, when combined with the tokens burned through Project Surtr, amounted to 50% of the initial max supply. The supply reduction did not impact the tokens already distributed to Pre-Sale and Initial DEX Offering (IDO) investors. The allocation of the original and post-burn amounts, along with their vesting schedules, are as follows

  1. Service nodes: 500 million (220,447,472 RUNE post-burn) to reward network validators and liquidity contributors
  2. Operational reserves (THORChain company): 130 million (65 million post-burn) to use for Staff incentives, other sales, and liquidity bootstrapping
  3. Community reserves (RUNEVault): 120 million (now 60 million)
  4. Team & Advisors: 100 million (now 50 million)
  5. Seed investors: 60 million (now 30 million)
  6. Pre-Sale (Private Sale) investors: 70 million
  7. Initial DEX Offering (IDO): 7 million (of the 20 million offered in the sale, 13 million went unsold and were later burned)

THORChain includes a few ongoing emission models to incentivize network participation:

  1. RUNEVault issues two million RUNE tokens each month as part of its staking rewards program. This issuance will continue until the Community reserves (60 million total tokens) runs out, which would allow the RUNEVault program to operate for about 2.5 years after its launch. Note that THORChain could revisit this model in the future with community input to reduce reserve emission.
  2. Service nodes and liquidity provisioners will receive monthly distributions equal to the below block rewards calculation. Two-thirds of this block reward will go to service nodes (aka validators), and the remaining third will go towards liquidity incentives. Block rewards will continue until this bucket's max supply of 220,447,472 RUNE is reached."
  • From their docs (8-2020)

"The emission curve is designed to start at around 30% APR and target 2% after 10 years. At that point, the majority of the revenue will come from fees."

Utility

  • From Messari (25-10-2020):

"Some uses for RUNE include:

1. Validators must stake RUNE to be part of the Validator Sets, which are subject to a lockup period to prevent nothing-at-stake attacks

2. All network transaction fees (gas or "fuel" for changing the protocol's ledger) are paid in RUNE. The network can require fees for executing transactions, trades, and cross-chain exchanges.

3. Staking RUNE in Continuous Liquidity Pools (CLPs) to earn on liquidity fees

4. Block rewards for Validator Nodes are paid in RUNE"

"RUNE as collateral needed to (a) earn the right as a nodes to process transactions and (b) provide liquidity. The hope is to be able to swap tokens in different chains (like BTC for ETH). For every $1 of swappable token in the network, protocol dictates at least $3 of staked RUNE is needed. Paid trading commissions + inflation goes to SNX stakers via dividend."

Token Details

Stablecoin

Tech

 How it works

  1. "All pools contain RUNE at a 50:50 ratio
  2. A single settlement asset means any two pools can be linked
  3. Only staked capital is secured, simplifying the economic security model
  4. Pools earn 1/3rd of the System Income"
  5. All nodes bond RUNE at a 2:1 ratio to staked RUNE
  6. Highest bonded nodes are churned-in to drive bonding rates
  7. Nodes are slashed if malicious behaviour is detected
  8. Nodes earn 2/3rds of the System Income"

On how it does cross chain tx:

  1. "THORChain observes transactions on external networks
  2. State is highly-validated: incorrect transactions are ignored or refunded
  3. Logic is applied to state changes, generating outgoing transactions
  4. Transactions are signed via a chain agnostic TSS protocol
  5. Outgoing transactions are broadcast back to the external network"

"THORChain is a Tendermint-based chain, which is the same architecture and consensus system first used by the Cosmos network. Tendermint employs its own BFT (Byzantine Fault Tolerance) consensus mechanism that relies on synchronicity. Therefore, like Cosmos, THORChain caps the number of validators (100 to start) in order to reach finality for each proposed block. It also supports a Proof-of-Stake consensus mechanism since Tendmint requires each Validator to have a weight on the network determined by the stake they hold.

The THORChain team plans to implement an adapted model of Bancor's "smart token" to create what it calls Continuous Liquidity Pools (CLPs). This system incentivizes participants to supply liquidity in exchange for fees and RUNE rewards. Traders can then access and exchange with these token pools directly, which gives CLPs an on-going supply of liquidity. The protocol also tracks the ratio of RUNE to the asset held in each CLP, which creates an inherent on-chain price feed for individual assets.

The Bifröst Protocol is THORChain's cross-chain bridging system. The protocol leverages THORChain's Proof-of-Stake (PoS) validator set, the on-chain price feeds generated by CLPs, multi-signature (multi-sig) accounts to create and secure these bridges. Every bridge uses validating parties to verify transactions. But the multi-sig system randomly assigns validators to each transaction to limit centralization concerns. Each bridge is customizable, where the end-user determines the number of parties required to sign-off on a transaction (a three-of-four multi-sig arrangement is less secure but faster than a 20-of-21 schema). The Bifröst Protocol also uses the on-chain price feeds created by CLPs to give each bridge a security profile (how likely is a bridge to fail) and to identify and punish bridge validators that act against the network's rules.

The Yggdrasil Protocol is a sharding mechanism designed to help scale THORChain. Unlike more traditional sharding applications, which split items into horizontal components, the Yggdrasil Protocol uses a vertical sharding technique on entire chains. The team says this technique allows THORChain to apply sharding to cross-chain ecosystems, as opposed to sharding an existing chain. As for shard consensus, THORChain does not engage the full Validator Set to monitor each shard. Only a subset of validators will finalize cross-shard transactions. But the others will be able to monitor the consensus reached on every shard."

"When a user trades, she is sending in Coin A and receiving Coin B from a liquidity pool. To make this work across chains, however, there is a third user group, THORChain Nodes, and this is where THORChain diverges from Uniswap. Node Operators (User Group C): These users run THORnodes, which comprise the THORChain Node (Tendermint/Cosmos SDK), and a node for each supported chain. A node operator will thus be running a Bitcoin node, Ethereum node, etc. Instead of the keys being held by a central custodian, they are held in a multi-sig arrangement of the THORChain Nodes (technically Threshold Signatures).

When a user trades ETH to BTC, the validating nodes will first detect and agree that ETH has been received in the ETH vault (remember, they’re running Ethereum nodes). They then collectively sign the outbound BTC transaction to the user from their Bitcoin nodes. 2/3 of the nodes have to approve any outbound transaction.

Today, there are around 35 such validating nodes. Over time, it’s expected this number will increase to over 100. The only requirement to be a validating node is to outbid others for the privilege. Once your THORnode becomes active, you earn revenue for up to a month before you’re kicked out of the set once again (THORnodes are churning in and out every couple days). Consider too that these validators are anonymous by design and the set churns (as do the wallets) every couple of days to mitigate jurisdictional capture and surveillance.

Additionally, every outbound transaction from a vault is signed by a randomized subset of the total validators. This means nobody, not even the validators themselves, know which transactions are signed by whom.

THORChain’s security model relies on proof-of-bond. By posting bond, it keeps validating THORChain Nodes honest. More accurately, it penalizes them harshly for misbehavior. THORnodes are strongly incentivized to post an amount of RUNE as bond that approaches 2x the value of all native assets in the liquidity pools.

If they don’t, the THORChain system becomes “underbonded,” and the system starts channeling trading fees away from LPs and toward THORnodes. This has the obvious effect of making it less profitable to provide liquidity and more profitable to run a node. Eventually, liquidity recedes and the bidding war among nodes brings more RUNE into the total bond. As more RUNE is bonded by the nodes competing for the increased share of trade fee revenue, the system self-corrects. Nature has healed, and equilibrium is again achieved among anonymous, profit-seeking parties.

The opposite can also happen: if too much RUNE is bonded by nodes, the system starts channeling trading fees back to the LPs, away from nodes. Eventually, this draws in more liquidity (because it’s more profitable to provide it) and the THORnodes start bidding less for inclusion in the validator set (because that capital now earns less).

This mechanism — in which the trading fee revenue adjusts automatically between LPs and Thornode operators — is called the “Incentive Pendulum.” It is a unique aspect of THORChain’s design, not shared by any other DEX to my knowledge."

Fee Mechanism

Upgrades

Staking

  • From Messari (25-10-2020):

"THORChain is a Tendermint-based chain, and therefore uses Tendermint BFT (Byzantine Fault Tolerance) as its consensus mechanism. It also employs Proof-of-Stake (PoS) for Sybil resistance. As part of the PoS element, a system of validators can stake RUNE tokens to run network nodes and validate transactions. THORChain allows token holders to delegate to these validators, which keeps validators in check and permits delegators to a portion of each block reward."

  1. "Nodes compete to enter with bonded capital
  2. Nodes earn 2/3rds of the System Income
  3. The system churns nodes every 3 days, ensuring liveness and preventing capture
  4. Nodes are anonymous and cannot corrupt the system"
  • From their docs (8-2020)

"There are only so many nodes who can participate on the network. This is because there's a minimum bond amount and a fixed supply of Rune. If the system is ever found to be always under-bonded or over-bonded, the minimum bond limit can be changed."

  • From their docs (10-2020)

"THORNodes service the THORChain network, of which there is intended to be initially 99. Each THORNode is comprised of several independent servers in a cluster. All THORNodes communicate and operate in cooperation to create a cross-chain swapping network."

Liquidity Mining

  1. "Stake in existing pools, or add new ones
  2. Liquidity providers earn fees and block rewards
  3. Liquidity is always on-chain and never “pegged” or “wrapped
  4. Staked capital is always underwritten by the system"

Scaling

  • Has no plans on Layer Two scaling but does talk about scalability (25-10-2020):
  1. "Liquidity is sharded into realms to reduce signing committee sizes
  2. Liquidity is delegated into smaller vaults for faster signing
  3. Base infrastructure is Tendermint (100+ Nodes possible)
  4. Chains and Assets added via economic weight
  5. High performance CosmosSDK replicated state machine"

Different Implementations

Interoperability

Other Details 

Oracle Method

Privacy Method

Compliance

Their Other Projects

ASGARDEX

  • From the docs (2-2021):

"ASGARDEX will be the primary exchange to stake and trade assets on THORChain once mainnet goes live. It is a desktop wallet/exchange, and is similar to BEPSwap, but it will allow users to unlock multiple wallets (Binance Chain, Ethereum, Bitcoin, etc...) simultaneously in order to make it easy to swap assets across chains.

It is a reference implementation of an exchange/wallet on top of the THORChain network. Anyone can create their own exchange on top of THORChain. Any CEX/DEX, yield farm, protocol, etc. will be able to tap into the power of THORChain if they wish. And since THORChain is one-of-a-kind, they will."

BEPSwap

"It is also building a Uniswap-like decentralized exchange on Binance Chain, called BEPSwap."


Roadmap

  • Can be found here (25-10-2020).
  • From their blog (22-10-2020):

"The team plan to hand over full control of the protocol, github, socials and its treasury around 21 months (~July 2022) and when the following is hit:

  1. Mainnet + 4–5 chains
  2. Decentralised (team do not run any nodes)
  3. Adequate community support (wallets, exchanges, dashboards, bots)

Any treasury at that point will be added back to the protocol’s reserve where it will pay out to Nodes and Liquidity Providers."

"Short Term - 2-3 weeks - stability. Increase number of nodes, raise the caps. Onboard more wallets, improve docs, tweak UIs.

Medium Term: 1 month away: Bifrost: * DogeCoin, XHV, Solana, Polkadot, are all not too far away from being turned on. Ecosystem: * More wallets! THORFi: * Enable Synths cc @Brokkrfinance

Medium Term: 2-3 months: Grow to 5 more chains (minimum), 40+ nodes, 50+ assets. There should be 5-10 interfaces to choose from. THORFi: * Lending - this is a HUGE feature. Assuming stable: Mainnet and purge of Mimir

Long Term: 6+ months 10-15 chains, 100 nodes, 100 pools THORFi: THOR.USD, Composites

12+ Months: Finalise the process of decentralisation, begin the process of distributing the treasury out to community teams.

15 months: Planned Obsolescence. Community run, own and manage the treasury and protocol."

Usage

  • From their website (29-3-2021): $1B vol in 138 days.
  • A Gauntlet report stress-tested the incentive pendulum under a variety of market conditions and shows that the existing choices leads to a stable and healthy system. THORchain has already accrued over $85M of TVL on Chaosnet.
  • From Our Network (7-4-2021):

"Over the past two weeks, Thorchain has approximately averaged a daily volume of $1.5 million in assets (such as BNB, USDT, SUSHI, etc), including those in its cross-chain asset swap functionality. RUNE, Thorchain’s governance token, averages 1 million in daily volume and comprises 50% of the volume on the network. Thorchain reached nearly 670 million TVL on May 7th, 11th below DEXes such as Nerve and Raydium and above 1inch and dYdX. Across all DeFi protocols it is 35th in TVL. While not the highest ranking by TVL, Thorchain managed to double their TVL in just over one month."

Projects that use or built on it

Competition

"May compete with REN in instances like (ETH – renBTC – BTC vs. ETH – BTC), and at the same time renBTC / BTC swap on Thorchain would be interesting when launched (could be cheaper to circumvent 0.1% renBTC burn fee)."

Coin Distribution

Pros and Cons

Pros

  • If successful, could be the first 1-touch non-custodial swap of tokens across different chains. (4-7-2020)

Cons

 Team, Funding, Partners

Team

  • Full team can be found [here].
  • From their website (25-10-2020): "The team is mostly pseudo-anonymous to protect the project"
  • 'JP' a 'THORChain Researcher'

Funding

  • From their docs (9-2020):

"All fees go back to users. There is no revenue model for the team via the protocol. All swap fees go to liquidity providers, all protocol fees are burned, emissions/block rewards go to validators. The team are incentivised through holding the same RUNE as everyone else."

  • From their blog (22-10-2020):

"The treasury is at $9.2m, sufficient for a +36 month Runway. All team members are paid 70% in USDT and 30% in RUNE for alignment with the project. Community grants can be allocated. The Protocol Reserves total 219,128,600 RUNE, worth $135m. These are allocated for Chaosnet and Mainnet emissions." 

  • From their blog (1-2-2021):

"The treasury comprises of $11m USD liquid and $14m in RUNE, total of $25m. The treasury is at $25m, sufficient for the roadmap. Community grants can be allocated. The Protocol Reserves total 212,108,851 RUNE, worth $742m. These are allocated for Chaosnet & Mainnet emissions, as well as community campaigns. The current project runway is at 18+ months and is more than sufficient. Planned Obsolescence is set for July 2022."

Partners 

(:

Knowledge empowers us all and will help us get closer to the decentralised world we all want to live in!

Making these free wiki pages is fun but takes a lot of effort and time.

If you have enjoyed reading, tips are appreciated :) This will help us to keep expanding this archive of information.

RUNE tip address: bnb13ps9k4jf3purxetcuxvz74w6yuncq8yxkycfpu