Weekly Dev Update #14

THORChain Weekly Dev Update for Week 22–28 Oct 2019

THORChain
THORChain
6 min readOct 28, 2019

--

BEPSwap Goes Cross-chain

BEPSwap is THORChain’s first go-to market product, built on a statechain to Binance Chain. BEPSwap was intended to only support BEP2 assets to minimise complexity with external chains.

Two recent breakthroughs made by the THORChain development team in how to consider the cross-chain environment, as well as increasing the number of consensus participants, mean the team have now re-considered the scope of mainnet launch.

Instead of launching the BEPSwap chain and decommissioning/hard-forking it into the THORChain mainnet, the team believe a network that supports cross-chain from the start can be built now. As such, THORChain will be launched, with support for Binance Chain, Bitcoin and Ethereum at Genesis. Binance Chain assets will be immediately supported, with Bitcoin and Ethereum enabled sometime in 2020. This will prevent large changes needing to occur post-mainnet launch.

These two breakthroughs will be discussed in a future blog, but the team describe them as “Cross-chain Pools” and “Asynchronous Liquidity Delegation”.

Cross-chain Pools.

Cross-chain pools solve two key problems:

  1. Security
  2. User Experience.

The first is that the network only holds assets that are in pools which are staked against Rune. This massively simpifies the attack surface of the network, since the network only needs to ensure that the amount of bonded Rune is always double the amount of staked Rune. This means that even if network participants *could* attack the network, they wouldn’t, because they can only steal 50% of what they bonded. Thus no rational actor would steal external assets.

The second characteristic is the User Experience, in that neither pegged tokens, nor atomic swaps are used. Users who wish to swap BTC to ETH send in on-chain BTC, and will receive on-chain ETH immediately (and vice versa). The target speed for BTC->ETH will be 20 seconds. The target speed for ETH->BTC will be 10 minutes (1 block).

Users who wish to stake, will stake on-chain BTC with on-chain Rune. Withdrawing their assets will mean they receive on-chain BTC and on-chain Rune. No pegging out, and no pegging in.

Asynchronous Liquidity Delegation.

The second breakthrough is how liquidity is managed in the system. The initial design had a single large Threshold Signature pool that held all the funds. While extremely secure, large committee memberships mean very long signing speeds (minutes for 67/100), which impacts the user experience. The team wish to target a signing speed of less than 5 seconds, which means TSS pools should be less than 11 participants.

However, due to the incentive structure created by Cross-chain pools, no node has an incentive to steal assets — even if they were given individual custody of assets. This is because they are always bonding twice as much Rune as there is Rune staked in pools. A node that “exit-scams” the network is the equivalent to simply selling 50% of their bonded Rune to assets and leaving disorderly. The network can rebuild the pools by simply disbursing the node’s abandoned bond back into the pools, and churning in a new node. Thus it is resilient to even internal attacks. This setup even works for a node that goes offline — while offline they are unable to respond and they get “fined” from their bond for every transaction they couldn’t honour in a timely fashion.

The final design is a large TSS pool that acts as a global custodian of bonded assets and incoming liquidity ( 22 of 33 is the initial target number), with 11 2 of 3 “satellite” pools which hold 50% of the staked assets. This means nodes can be delegated to asynchronously send out liquidity (swaps and withdrawals) with the signing speed of 2 of 3, but the security of 22 of 33.

Over time, the team will target 200 of 300 nodes, with 100 2 of 3 satellite pools.

BEPSwap Development

The team are working on 4 parallel streams of effort. Cross-chain infrastructure has now been merged into a single repo called “THORNode”.

  1. THORChain
  2. Threshold Signature Scheme implementation
  3. Front-end Integration for BEPSwap
  4. Other development activities

StateChain

A lot of new work was done to make the statechain cross-chain, with agnostic treatment to chain data. The first three chains will be BNB, BTC and ETH. A global re-factor of naming conventions surrounding cross-chain assets was made.

Assets will now be referred to as: CHAIN.SYMBOL

FrontEnd

Based on community feedback, the front-end is being refreshed. A lot of the past weeks updates were fixing small bugs and implementing the fresh design:

Swap Home Page
Swap Detail View
Swap Confirmation
Stake Detail View

Threshold Signature Scheme implementation

Work was done to clean up the code for peer-review, as well as implementing whitelisting for key-generation procedure.

The TSS implementation is being integrated into the Statechain this week, in time to validate Asgard churn.

Whats Next?

To ship mainnet, the team are aiming for this:

Frontend:

Feature complete with excellent swapping and staking experience.

Chain Service:

Feature complete public RESTful API.

Statechain:

Feature complete with 22 of 33 Asgard, weekly churn, 2 of 3 satellite pools, asynchronous liquidity delegation and cross-chain support.

Timelines

The team are working for these milestones.

Other Development:

  • RUNEVault: July 2019 shipped
  • Telegram Bot: August 2019 shipped
  • Bep2Bot: August 2019 shipped

BEPSwap:

  • Testnet: August 2019 shipped
  • Community Testing: shipped

THORChain:

  • Internal Freeze: 20 November 2019 on-time
  • Audit: 20 December 2019 on-time
  • Genesis: 03 January 2020 on-time

Community

To keep up to date, please monitor community channels, particularly Telegram and Twitter:

--

--

THORChain
THORChain

The official team for THORChain — the decentralized liquidity network.