Start building with ZetaChain

Start building with ZetaChain

At a high level, ZetaChain is a Proof of Stake (PoS) blockchain developed using the Cosmos SDK and Comet BFT consensus engine. As a result, ZetaChain enjoys fast block time and instant finality.

ZetaChain hosts an Ethereum Virtual Machine (EVM) compatible execution layer called the Universal EVM. In addition to supporting all EVM features and standard interactions (such as contract creation, contract interaction, and contract composition), ZetaChain's EVM is connected to the Chain Abstraction Framework (CAF), which enables omnichain connectivity of the network to any blockchain.

Thanks to CAF, ZetaChain's EVM can be called from any chain, manage native assets on any chain, and access asynchronous arbitrary messaging to call contracts on other chains. Developing with the CAF offers the ability to build robust state management combined with multi-leg, multi-chain apps' needs, all in the familiar EVM development environment.

ZetaChain offers two ways to develop dApps: omnichain contracts and cross-chain message passing.

Omnichain Contracts

With omnichain contracts you deploy a single omnichain contract to ZetaChain.

Omnichain contracts can:

  • Accept deposits from users on connected chains (e.g., Ethereum, Binance Smart Chain, Bitcoin). A deposit may contain:
    • a native gas or supported ERC-20 token. Tokens (both gas and ERC-20) are deposited into omnichain contracts as ZRC-20 tokens.
    • a message with an arbitrary data.
  • Execute logic based on the deposits
  • Create outbound transactions to withdraw ZRC-20 to connected chains as native assets. A single omnichain contract call can result in multiple outbound transactions to different chains.

Ability to accept inputs (native gas, supported ERC-20, and arbitrary data) from users on connected chains, execute custom logic and create outputs (tokens withdrawals) to connected chains makes ZetaChain omnichain contracts a powerful tool for building interoperable apps that span multiple chains.

Advantages of omnichain contracts

Developers can extend common applications like Uniswap V2/V3, Curve, Aave, and Compound by making them compatible with ZRC-20. These applications have been audited and battle-tested on Ethereum and can easily be deployed and built on ZetaChain. The changes required to add ZRC-20 support are minimal, and users may interact with these applications in single-step transactions just as they would on Ethereum.

ZRC-20 can easily support Bitcoin/Dogecoin which do not have capability or efficiency to support general purpose smart contracts for applications like swapping, lending, etc.

ZRC-20 may cost significantly less gas than message passing in many use cases because its interactions with foreign chains are confined to fungible coins (standard value transfer of ETH/BNB/MATIC costs 21k gas, moving ERC20 tokens costs around 60k gas; no logic/state on foreign chains means much less gas).

With omnichain smart contracts, you can pair and trade native asset liquidity directly against each other. This minimizes steps to trade native assets in a single step, and it doesn't involve a bridge or wrapping step or sending complex messages. For example, you could trade Ethereum ETH directly for Polygon USDC through a unified pool in a single transaction.

With ZRC-20/zEVM, exception/revert handling is much simpler as foreign interaction is confined to either a standard ERC-20/contract interaction (success) or no contract interaction (failure) immediately.

Cross-Chain Message Passing

With cross-chain message (CCM) passing you deploy CCM-enabled contracts on connected chains that can pass arbitrary message data and value between each other.

On a connected chain a user can call a CCM-enabled contract. The contract calls the Connector API and sends a message. ZetaChain acts as a relayer and transmits the message to the destination chain. On the destination chain a CCM-enabled contract uses the Connector API to receive the message and handles it.

The state is stored on a set of CCM-enabled contracts on different chains.

CCM makes sense for applications that only need unidirectional and asynchronous logic/effects and that don't need or benefit from a unified state.

Advantages of cross-chain message passing

CCM supports any type of data transfer and it's up to the contracts to decide how to handle the data.

CCM is a reliable general purpose solution for augmenting existing applications with cross-chain functionality.

With messages, you can leverage existing liquidity like Uniswap pools on existing chains, and trade via burning/minting ZETA through ZetaChain. This approach may be more complex (more transactions involved, more gas), but doesn't rely on liquidity within ZetaChain's ecosystem.

By leveraging the ZETA burn/mint functionality built into ZetaChain, one can build value-transfer applications that don't bridge/wrap assets, minimizing risk for users.