Building cross-chain DEX, Restaking, BTC staking as an Omnichain Smart Contract on ZetaChain

Check out this blog post in español, 简体中文, 繁體中文, 日本語, हिंदी, 한국어, tiếng-việt, deutsch, português, français, русский, українська, persian, türkçe, indonesian, filipino, and italiano (non-English translations are created by the community, not ZetaChain).

ZetaChain’s mission is to serve as a platform for universal access, simplicity, and utility across any blockchain. With Omnichain Smart Contracts, developers can deploy EVM-compatible smart contracts that are interoperable across any chain — even non-smart chains like Bitcoin — all from one place. From the DEX THORChain to ETH restaking protocol EigenLayer and BTC staking protocol BabylonChain — developers do not need to build new blockchains. They can easily support these use cases as an Omnichain Smart Contract on ZetaChain.

Build THORChain and more on ZetaChain

THORChain is an application-specific blockchain designed to be a DEX. It uses a Threshold Signature Scheme (TSS) architecture to enable trustless swapping of Bitcoin for DeFi assets on other chains. ZetaChain employs a similar TSS architecture to natively sign and manage assets on other chains, but it lets developers freely use it through a programmable smart contract layer.

The ZetaChain platform lets you build a functionally similar DEX to THORChain on ZetaChain. For example, in diagram one, you can implement a Uniswap with pools of tokens that exist on disparate chains. This is what omnichain DEX Eddy Finance does to enable native BTC swapping for tokens on other chains in one step. Another example is SushiSwap who deployed its EVM contract out-of-the-box to enable Bitcoin interoperability. Learn more in the press release here.

Diagram 1: UniswapV2 contract for cross-chain DEX

A cross-chain DEX is just one example of an Omnichain dApp. With general message passing and Omnichain Smart Contracts, developers could build NFT projects, DeFi apps such as lending, portfolio management, Bitcoin collateralization, and social apps and games that directly interact with any chain and asset.

ZetaChain can be thought of as a more generalized platform not only for native asset swapping, but also the easy creation of arbitrary cross-chain applications.

Deploy EigenLayer as an Omnichain dApp on ZetaChain

EigenLayer protocol on Ethereum introduces the concept of restaking. This means that ETH stakers can extend their staked assets to secure other applications on Ethereum through the EigenLayer smart contract. Validators participating in EigenLayer are incentivized to be honest and validate new apps. Overall, EigenLayer helps improve and unify Ethereum’s security model.

Diagram two illustrates how you can deploy a product like EigenLayer as an Omnichain Smart Contract on ZetaChain, and create an open marketplace for security. Effectively, it expands ETH restaking on Ethereum to include assets from multiple chains to secure any kind of consensus protocol, oracle, bridge, Etc. This is even true of native BTC from the Bitcoin network. ZetaChain brings in the most liquidity while a product like EigenLayer is currently limited to ETH.

Diagram 2: Omnichain staking contract tutorial

As far as implementation, the Omnichain Smart Contract on ZetaChain’s EVM manages the staking, restaking, and reward distribution processes. Users, whether on ZetaChain itself, or on connected chains (Bitcoin, Ethereum, Binance, and others in the future), can access the Omnichain dApp and deposit native assets into the contract.

A product like EigenLayer on ZetaChain would look very similar to how it works on Ethereum with one exception: On Ethereum, only Ethereum users can participate in EigenLayer; on ZetaChain’s EigenLayer, users from Bitcoin can deposit BTC into EigenLayer staking.

The simple Omnichain Smart Contract implementation extends a product like EigenLayer to enable cross-chain restaking. With ZetaChain, dApps can leverage liquidity from other important ecosystems like Bitcoin to secure models across all networks in a more capital efficient and scalable way.

Note, ZetaChain would need to offer a way for Ethereum validators to secure additional networks. Implementing a system like EigenLayer’s Actively Validated Services (AVS) solution would be a big and costly change.

Extend BabylonChain to any non-smart contract chain as an Omnichain dApp on ZetaChain

Similar to ZetaChain, BabylonChain recognizes a massive pool of untapped liquidity on the Bitcoin network. Diagram 3 demonstrates how the BabylonChain solution lets Bitcoin holders stake their BTC to secure PoS chains without moving their assets off of the Bitcoin network. Operating within the constraints of Bitcoin’s scripting language, BabylonChain supports staking contracts that manage and specify conditions under which Bitcoins can be unbonded or slashed.

Diagram 3: BabylonChain Litepaper 2023–07–13

ZetaChain provides a layer 1 blockchain and EVM layer on top of which you can deploy an Omnichain Smart Contract to achieve native Bitcoin staking. The architecture is different from BabylonChain in that ZetaChain uses a Threshold Signature Scheme (TSS) to trustlessly manage native Bitcoin and authenticate outbound transactions to the external network. In any case, Bitcoin users can stake BTC from their Bitcoin wallet address to participate in securing PoS networks, and these transactions settle on the Bitcoin blockchain.

In addition to ease of deployment, ZetaChain’s EVM allows developers to extend foreign asset staking from not only Bitcoin network, but also other non-smart chains (Dogecoin, Monero, Cardano, and more). This opens up new, untapped pools of liquidity to secure the PoS chain ecosystem.

Note, liquid staking project ZetaEarn is currently building towards omnichain staking/restaking in the next phase of its development. Learn more here.

Learn more about Omnichain Smart Contracts

Interested in developing Omnichain Smart Contracts on ZetaChain? Visit ZetaDocs, and browse through our growing library of Omnichain Smart Contract tutorials. Join our developer community in Discord to collaborate with other omnichain builders, and receive tech support. Users can enter ZetaHub to start experiencing ZetaChain today.

About ZetaChain

ZetaChain is a simple, fast, and secure omnichain blockchain. A pioneer implementing the concept of chain abstraction, ZetaChain serves as the base-layer of the decentralized internet. With ZetaChain’s Omnichain Smart Contracts, developers can build truly interoperable dApps that span multiple chains across any existing blockchain from Ethereum to Bitcoin and beyond. Access all of crypto from any chain, including new blockchain innovations into the future. ZetaChain’s mission is to build a platform for global access, simplicity, and utility across any blockchain.

Follow ZetaChain on Twitter @zetablockchain and join the conversation on Discord and Telegram. Reach out to [email protected] if you’re building on top of ZetaChain.

Any projects mentioned are 3rd party, not ZetaChain.