zeta-chain / node

ZetaChain’s blockchain node and an observer validator client
https://zetachain.com
MIT License
169 stars 108 forks source link

Allow to create a ZetaChain native ZRC20 that can be used on any chain #2740

Open lumtis opened 3 months ago

lumtis commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently ZRC20 represents an existing asset (native token or ERC20) from an external chains. The asset is whitelisted and can be deposited/withdrawed from/to the same connected chain.

This idea is about allow minted "ZetaChain Native" ZRC20. The ZRC20 is minted on ZetaChain and can be withdrawn to any connected EVM chains (eventually on non-EVM chains that support fungible token)

Describe the solution you'd like

Creation

Best way to create a new ZRC20 would be to do it directly at the EVM level. This would requires at least precompiled: https://github.com/zeta-chain/node/issues/2403

A stateful precompiled allows to create a new ZRC20. It would interact with the fungible module to create the new asset in the ZetaChain store.

Condition for creation TBD.

TBD:

External chain

ERC20Custody is used to store reserve of existing ERC20Custody.

This feature would require a new contract (asset handler) to address minting/burning the tokens.

We can call it ZRC20Connector, this allows to keep consistency with the ZetaConnector contract, implying connector contract are used to connect with ZetaChain native tokens.

Protocol

The ZetaClient will have to sign transaction into the ZRC20Connector above to handle outbounds.

lumtis commented 2 months ago

Consideration migrate to an existing ERC20 to a ZRC20 directly on ZetaChain