ERC-20 Bridging

The Arbitrum Chain (Layer 2, L2) hosts a variety of ERC-20 tokens, such as WETH and UNI. These assets can be permissionlessly bridged to dKargo Chain (Layer 3, L3) using the dKargo Token Bridge.

The process of bridging ERC-20 tokens from Arbitrum to dKargo Chain follows a different procedure than bridging DKA native tokens.

Design Rationale: Token Bridge

The Token Bridge is a dApp deployed on both Arbitrum Chain and dKargo Chain, facilitating secure and trustless ERC-20 token bridging. It utilizes Arbitrum's cross-chain messaging system (retryable tickets) to ensure reliability.

The dKargo Token Bridge is built on Offchain Labs' Canonical Bridge, a well-established solution that has already bridged hundreds of ERC-20 tokens on Arbitrum, ensuring high security and seamless user experience.

Canonical token bridge implementation

The Token Bridge consists of three key contracts:

  1. ERC-20 Contract

  • Implements the ERC-20 standard for token operations.

  • Deployed as paired contracts on both L2 and L3.

  1. Gateways Contract

  • Pairs ERC-20 contracts between L2 and L3, facilitating deposit and withdrawal messages between the two chains.

  • L2 Gateway

    • Locks tokens during deposits.

    • Releases tokens during withdrawals.

  • L3 Gateway

    • Mints tokens upon deposits.

    • Burns tokens upon withdrawals.

  1. Gateway Routers Contract

  • Handles all deposit and withdrawal requests from users.

  • Routes transactions to the appropriate Gateway contract assigned to each token.

The following guide explains how to use the DKA Bridge using functions provided by @dkargo/sdk.

Get Started with Token Bridging

To use the dKargo Token Bridge, three gateway options are available depending on the token type:

Developers and project builders can choose one of these options based on their project requirements or ERC-20 token characteristics to provide liquidity from Arbitrum to dKargo Chain.

Reference

Offchain Labs Token Bridge Contract

The bridge between Arbitrum and dKargo operates using a mechanism similar to Offchain Labs`s Token Bridge.

For a deeper technical analysis, refer to Arbitrum’s documentation.

@dKargo/sdk tutorial

By using the dKargo SDK, developers can integrate Token bridging functionality directly into their applications.

The dkargo-tutorials repository provides detailed instructions on how to use the dKargo SDK with ethers.ts and hardhat.ts.

Last updated