Weekly Dev Update #77

THORChain Weekly Dev Update for Week 77, 12–18 Jan; BitcoinCash, Litecoin, ETH Router finalisation, Midgard Updates.

Weekly Dev Update #77

Summary

Ethereum and BitcoinCash continue to be validated, edge cases found and fixed. Cosmos 0.40 updated. Litecoin support was added.

Ethereum Router

The ETH Router is finalised, so the design can be discussed.

  1. User requests an Asgard vault (there can be multiple) from THORChain, as well as the location of the Router (it can change).
  2. User makes a router.deposit(asgard, asset, amount, memo) call (for either ETH or ERC20). The assets are moved in, credited to the vault, and an event is emitted. ETH is forwarded to the asgard, ERC20s stay in the router, but can only be moved by the credited vault (tracked as an allowance-to-spend).
  3. Bifröst picks up on the Event and broadcasts to THORChain. THORChain processes business logic as normal.
  4. On a txOut the Bifrost prepares an outgoing transaction router.transferOut(recipient, asset, amount, memo) (for either ETH or ERC-20) and broadcasts this. ETH is moved from the node, ERC-20 is spent using the allowance-to-spend.
  5. For yggdrasil funding and migrations, the vaults simply credit each other with allowance-to-spends, which increments/decrements. ETH is moved, but ERC-20s actually do not move anywhere, they stay in the router.
  6. For upgrading, the same methods are re-used from (5), but this time a new router address is specified, which cause funds to be moved out and sent to the new router.

The attack surface is really narrow — the contract isn’t owned by anyone, and all calls are public. The entire contract is 141 LoC including interfaces and comments. ETH always lives on the asgard/yggdrasil vault, and ERC20 always lives in the Router, with an allowance-to-spend. The full lifecycle of an asset is:User -> Router: {Asgard allowance <-> Yggdrasil allowance} -> User

You can review the Router code here:
https://gitlab.com/thorchain/ethereum/eth-router/-/blob/master/contracts/Router.sol

Cosmos Stargate

Cosmos Stargate was merged — this brought in the following:

  1. Inter-Blockchain Communication (IBC)– cross-chain transactions
  2. Protobuf Migration — blockchain performance & dev acceleration
  3. State Sync — minutes to sync new nodes
  4. Full-Featured Light Clients
  5. Chain Upgrade Module — upgrade automation

THORChain can already start benefitting from (2), (3) and (4), with more work to do to flesh out (1) — IBC.

THORNode

Multichain patches, along with the huge merge that was Cosmos 0.40 “stargate” (5000 LOC, 400+ files changed). As well as validating the ETH router smart contract upgrade path (funds are migrated from the old router to a new router when specified).

Midgard

Work continues to prep Midgard V2 to handle Multichain requirements.

Bridges

Actively-developed bridges will be reported here going forward. Bridges are commissioned once a team who can implement is identified and work begins.

  • Bitcoin: Complete, edge case testing on live testnet
  • Ethereum: Complete, prepping for testnet
  • BitcoinCash: Complete, prepping for testnet
  • Litecoin: Complete, prepping for testnet
  • Cosmos: Under review — considering moving to IBC implementation
  • Haven: Under implementation — work focusses on solving EDDSA MSig
  • Polkadot: Under implementation — some hurdles to cross with bifrost state sync.

Clients

BEPSwap Client

Numerous UI/UX tweaks based on community feedback

ASGARDEX Client

Work continues to prepare the client for Multichain Chaosnet.

Community Work

The following tools receive regular updates:

Telegram Bot

@thornode_testnet_bot

@thornode_chaosnet_bot

Twitter Bot

https://twitter.com/thor_bot

Delphi Defi Dashboard

https://defi.delphidigital.io/thorchain/chaosnet/network

THORChain Network Explorer

Continual Improvements, now with custom sub-domains for each net:

https://thorchain.net/

https://testnet.thorchain.net/

https://multichain-testnet.thorchain.net/

THORChain Official Block Explorer

https://viewblock.io/thorchain

THORChain Dashboard (ViewBlock)

https://dash.viewblock.io/d/thorchain

RUNEData

View historical yield and simulate future yield in pools:

http://www.runedata.info/

RUNEBalance

View current arbitrage opportunities in the pools. New card-style overviews.

https://www.runebalance.com/#/pools

RUNEStake

RUNEStake can be used to see yield in THORChain liquidity pools.

https://runestake.info/

Trading Leaderboard

View the current leaderboard for traders on THORChain

https://leaderboard.thornode.org/

GrassRootsCrypto Youtube

GrassRootsCrypto consistently puts out great educational videos on THORChain, users should subscribe and bookmark the channel.

https://www.youtube.com/channel/UCuC_PiCEsNIT6HH88r7vCsw/videos

Next Milestones

Multi-chain Testnet with Native Rune is deployed and being stabilised. The next milestone is to re-deploy with Ethereum, BitcoinCash, Litecoin and 0.40 update.

You can view the live network here:

http://18.198.92.45:1317/thorchain/doc/

Community

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