iotubeproject / ioTube

:satellite: A multi-assets, fully decentralized bridge for exchanging ERC20/BEP20/XRC20 tokens between Ethereum, Binance Smart Chain and IoTeX
https://iotube.org/
Apache License 2.0
115 stars 26 forks source link

tests

ioTube - the decentralized bridge for Ethereum, Binance Smart Chain, Polygon(Matic) and IoTeX

Version history

V1.0 IOTX tube

Launch date: Apr 2019 (Announcement)

The first version of ioTube was built by core-dev in Apr. 2019 to facilitate the swap of IOTX-E (ERC20 version of IOTX on Ethereum) and IOTX mainnet token.

V2.0 Multi Token Tube (IoTeX <-> Ethereum)

Launch date: Aug 31, 2020 (Announcement)

V2 generalizes the ioTube V1 to support multiple assets on Ethereum & IoTeX blockchains.

V3.0 Rebuilt with largely fee reduction

Launch date: Feb 8, 2021 (Announcement)

Ethereum has been suffering high gas cost for a long period. The core-dev team rebuilt ioTube to largely reduced the gas cost on ETH side by introducing a relayer and putting signature offchain.

V4.0 Multi-Chain support

Launch date: Apr 13, 2021 (Annoucement)

Because of Ethereum's high gas cost, many projects and users also adopted Binance Smart Chain (BSC) and Huobi Eco Chain (Heco). The need of supporting BSC and Heco is increasing. The demand of cross-chain support from Ethereum and BSC or other blockchains are increasing. We'd love to support them in ioTube.

Matic support is launched on Jun 10, 2021 (Annoucement)

V5.0 Web3 (Babel) Support + Transactions + More Assets + Crosschain Tokens

Beta is open to public: https://tube-v5.iotex.io/

Any bug report or feedback? Please submit an issue or discuss in https://discord.gg/jRqqSyGfUD.

Deployement | Usage | Documentation

 

Submit a token to ioTube?

Please refer to token submission guide first: https://docs.iotube.org/introduction/token-submission

Feel free to reach out to https://github.com/guo for further discussion.

Deployment

Different from traditional bridges, ioTube comes with two components:

Deploy Contracts on IoTeX/Ethereum

Join as a Relayer

  1. Edit witness-service/relayer-config-iotex.yaml and witness-service/relayer-config-ethereum.yaml to fill in the following fields:

    • privateKey
    • clientURL
    • validatorContractAddress
  2. start containers

    cd witness-service
    ./start_relayer.sh

Join as a Witness

  1. Edit witness-service/witness-config-iotex.yaml and witness-service/witness-config-ethereum.yaml to fill in the following fields:

    • privateKey
    • clientURL
    • validatorContractAddress
    • cashierContractAddress
  2. start containers

    cd witness-service
    ./start_witness.sh
  3. Clean up everything by running

    ./clean-all.sh

Transfer assets between IoTeX and Ethereum

Please use dApp ioTube https://tube.iotex.io. Please note that the service is still in beta mode.

From ERC20 to XRC20

  1. open https://tube.iotex.io/eth in a metamask installed browser. (eg. Firefox/Chrome/Brave + metamask)
  2. Choose supported ERC20 token from the list.
  3. Enter the amount.
  4. Click Approve button to approve ERC20 token transfer and sign on metamask.
  5. Click Convert button and sign on metamask.
  6. After 12 confirmations of Ethereum network and 2/3 + 1 confirmations from witnesses, the XRC20 tokens will be minted and sent to your IoTeX address.
  7. You can add the token to your ioPay to see and use them.

From XRC20 to ERC20

  1. open https://tube.iotex.io/iotx in ioPay desktop supported broswers (eg. Chrome/Firefox/Brave with ioPay desktop installed) or ioPay Android/iOS.
  2. Choose supported XRC20 token from the list.
  3. Enter the amount.
  4. Click Approve button to approve XRC20 token transfer and sign on ioPay.
  5. Click Convert button and sign on ioPay.
  6. After 1 confirmation of IoTeX network and 2/3 + 1 confirmations from witnesses, the XRC20 token will be burnt and ERC20 token will be sent to your ETH wallet.

Fees

Tube fees: 0

Network fees:

  1. from ERC20 to XRC20: 0
  2. from XRC20 to ERC20: 2000 IOTX (to cover the high ETH gas fee for witnesses)

Add an ERC20 token to ioTube

Security

Gas Costs

Gas fees on IoTeX are negligible, both for bridge maintenance and for asset transfer. The estimated gas fees on Ethereum side are:

Tube of IoTeX <-> Ethereum

Contracts on IoTeX

Contacts on Ethereum

Tube of IoTeX <-> BSC (Binance Smart Chain)

IoTeX Side

BSC Side

Tube of IoTeX <-> Heco (Huobi Eco Chain)

Please note this is still being added. They are not in production use yet. Please contact us if you want to use them without interfaces.

IoTeX Side:

Heco Side:

Tube of IoTeX <-> Polygon (formerly Matic)

Launched on Jun 10, 2021.

We started adding 0x address to this doc because of IoTeX start supporting 0x address and web3 from IoTeX V1.2 (Babel API). Some IoTeX address are same as other tubes and we include 0x addresses here.

IoTeX side:

Matic side:

Crosschain IOTX (WIP)