Token Conversion
Introduction
Since the Ethermint module on Carbon is built as a Cosmos-SDK module, it exists in isolation from the rest of Carbon Core.
That means that most tokens on Carbon exists in two different representations:
Tokens that are bridged into Carbon by the canonical bridges (IBC, PolyNetwork) are represented by the ICS-20 standard. These tokens are Cosmos-native and IBC-enabled by default.
Tokens created on Carbon EVM by developers are typically represented by the ERC20 standard. These tokens cannot be transferred out via IBC or interacted with on Carbon without conversion.
This is because ICS-20 tokens are held on the x/bank
module in Carbon Core, while ERC-20 tokens live within smart contracts on Carbon EVM (x/evm
).
In order for ICS-20 tokens (e.g. $OSMO) to be used in the EVM module, and for deployed ERC20 contracts to be used in Carbon, the Token Conversion module must be used.
This then allows tokens to become fully interoperable throughout Carbon, as well as the greater IBC ecosystem.
Note that the Carbon ($SWTH) token is natively cross-compatible, and this module is not required to convert $SWTH between its ICS-20 and ERC-20 representations. $SWTH is the only token that exists in both representations at the same time (think superposition).
How It Works
The module enables a permissionless, trustless, on-chain bidirectional conversion of tokens between Carbon EVM and Carbon Core.
Specifcally, it allows any token on Carbon to be instantaneously converted to ERC-20 tokens on within EVM. Likewise, any ERC-20 token (even those deployed by public developers) can be converted into an ICS-20 token (which then can be IBC-ed to other chains).
At all times, the end-user (token holder) maintains ownership of the token, and the two asset representations are fungible with each other.
Signficance
With the ERC-20 module, users on Carbon can:
use existing native Cosmos assets (such as $OSMO or $ATOM) on EVM-based dApps, e.g. for trading IBC tokens and buying NFTs on a Uniswap-like dApp, etc.
transfer existing tokens on EVM-based chains to Carbon to take advantage of application-specific chains in the Cosmos ecosystem via IBC
build new applications that are based on ERC-20 smart contracts and have native access to the IBC assets in the Cosmos ecosystem
Last updated