<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[ZetaChain Dev Blog - Medium]]></title>
        <description><![CDATA[This blog introduces new ZetaChain tutorials, technical updates, and associated announcements. It’s maintained separately from the general ZetaChain Blog and ZetaDocs. - Medium]]></description>
        <link>https://medium.com/zetachain-tech-blog?source=rss----6f1c18f88b9a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>ZetaChain Dev Blog - Medium</title>
            <link>https://medium.com/zetachain-tech-blog?source=rss----6f1c18f88b9a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 12:06:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/zetachain-tech-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Super Aggregator: A New Unified Liquidity Layer Powered by ZetaChain]]></title>
            <link>https://medium.com/zetachain-tech-blog/super-aggregator-a-new-unified-liquidity-layer-powered-by-zetachain-dd94336a4d5b?source=rss----6f1c18f88b9a---4</link>
            <guid isPermaLink="false">https://medium.com/p/dd94336a4d5b</guid>
            <category><![CDATA[liquidity]]></category>
            <category><![CDATA[dex-aggregator]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[zetachain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Matt Chruscielski]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 16:42:28 GMT</pubDate>
            <atom:updated>2025-06-16T16:42:28.124Z</atom:updated>
            <content:encoded><![CDATA[<h4>One contract. One transaction. Every chain.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GmZXKgwYz8jXsVDJ_1wvRQ.png" /></figure><p><strong>TL;DR: ZetaChain’s Universal Smart Contracts allow Dapps to instantly connect to all chains connected to ZetaChain. Allowing for new possibilities like super aggregators and the unification of liquidity across blockchains</strong></p><p><strong>Trading across blockchains is still a mess.</strong> Even as DeFi has matured, users and protocols continue to struggle with a basic question:</p><p>“How do I swap one asset for another, when they live on different chains — and still get the best price?”</p><p>Existing DEX aggregators help, but only within their own silos. And while some cross-chain tools exist, they involve complex bridging steps, trust assumptions, and fragmented liquidity.</p><p>But with <a href="https://www.zetachain.com/docs/"><strong>ZetaChain’s universal smart contracts</strong></a>, there’s a new approach emerging — one that could stitch together the liquidity of every DEX, across every chain, into a single atomic trade engine.</p><p>Let’s explore what it means to build a <strong>Super Aggregator</strong>, and how ZetaChain makes that vision possible.</p><h3>The State of DEX Aggregators in 2025</h3><p>Most users today interact with aggregators like:</p><ul><li><strong>1inch</strong> on Ethereum and L2s</li><li><strong>Jupiter</strong> on Solana</li><li><strong>Odos</strong>, <strong>Matcha</strong>, and others across the EVM landscape</li></ul><p>These tools compare prices across multiple decentralized exchanges (DEXs) on a single chain, giving users better pricing and routing options. But they stop at the chain’s boundary.</p><p>Want to trade BTC for SOL? Or ETH for a token on Avalanche? These tools can’t help — at least not without a lot of manual steps and bridge risk.</p><p>Some meta-routers, like Li.Fi or Socket, aim to patch the gap using SDKs and bridge integrations. But they rely on off-chain relayers and are often cannot interact with other smart contracts.</p><p>This fragmentation has made cross-chain trading one of the last frontiers in DeFi infrastructure.</p><h3>Enter ZetaChain’s Universal Smart Contracts</h3><p>ZetaChain is a Layer 1 blockchain built with built in native connections to all chains. Its core innovation is the U<strong>niversal Smart Contract</strong> — a smart contract that can:</p><ul><li>Interact with multiple external chains, including Bitcoin, Ethereum, BNB Chain, Solana, Ton, Sui, and more</li><li>Read and write on-chain data across networks</li><li>Execute logic in one contract that would otherwise require deployments on multiple chains</li><li>Support native asset custody, not just wrapped tokens</li></ul><p>With this foundation, you can build apps that feel like they’re “everywhere” — even if they only live on one chain (ZetaChain).</p><h3>Aggregating the Aggregators — A Super Aggregator</h3><p>So what happens when you combine universal contracts with a router that understands multiple DEX aggregators?</p><p>You get something like this:</p><p>A single contract that pulls liquidity from Jupiter, 1inch, Odos, and others — regardless of which chain they’re on — and routes your trade based on the best price, fees, and speed.</p><p>All without bridging, wrapping, or manual intervention.</p><p>It’s not just a DEX aggregator. It’s a u<strong>niversal liquidity router</strong>.</p><h3>BTC → SOL in One Transaction: Is it Possible?</h3><p>Let’s say a user wants to swap BTC on the Bitcoin network for SOL on Solana. Today, that would involve:</p><ol><li>Wrapping BTC via a custodial provider</li><li>Bridging it to Ethereum or Solana</li><li>Swapping using a Solana-based DEX</li><li>Hoping it all works</li></ol><p>Now let’s walk through using a DEX on ZetaChain like <a href="https://www.beamdex.xyz/swap">Beam</a> which is live now:</p><ol><li>The user deposits native BTC into a vault address monitored by ZetaChain validators</li><li>A <a href="https://www.zetachain.com/docs/">ZRC-20</a> token representing BTC is minted on ZetaChain</li><li>The smart contract queries multiple aggregators (e.g., Jupiter, 1inch)</li><li>It determines the best route: e.g., BTC → USDC via Ethereum, then USDC → SOL via Solana</li><li>Executes both swaps and delivers native SOL to the user</li></ol><p>All steps are handled within one universal smart contract. All swaps are atomic and trust-minimized. And from the user’s perspective, it’s just:</p><p><strong>“Send BTC, receive SOL.”</strong></p><h3>Why This Matters</h3><p>Cross-chain DeFi today is stuck in a holding pattern — promising big potential but held back by technical barriers. This new model solves that by:</p><ul><li>Removing reliance on third-party bridges</li><li>Eliminating wrapped token fragmentation</li><li>Enabling atomic, multi-hop trades across any chain</li><li>Giving developers one contract to orchestrate everything</li></ul><p>It’s a better experience, a better security model, and a better building block for the next generation of apps.</p><h3>Building the Infrastructure Layer others.</h3><p>This isn’t just a cool feature. It’s the start of a new base layer for liquidity in crypto. All of this is underpinned by ZetaChain’s universal smart contract. Other ideas that are/could be explored include:</p><ul><li><strong>Yield aggregation</strong> — Automatically move stablecoins to the chain with the best APR. Amana is a Dapp on ZetaChain that currently does this. You can check the Dapp out <a href="https://amanadefi.com/">here</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rK9PuTaMBf5Nm0AXmUUFsQ.png" /></figure><ul><li><strong>Cross-chain NFT marketplaces — </strong>Allow any NFT to be created, sold, and Traded. Ordinals and NFTs in one place.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Utns4OIFCP_JCHKU4_cmpA.png" /></figure><ul><li><strong>Whale routing &amp; execution APIs</strong> — Institutional-grade order flow management</li><li><strong>Universal token swaps</strong> — From any asset to any other, anywhere</li><li><strong>Cross-chain limit orders and DCA tools</strong> — With native asset support</li><li><strong>Universal wallets and super apps</strong> — Seamless, chain-abstracted UX for consumers</li></ul><p>And unlike existing tools, this entire system can live on-chain — composable, decentralized, and transparent.</p><h3>Final Thoughts</h3><p>This is what a <em>true</em> cross-chain DEX should look like — one that doesn’t just wrap bridges around old models, but reimagines liquidity as a unified layer.</p><p>By combining ZetaChain’s universal contracts with aggregator logic across chains, it becomes possible to abstract away all the pain of DeFi’s multichain world — and make cross-chain trading feel just like swapping ETH for USDC on a single network.</p><p><strong>One contract. One transaction. Every chain.</strong></p><p>The Super Aggregator isn’t a product — it’s the next evolution of DeFi infrastructure.</p><p><strong>Sources:</strong></p><p><a href="https://www.zetachain.com/docs/start/app/">ZetaChain Docs — <em>Universal Apps</em></a></p><p><a href="https://docs.beamdex.xyz/protocol-overview/welcome-to-beam/roadmap">Beam — <em>Roadmap</em></a></p><p><a href="https://app.amanadefi.com/about">Amana — <em>About Amana</em></a></p><p><a href="https://members.delphidigital.io/reports/zetachain-part-2-the-opportunity-ahead-for-omnichain-applications#solving-for-liquidity--an-interconnected-marketplace-for-ordinals-bee0">Delphi Digital — <em>ZetaChain App Building Opportunities</em></a></p><h3>About ZetaChain</h3><p>ZetaChain is the first Universal Blockchain with native access to Bitcoin, Ethereum, Solana, and more, offering seamless user experience and unified liquidity to the next billions of users. With its Universal EVM, ZetaChain empowers developers to build Universal Apps that operate natively across any blockchain, creating a fluid crypto ecosystem from a single platform.</p><p>Follow ZetaChain on Twitter <a href="https://twitter.com/zetablockchain">@zetablockchain</a> and join the conversation on <a href="https://discord.gg/zetachain">Discord</a> and <a href="https://t.me/zetachainofficial">Telegram</a>. Reach out to <a href="/service/mailto:partnerships@zetachain.com">partnerships@zetachain.com</a> if you’re building on top of ZetaChain.</p><p><strong><em>Any projects mentioned are 3rd party, not ZetaChain.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd94336a4d5b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zetachain-tech-blog/super-aggregator-a-new-unified-liquidity-layer-powered-by-zetachain-dd94336a4d5b">Super Aggregator: A New Unified Liquidity Layer Powered by ZetaChain</a> was originally published in <a href="https://medium.com/zetachain-tech-blog">ZetaChain Dev Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threshold BLS Signature for Decentralized Asset Control]]></title>
            <link>https://medium.com/zetachain-tech-blog/threshold-bls-signature-for-decentralized-asset-control-7572dd46af7c?source=rss----6f1c18f88b9a---4</link>
            <guid isPermaLink="false">https://medium.com/p/7572dd46af7c</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[threshold-signature]]></category>
            <dc:creator><![CDATA[brewmaster012]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 15:50:53 GMT</pubDate>
            <atom:updated>2025-04-23T19:06:47.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*plbFdP_GYXcndT-9PxwDHw.png" /></figure><p><strong>TL;DR: ZetaChain is pioneering the use of Threshold BLS (tBLS) signatures to unlock <em>orders of magnitude </em>of speedup and scalability in cross-chain transaction throughput. This approach replaces complex, low-throughput threshold ECDSA with a faster, simpler, and non-interactive alternative — making cross-chain apps vastly more efficient. Dive deeper into this </strong><a href="https://github.com/zeta-chain/zetachain-improvement-proposals/blob/main/zip9.md"><strong>ZetaChain improvement proposal (ZIP) for Threshold BLS</strong></a><strong>.</strong></p><p>Blockchain interoperability has become ever more important, enabling decentralized networks like ZetaChain to securely control assets across prominent chains such as Ethereum and EVM L1/L2 chains, Solana, SUI, and TON. Currently, ZetaChain, an L1 blockchain, primarily employs Threshold ECDSA (GG18/GG20) for authenticating externally owned accounts (EOAs) and smart contracts. However, this approach exhibits notable performance and complexity limitations, motivating the exploration of alternative threshold cryptographic schemes.</p><h3>Why Threshold Signatures?</h3><p>Threshold signatures scheme (TSS) enable a distributed group of validators (Signers) to collaboratively authorize transactions without entrusting the secret key to any single entity. This greatly enhances security by ensuring no single point of failure and increasing resilience against malicious activities. Threshold signatures provide fault tolerance (transactions can still be signed if some validators are compromised) and flexibility (signatures can be verified by any subset above a predefined threshold).</p><p>In ZetaChain TSS is used for access control and asset control on external chains, authenticating messages that come from the ZetaChain validators.</p><h3>Current Approaches for Asset Control</h3><p>ZetaChain currently relies exclusively on <a href="https://github.com/zeta-chain/go-tss">Threshold ECDSA (GG18/GG20)</a> which, despite its compatibility with many chains and low verification cost, faces critical challenges:</p><ul><li><strong>High computational complexity and low throughput</strong></li><li><strong>Significant synchrony overhead</strong>, requiring all validators to coordinate simultaneously.</li><li><strong>Difficulty in attributing signing failures</strong>, complicating incentive alignment and fault detection.</li></ul><h3>Survey of Threshold Signature Schemes</h3><h3>Threshold ECDSA (GG18/GG20/CMPGG21)</h3><ul><li><strong>Pros:</strong> Native compatibility (Ethereum, Bitcoin, and others), low on-chain verification costs.</li><li><strong>Cons:</strong> Complex multi-round signing ceremonies, synchronization requirements, limited throughput.</li></ul><h3>Threshold BLS Signatures</h3><ul><li><strong>Pros:</strong> Non-interactive signing, simpler cryptographic operations, high throughput.</li><li><strong>Cons:</strong> Requires contract-based verification, higher verification cost compared to native ECDSA.</li></ul><h3>Contract Multisig (Gnosis Safe as an example)</h3><ul><li><strong>Pros:</strong> Simple setup, broad existing chain support, non-interactive.</li><li><strong>Cons:</strong> On-chain complexity and costs scale linearly with the number of signers.</li></ul><h3>Introducing Threshold BLS Signatures</h3><p>Threshold BLS (Boneh-Lynn-Shacham) signatures emerge as a compelling alternative. This method significantly simplifies multi-party computation, offering:</p><ul><li><strong>Non-interactive signing</strong>: No synchronization required among Signers.</li><li><strong>Higher performance</strong>: Potentially exceeding 100 signatures per second.</li><li><strong>Straightforward failure attribution and signer management</strong>.</li></ul><p>BLS signature scheme is a cryptographic signature scheme that allows anyone to verify the <strong>authenticity</strong> of a signer, like the common digital signature scheme such as ECDSA (Bitcoin, Ethereum, and numerous other blockchains). BLS has a few appealing benefits such as simplicity, powerful and flexible signature aggregation, to name just a few, but for ZetaChain’s use cases, the most important property is that BLS signatures admit very simple and robust multiparty computation (MPC) threshold signature scheme.</p><p>The BLS signature scheme depends on pairing on elliptic curves such as BN254 (also called, confusingly, bn_alt128, BN128, and BN256!), or more recent BLS12–381. Those pairings and curves are the bedrock for the most deployed zero-knowledge proof (ZKP) systems such as Groth16 which prompts many blockchains to add or improve efficiency in supporting those primitives. The support is wide enough and efficient enough nowadays (see for example upcoming Ethereum <a href="https://eips.ethereum.org/EIPS/eip-7600">Pectra upgrade</a> which includes <a href="https://eips.ethereum.org/EIPS/eip-2537">BLS12–381</a> precompile support EIP) that ZetaChain can utilize a single TSS technology that are supported almost everywhere efficiently.</p><p>In the next few months, ZetaChain will develop, validate, and gradually deploy threshold BLS (tBLS) on external chains one by one. The technology is maturing (Filecoin relies on threshold BLS for verifiable random function for picking block proposers, <a href="https://www.drand.love/">drand</a> relies on the same threshold BLS as verifiable random function which involves thousands of dynamic sets of nodes/signers), but its application as blockchain digital signature appears not to be widespread. <strong>ZetaChain would be pioneering this prospect in the context of cross-chain interoperability to reap orders of magnitudes of speedup and scaling of cross-chain transaction throughput.</strong></p><h3>Key Generation and Signing Process</h3><h3>Key Generation (DKG)</h3><ul><li><strong>One-round, asynchronous process</strong>.</li><li>Utilizes distributed Verified Secret Sharing (VSS).</li><li>Communication facilitated by ZetaChain’s state machine as a reliable broadcast channel.</li></ul><h3>Signature Generation (KeySign)</h3><ul><li>Signers independently produce partial signatures and broadcast them.</li><li>Any signer can reconstruct the complete signature from threshold shares without requiring synchronization.</li></ul><h3>Resharing</h3><p>When changing the Signers’ composition, resharing maintains the collective secret key, preserving the public key and external account addresses, reducing migration risks.</p><h3>Curve and Compatibility Considerations</h3><p>Two prominent curves for BLS:</p><ul><li><strong>BN254 (alt_bn128)</strong>: Widely supported, particularly efficient on EVM chains and Solana.</li><li><strong>BLS12–381</strong>: Higher security (128-bit) and native support on Ethereum (upcoming Pectra upgrade), SUI, and TON.</li></ul><h3>Hash-to-Curve Methods</h3><ul><li><strong>BN254</strong>: Keccak256-based hashing with retry mechanism to find suitable curve points. The original hash to point/curve from the <a href="https://eips.ethereum.org/assets/eip-3068/weilsigs.pdf">paper</a>.</li><li><strong>BLS12–381</strong>: RFC 9380 standard hash-to-curve with native and precompiled support.</li></ul><h3>Signature Scheme Selection</h3><ul><li><strong>Signature on G1, Public Key on G2</strong>: Preferred due to smaller signature size, beneficial for storage and verification efficiency.</li></ul><h3>Implementation on Supported Chains</h3><h3>Ethereum and EVM Chains</h3><ul><li>BLS signature verification via precompiles.</li><li>Contract-based nonce management necessary to prevent replay attacks.</li></ul><h3>Solana and SUI</h3><ul><li>Gateway contracts updated to handle BLS signature verification.</li><li>Straightforward transition due to existing nonce management.</li></ul><h3>TON</h3><ul><li>Native support for BLS12–381 simplifies verification significantly.</li></ul><h3>Performance and Cost Comparisons</h3><p>Metric Threshold ECDSA (GG20) Threshold BLS Throughput &lt;1 sig/s &gt;100 sig/s Signer Synchronization Required Not required Complexity High Low Gas cost (EVM) 3,000 ~113,000 Compatibility Native EOA widely supported Contract-based</p><h3>Threshold BLS vs. Gnosis Safe Multisig</h3><p>Threshold BLS relies on cryptographic simplicity off-chain, whereas Gnosis Safe implements threshold logic directly in contracts:</p><p>Aspect Gnosis Safe Threshold BLS Verification Gas Cost Increases linearly Constant Key Sign Interaction Non-interactive Non-interactive Set Change Complexity High (multiple txs) Low (single resharing) On-chain Footprint Large Minimal</p><h3>Strategic Recommendations</h3><ul><li><strong>Ethereum &amp; Bitcoin</strong>: Maintain Threshold ECDSA for cost and native compatibility.</li><li><strong>EVM Chains (fast/cheap)</strong>: Shift towards Threshold BLS.</li><li><strong>Solana &amp; SUI</strong>: Adopt Threshold BLS due to efficient native support.</li><li><strong>TON</strong>: Utilize native BLS verification to leverage performance.</li></ul><h3>Impact and Benefits</h3><p>Adopting Threshold BLS can:</p><ul><li><strong>Significantly increase transaction throughput and reduce latency</strong>.</li><li><strong>Enhance reliability</strong> by eliminating complex signer synchronization.</li><li><strong>Simplify and robustify signer set migration</strong>.</li></ul><h3>Looking Forward</h3><p>Threshold BLS signatures represent a leap forward for decentralized blockchain interoperability. By strategically adopting Threshold BLS, ZetaChain can achieve greater scalability, lower latency, and improved resilience in managing cross-chain asset control.</p><h3>Developments and Integration in ZetaChain</h3><p>The tBLS feature has been specified in a more technical and detailed ZetaChain improvement proposal (ZIP):</p><p><a href="https://github.com/zeta-chain/zetachain-improvement-proposals/blob/main/zip9.md">zetachain-improvement-proposals/zip9.md at main · zeta-chain/zetachain-improvement-proposals</a></p><p>As of date, the internal modular proof of concept and validation are finished, while we are doing proof of concept integration in the ZetaChain node software <a href="https://github.com/zeta-chain/node">https://github.com/zeta-chain/node</a>.</p><p>To track progress:</p><ul><li>Threshold BLS Cryptography library: <a href="https://github.com/zeta-chain/kyber/tree/dkg-dual-curve">https://github.com/zeta-chain/kyber/tree/dkg-dual-curve</a></li><li>Solidity library for verifying BN254 tBLS signature: <a href="https://github.com/brewmaster012/bls-solidity">https://github.com/brewmaster012/bls-solidity</a></li><li>PoC contract BLS signature verification on <a href="https://www.notion.so/SUI-1967b3fb90498018a9a0e00799ec3dd5?pvs=21">SUI</a>, <a href="https://github.com/brewmaster012/solana-bls-poc">Solana</a>, TON</li></ul><p>Our cryptographic library is based on the <a href="https://github.com/dedis/kyber"><strong>kyber</strong></a> library, expanding its support to both BN254 and BLS12–381 curves, and rework and simplify the workflow of distributed threshold BLS operations. We chose kyber library for its language compatibility with Go, flexibility to integrate both elliptic curves and specific workflows in ZetaChain KeyGen and KeySign.</p><h3>References</h3><ol><li><a href="https://www.ietf.org/archive/id/draft-irtf-cfrg-bls-signature-05.html">https://www.ietf.org/archive/id/draft-irtf-cfrg-bls-signature-05.html</a> IRTF RFC on BLS Signature</li><li>Short Signatures from Weil Pairings, Dan Boneh, Ben Lynn &amp; Hovav Shacham, Journal of Crypotology, 2004</li><li>Blog post: <a href="https://www.jcraige.com/threshold-bls-signatures">https://www.jcraige.com/threshold-bls-signatures</a></li><li>MPTS 2023: NIST Workshop on Multi-Party Threshold Schemes 2023</li><li>Cryptography library with reference implementation of threshod BLS: <a href="https://github.com/dedis/kyber">https://github.com/dedis/kyber</a></li><li>Drand: Internet Protocol for Randomness. <a href="https://github.com/drand/drand">https://github.com/drand/drand</a></li><li>Blog post: BLS Signatures in Solidity. <a href="https://hackmd.io/@liangcc/bls-solidity">https://hackmd.io/@liangcc/bls-solidity</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7572dd46af7c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zetachain-tech-blog/threshold-bls-signature-for-decentralized-asset-control-7572dd46af7c">Threshold BLS Signature for Decentralized Asset Control</a> was originally published in <a href="https://medium.com/zetachain-tech-blog">ZetaChain Dev Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concentrated Liquidity Pools in ZetaChain v3: Mechanics, Usage, and Benefits]]></title>
            <link>https://medium.com/zetachain-tech-blog/concentrated-liquidity-pools-in-zetachain-v3-mechanics-usage-and-benefits-bfff112054b2?source=rss----6f1c18f88b9a---4</link>
            <guid isPermaLink="false">https://medium.com/p/bfff112054b2</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[zetachain]]></category>
            <category><![CDATA[liquidity-pool]]></category>
            <category><![CDATA[documentation]]></category>
            <dc:creator><![CDATA[Anthony Yang]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 16:23:56 GMT</pubDate>
            <atom:updated>2025-03-12T16:23:56.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKXkPuj_HqxqwI1GDksYOw.png" /><figcaption><a href="https://www.zetachain.com/docs/">https://www.zetachain.com/docs/</a></figcaption></figure><h3>Mechanics of v3 Concentrated Liquidity Pools</h3><h3>Concentrated Liquidity Basics</h3><p>In a Uniswap v3-style <em>concentrated liquidity pool</em>, liquidity isn’t spread uniformly from price 0 to ∞ as in earlier AMMs. Instead, liquidity providers (LPs) choose a specific price range to allocate their capital. All individual LP positions (each with its own range) aggregate to form one combined pool that traders interact with. Within the chosen range, the LP’s funds are actively used for swaps; outside that range, their liquidity is “out of the market” (no fees earned) until the price moves back into their range.</p><h3>Liquidity Provisioning &amp; Ranges</h3><p>When adding liquidity in v3, an LP deposits two assets but must also specify a price band. For example, an LP might concentrate liquidity in a narrow band around the current price (if they believe the price will stay in that range). A narrower range means the deposited assets provide more depth (greater <strong>capital efficiency</strong>) within that interval, which can yield higher fee earnings since traders get more liquidity to trade against. However, if the market price moves outside the LP’s set range, their position becomes inactive and stops earning fees. LPs can always widen their range up to “full range” (0 to ∞), which is equivalent to a Uniswap v2 pool position (lower efficiency but never out-of-range). This flexibility lets LPs balance risk vs. reward: narrow ranges concentrate fees but require active management, while wider ranges give passive exposure with steady (but smaller) fees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Ffij4Jsz0j_ZI7HgyN5qiw.png" /><figcaption><a href="https://tr8dr.github.io/PeggedLiquidity/">https://tr8dr.github.io/PeggedLiquidity/</a></figcaption></figure><h3>Fee Structure</h3><p>Uniswap v3 introduced multiple fee tiers per pool, allowing each trading pair to have a fee setting that reflects its volatility/risk (e.g. 0.01%, 0.05%, 0.3%, or 1%). ZetaChain’s concentrated liquidity pools adopt the same principle. A stablecoin pair on ZetaChain, for instance, might use a low fee tier (to encourage high-volume trading), whereas a more volatile pair (like ZETA vs a small-cap token) could use a higher fee tier to compensate LPs for impermanent loss risk. Traders pay the pool’s fee on each swap, which is then distributed pro-rata to LPs active in the price range where the trade occurred. Because liquidity is denser at the market price, slippage and price impact are reduced for traders, meaning even with similar fees, trade execution can be more favorable.</p><h3>LP Benefits in v3</h3><p>LPs gain <strong>granular control</strong> over how their assets are used. They can fine-tune their positions to maximize usage of their capital. For example, an LP on ZetaChain providing ZETA and ETH in a v3 pool could decide to confine their liquidity to a tight range around the current ZETA/ETH price. This means nearly all of their funds are constantly being used for swaps in that range, earning fees, rather than sitting idle across far-away price intervals. If the price stays in-range, the LP earns considerably more fees on a smaller investment than they would in a v2 pool. Additionally, LPs can use this mechanism to express market views or perform automated strategies — e.g. by setting a range entirely above the current price, an LP is effectively placing a limit sell order (they’ll hold one asset until the price rises into their range and swaps it for the other asset while earning fees). All LP positions are represented by NFTs (non-fungible tokens) rather than fungible LP tokens, because each position can have unique parameters. These NFT positions can be managed (increase, decrease liquidity or collected fees) individually by the LP. In summary, concentrated liquidity gives LPs more control, higher potential fee rewards, and the ability to tailor liquidity deployment to their strategy, at the cost of more active management to avoid being out-of-range.</p><h3>Comparison to Gas Pools Used by the Protocol</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUiXWaPBlz3WA6LMYiQ-PQ.png" /><figcaption><a href="https://medium.com/@fa395412/zeta-chain-8defbce11e9a">https://medium.com/@fa395412/zeta-chain-8defbce11e9a</a></figcaption></figure><h3>Overview</h3><p>ZetaChain’s <em>gas pools</em> (aka <strong>core pools</strong>) are a special category of liquidity pools used by the protocol to facilitate cross-chain transactions. Each gas pool is a <strong>ZETA / [Chain Gas Asset]</strong> pair deployed on ZetaChain’s network. For example, ZetaChain has pools like ZETA/ETH (for Ethereum), ZETA/MATIC (for Polygon), ZETA/BNB (for BNB Chain), etc. However, they are not used in every transaction type. For instance, when a call is successfully made from a connected chain to ZetaChain, these pools are not involved. Similarly, when initiating a call from ZetaChain, the user (or contract) must first approve the Gateway to use the gas ZRC‑20 token to pay for the outgoing transaction fees, so in that case the pools are bypassed. The gas pools come into play primarily in error recovery situations. For example, if a deposit-and-call transaction is initiated from Ethereum to ZetaChain and the call subsequently reverts, the protocol must execute a cross-chain transaction back to Ethereum. In this scenario, even though the deposited asset might be USDC, the gas fee on Ethereum must be paid in ETH. To handle this, the protocol uses the relevant gas pool to swap a fraction of USDC for ETH, ensuring that there are sufficient funds to cover the gas fees for the outbound transaction.</p><h3>Mechanics &amp; Functionality Differences</h3><p>Importantly, the gas pools today use a Uniswap v2-style AMM model. Liquidity in these pools is distributed across the entire price range by default, and LPs who provide to these pools receive a standard ERC-20 LP token representing their share (as with Uniswap v2). There is no concept of per-LP custom price ranges in the current gas pool implementation. This is a deliberate choice for reliability: the protocol must always be able to swap some amount of ZETA for gas at the prevailing market rate to keep cross-chain transactions running. Using a uniform liquidity model ensures that <strong>at any price</strong> there is some liquidity available. If instead a concentrated (v3) model were used for gas pools, there’s a risk that if all LPs set narrow ranges and the price moved outside those ranges, the pool could momentarily have zero liquidity at the needed price, disrupting cross-chain operations. In practice, ZetaChain may encourage full-range positions for such critical pools if it ever introduces v3 mechanics to them, or it might keep them as v2 pools for simplicity and predictability.</p><h3>Purpose and Use-Case</h3><p>Gas pools are <strong>utility pools</strong> serving the protocol’s needs, whereas v3 concentrated liquidity pools are generally <strong>user-facing pools</strong> serving trading and liquidity provision needs. A gas pool’s role is to facilitate fee payment, not speculative trading — users don’t directly swap assets in these pools except when the protocol triggers a conversion or when arbitrage bots rebalance them. In contrast, the concentrated liquidity pools (e.g. a ZETA/ETH pool on a DEX like Sushi or AbstraDEX) are meant for open trading by users and dApps. The protocol’s usage of gas pools results in steady, small swaps (every cross-chain transfer may generate a swap for gas), whereas user trading can be larger and more sporadic.</p><h3>LP Incentives and Returns</h3><p>LPs can provide liquidity to gas pools and earn fees, but the dynamics differ from typical trading pools. The swap fees in gas pools come from cross-chain activity: as ZetaChain usage grows, these pools will see more volume and thus more fees to distribute. Arbitrageurs also interact with gas pools to maintain fair prices whenever the protocol’s gas conversions push the price slightly. The fee rate for gas pools is currently the default of the Uniswap v2 router (commonly 0.3% per swap) unless otherwise specified. By comparison, concentrated v3 pools often have tailored fee tiers as noted, and their volume comes from user swaps and liquidity routed by aggregators or dApps. LPs in concentrated pools are usually motivated by trading fees and possibly liquidity mining incentives from DEXes, whereas LPs in gas pools are essentially supporting the network’s infrastructure (while still earning swap fees in return).</p><h3>Summary of Differences</h3><p>In short, <strong>Gas Pools</strong> are about ensuring cross-chain functionality (ZetaChain converts ZETA to gas via these pools) and are currently implemented with a simpler AMM model for reliability. They exist for each chain’s native token and always involve ZETA. <strong>Concentrated (v3) Liquidity Pools</strong>, on the other hand, are about maximizing capital efficiency for trading and swaps. They allow custom price ranges and multiple fee tiers, and can exist for any token pair that users want to trade on ZetaChain’s network (not only gas assets). Gas pools serve the <em>protocol’s internal needs</em>, while v3 pools serve <em>users’ and developers’ needs</em> for efficient swaps. The two types complement each other: gas pools unify <em>gas liquidity</em> for cross-chain execution, and concentrated pools unify <em>trading liquidity</em> for user-facing swap markets.</p><h3>How Developers Should Use v3 Pools for Their Own Swaps</h3><p>Developers building on ZetaChain can leverage v3 liquidity pools to facilitate token swaps in their applications, taking advantage of the unified, omnichain environment. Here are some best practices and tools for using these pools in your dApps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*AtNygbVB6vLjX4tbEQ4X7w.png" /><figcaption><a href="https://www.coinbase.com/developer-platform/discover/protocol-guides/guide-to-zetachain">https://www.coinbase.com/developer-platform/discover/protocol-guides/guide-to-zetachain</a></figcaption></figure><h3>Use ZetaChain’s Swap Contracts for Cross-Chain Swaps</h3><ul><li>ZetaChain provides example contracts (and a <strong>Toolkit</strong> library) that demonstrate how to perform swaps using the chain’s liquidity pools. For instance, the official Swap universal contract can accept a token from a user on one chain, swap it via ZetaChain’s pools, and then send the output token to another chain (<a href="https://www.zetachain.com/docs/developers/tutorials/swap/#:~:text=1,20%20token">Swap – ZetaChain Docs</a>). As a developer, you can reference this contract’s logic in your own omnichain dApp. It shows how to interact with the Uniswap router on ZetaChain (currently v2 router in examples) – e.g., splitting an incoming amount into a portion for gas fee swap and the remainder for the target asset swap. Adapting this to v3 pools would involve calling the appropriate v3 router or pool functions instead.</li></ul><h3>On-Chain Swap Integration (ZetaChain as a DEX hub)</h3><ul><li>If your use case is purely on ZetaChain (for example, you’re building a DeFi app on ZetaChain that needs token swaps), you can integrate with the concentrated liquidity pools just as you would on Ethereum or another EVM. That means using the Uniswap v3 contracts deployed on ZetaChain (or a DEX like Sushi v3 on ZetaChain). Typically, you’d use a <strong>Swap Router</strong> contract provided by the DEX to execute trades. You specify the pool (token pair and fee tier) and the amount, and the router will handle the swap against the concentrated liquidity pool. For a single-pool swap (Token A -&gt; Token B in one pool), you can call a function like exactInputSingle on Uniswap v3’s router, providing it the desired amount, the pool fee, and slippage parameters. For multi-hop swaps (if needed), you’d use exactInput with a path. All these functions are available in Uniswap v3’s periphery and have been deployed on ZetaChain by various DEXs. The integration is very similar to using Uniswap v3 on Ethereum – you can even use existing SDKs (like Uniswap’s SDK or Sushi’s SDK) by configuring them with ZetaChain’s chain ID and the addresses of the v3 factory/router on ZetaChain.</li></ul><h3>Leverage Existing DEX Infrastructure</h3><ul><li>ZetaChain’s ecosystem already includes DEXes that support concentrated liquidity. For example, <strong>SushiSwap v3</strong> has been deployed on ZetaChain, allowing users to swap and provide concentrated liquidity via Sushi’s interface (<a href="https://www.sushi.com/academy/tutorial-zetachain#:~:text=5">Tutorial: Bridge assets, Swap and LP (v3) on Zetachain via Sushi | Sushi</a> ). As a developer, you don’t need to deploy your own AMM from scratch — you can route trades through these existing protocols. Many projects choose to integrate with these protocols at the contract or SDK level. Check if the DEX offers an integration guide or API. In many cases, you can call their smart contracts directly from your omnichain contract or backend. For instance, you might instruct users to deposit funds into ZetaChain (using ZetaChain’s bridge) and then call a swap on Sushi v3 pools programmatically. The <strong>ZetaHub</strong> and partner UIs already demonstrate how bridging + swapping can be combined into a smooth user flow — you can emulate a similar flow in your dApp by using ZetaChain’s messaging to sequence a bridge then a swap, all abstracted for the user.</li></ul><h3>Best Practices</h3><ul><li>Ensure you handle slippage and liquidity checks when using v3 pools. Because liquidity can be concentrated in ranges, large swaps might suffer price impact if the price moves to the edge of a big LP’s range. It’s good practice to query the pool’s state (price and liquidity depth) or use an off-chain SDK to simulate the swap beforehand. Set a reasonable slippage tolerance in your transactions. Also, consider using a <strong>DEX aggregator</strong> if multiple pools or DEXs could offer a better price for the swap — for example, if there’s both a Sushi v3 pool and an iZiSwap pool for the same pair on ZetaChain, an aggregator could split the trade. ZetaChain’s team has mentioned exploring DEX aggregators to ensure minimal cost to users (<a href="https://www.zetachain.com/docs/about/token-utility/liquidity/#:~:text=While%20the%20protocol%20uses%20UniV2,users%20or%20developers">Core Liquidity Pools — ZetaChain Docs</a>), which indicates that integrating an aggregator logic can benefit your users.</li></ul><h3>Developer Tools</h3><ul><li>Aside from ZetaChain’s own docs, you can refer to Uniswap v3’s documentation for low-level integration details (the mechanisms are the same on ZetaChain’s EVM). Uniswap’s docs and example code explain how to add liquidity positions (via the NonfungiblePositionManager) and how to perform swaps via the SwapRouter (<a href="https://blog.uniswap.org/uniswap-v3#:~:text=,higher%20returns%20on%20their%20capital">Introducing Uniswap v3</a>). You can also use block explorer (ZetaChain Blockscout) to find the addresses of existing pools and routers on ZetaChain Mainnet, or consult ZetaChain’s official Github for deployed contract addresses. The <strong>ZetaChain Developer Discord/Community</strong> is another great resource to ask for best practices when working with liquidity pools. In summary, developers should treat ZetaChain as a familiar EVM environment with the added bonus of omnichain capabilities — use the established v3 pool contracts for efficient swaps, and use ZetaChain’s cross-chain messaging to string those swaps into cross-chain transactions as needed.</li></ul><h3>Benefits for Users and Developers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UPQaghgafsxFri8WMSqEgw.png" /><figcaption><a href="https://medium.com/coinmonks/bis-exploring-ethereums-automated-market-makers-for-cross-border-payments-1d01f48b3672">https://medium.com/coinmonks/bis-exploring-ethereums-automated-market-makers-for-cross-border-payments-1d01f48b3672</a></figcaption></figure><h4>For Users (Traders and Liquidity Providers)</h4><p>Concentrated liquidity pools bring improvements to the trading experience on ZetaChain. Traders enjoy <strong>better prices and lower slippage</strong> on their swaps because liquidity is dense where it matters. Rather than spreading liquidity thin across all prices, v3 pools concentrate it around the current market price, resulting in a deeper pool for execution. This means a user swapping, say, USDC for ZETA on ZetaChain will get a more favorable rate (less of a price change for a given trade size) compared to a traditional v2 pool of the same total liquidity. In many cases, the efficiency is so high that trade execution can rival centralized exchanges or specialized stablecoin AMMs in terms of low slippage.</p><p>Users also benefit from more <strong>choice and flexibility</strong>. Since LPs can target specific ranges, liquidity tends to accumulate around popular price levels, supporting higher-volume trades there, and it can be provided even for relatively volatile or new token pairs without requiring enormous capital. Additionally, users who are liquidity providers gain more control. They can earn higher yields by focusing their liquidity where the demand is. For example, an LP providing to a ZETA/ETH pool on ZetaChain might keep their range tight during times of low volatility to earn higher fees, then widen it if volatility increases. They effectively have the option to behave like market makers, adjusting their “orders” as market conditions change, all while staying in the pool and earning fees. This level of control was not possible in earlier pool designs. If an LP prefers simplicity, they can still provide across a wide range (even the full range) to passively earn fees like a v2 pool — the key is that <strong>the choice is theirs</strong>. Overall, users see a <em>“smooth experience”</em> with efficient, seamless trading across multiple chains thanks to ZetaChain’s unified liquidity approach, and LPs are rewarded proportionally to the value they add.</p><h4>For Developers</h4><p>Developers building on ZetaChain benefit from these liquidity improvements in several ways. First, <strong>efficiency</strong>: higher capital efficiency in pools means your dApp can achieve the same liquidity depth with less total capital. This can lower the barrier to launch new markets or ensure your users get good prices even if liquidity is initially limited. It also means if you are incentivizing liquidity (through yield farming, for example), those incentives go further in concentrated pools because each dollar of liquidity is put to more effective use. Second, <strong>lower slippage and better execution</strong> lead to happier users of your application. If you build a cross-chain swap service or an omnichain DeFi protocol on ZetaChain, your users will notice that they get more of the output asset for a given input, compared to less efficient designs. This can be a key selling point for adopting ZetaChain’s pools. The ZetaChain team explicitly focuses on minimizing costs and slippage for end-users, so by using the recommended v3 pools or aggregator strategies, developers can align with that goal and deliver a superior UX.</p><p>Another major benefit is <strong>liquidity control and innovation</strong>. As a developer, you can tap into the concept of <em>liquidity as code</em>: since LP positions are NFTs with parameters, your smart contracts could programmatically manage liquidity (e.g., move ranges, or even create on-demand liquidity positions for particular events). This opens doors to advanced use cases like automated market-making strategies, dynamic fee adjustment, or implementing features like limit orders and stop-losses on top of AMMs. For instance, you could create a service that automatically narrows an LP’s range during certain hours of the day when volatility is low, and widens it during high volatility — effectively an automated liquidity manager. Such strategies give developers new tools to differentiate their DeFi products on ZetaChain.</p><p><strong>Unified Liquidity Across Chains:</strong> Both users and devs benefit from ZetaChain’s overarching vision of unified liquidity. Because ZetaChain can natively manage assets from multiple chains, a single concentrated liquidity pool on ZetaChain can serve cross-chain swaps for many networks. Users don’t need to hunt for liquidity on each chain — liquidity accumulates on ZetaChain and is accessible universally. Developers, in turn, don’t have to fragment their liquidity mining programs or integrate multiple DEXs on different chains; they can build on one platform (ZetaChain) and reach multiple networks. This <strong>omnichain liquidity</strong> model means fewer hops for users (reducing complex bridge + swap sequences into one transaction) and potentially less total liquidity required to support a wide range of cross-chain trades. It’s easier to maintain and secure one deep pool than many shallow ones on each chain.</p><p>In summary, concentrated liquidity pools in ZetaChain v3 offer <strong>greater efficiency, lower slippage, and more control</strong>. Users get better trade outcomes and more ways to earn on their assets, and developers can deliver powerful cross-chain DeFi experiences without compromising on liquidity or user experience. For more details and technical guidance, you can refer to ZetaChain’s official documentation on liquidity pools and the Swap contract (for cross-chain swap logic), as well as Uniswap v3’s documentation for the general mechanics.</p><p><strong>Sources:</strong></p><ul><li>ZetaChain Documentation — <em>Core Pools (Gas Pools) Overview</em> (<a href="https://www.zetachain.com/docs/about/token-utility/liquidity/#:~:text=The%20network%20has%20ZETA%20%2F,for%20gas%20on%20outbound%20transactions">Core Liquidity Pools — ZetaChain Docs</a>) (<a href="https://www.zetachain.com/docs/about/token-utility/liquidity/#:~:text=ZetaChain%20needs%20a%20,how%20to%20pool%20your%20ZETA">Core Liquidity Pools — ZetaChain Docs</a>)</li><li>ZetaChain Docs — <em>Cross-Chain Swap Tutorial</em> (Swap contract usage) (<a href="https://www.zetachain.com/docs/developers/tutorials/swap/#:~:text=1,20%20token">Swap — ZetaChain Docs</a>) (<a href="https://www.zetachain.com/docs/developers/tutorials/swap/#:~:text=3,tokens%20to%20the%20destination%20chain">Swap — ZetaChain Docs</a>)</li><li>Uniswap v3 Documentation — <em>Concentrated Liquidity Concept</em> (<a href="https://docs.uniswap.org/concepts/protocol/concentrated-liquidity#:~:text=The%20defining%20idea%20of%20Uniswap,curve%20between%200%20and%20infinity">Concentrated Liquidity | Uniswap</a>) (<a href="https://docs.uniswap.org/concepts/protocol/concentrated-liquidity#:~:text=With%20v3%2C%20liquidity%20providers%20may,the%20preferences%20of%20each%20LP">Concentrated Liquidity | Uniswap</a>)</li><li>Uniswap v3 Announcement — <em>Capital Efficiency and Low Slippage</em> (<a href="https://blog.uniswap.org/uniswap-v3#:~:text=,higher%20returns%20on%20their%20capital">Introducing Uniswap v3</a>) (<a href="https://blog.uniswap.org/uniswap-v3#:~:text=,and%20reduce%20their%20downside%20risk">Introducing Uniswap v3</a>)</li><li>Sushi Academy Tutorial — <em>Adding v3 Liquidity on ZetaChain</em> (illustrating LP range selection) (<a href="https://www.sushi.com/academy/tutorial-zetachain#:~:text=5">Tutorial: Bridge assets, Swap and LP (v3) on Zetachain via Sushi | Sushi</a> )</li><li>ZetaChain Ecosystem Page — <em>AbstraDEX (Concentrated Liquidity DEX on ZetaChain)</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfff112054b2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zetachain-tech-blog/concentrated-liquidity-pools-in-zetachain-v3-mechanics-usage-and-benefits-bfff112054b2">Concentrated Liquidity Pools in ZetaChain v3: Mechanics, Usage, and Benefits</a> was originally published in <a href="https://medium.com/zetachain-tech-blog">ZetaChain Dev Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ZetaChain’s New Revert Handling for Cross-Chain]]></title>
            <link>https://medium.com/zetachain-tech-blog/zetachains-new-revert-handling-for-cross-chain-313629c92e63?source=rss----6f1c18f88b9a---4</link>
            <guid isPermaLink="false">https://medium.com/p/313629c92e63</guid>
            <category><![CDATA[zetachain]]></category>
            <category><![CDATA[interoperability]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Denis Fadeev]]></dc:creator>
            <pubDate>Wed, 19 Feb 2025 08:30:42 GMT</pubDate>
            <atom:updated>2025-02-19T08:30:42.146Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ee_TZHYUpiYoQdW5BCujKQ.png" /></figure><p><strong>ZetaChain’s new </strong><strong>onAbort mechanism prevents stuck assets in cross-chain transactions. With </strong><strong>onRevert for rollbacks and </strong><strong>onAbort as a failsafe, every transaction is either executed or accounted for — ensuring seamless failure recovery without manual intervention. Learn more here.</strong></p><h3>Why Reverts Matter in Cross-Chain Transactions</h3><p>If you’ve ever interacted with a smart contract and seen your transaction fail, you’ve likely encountered a “revert.” A revert occurs when a contract refuses to execute a transaction, undoing any changes and returning an error.</p><p>While it’s not an ideal scenario, reverts are a built-in safety feature that ensures only valid transactions are processed. They effectively roll back all changes made to the state during the transaction, helping prevent unintended effects or harmful actions.</p><p>But handling reverts in cross-chain applications is far more complex than on a single chain. If a failure occurs on one blockchain, it can cause ripple effects that impact other parts of the application. Without proper handling, assets can get stranded, smart contract logic can break, and users can be left in a frustrating state of uncertainty.</p><h3>The Challenge: Why Cross-Chain Reverts Are Hard</h3><p>In a single-chain smart contract, revert handling is straightforward: the transaction fails, and all state changes are rolled back automatically. In a cross-chain environment, however, things are not as simple:</p><ol><li>What happens if a transaction fails after crossing chains?</li><li>How do we ensure assets aren’t stuck if a cross-chain transaction doesn’t complete?</li><li>Who pays for the gas needed to execute a revert?</li></ol><p>Many existing cross-chain solutions do not handle reverts natively, leaving developers to build their own rollback logic or rely on manual intervention.</p><h3>How ZetaChain Handles Cross-Chain Reverts</h3><p>ZetaChain provides a built-in framework for managing cross-chain failures automatically, preventing a single failure from leaving an application in a broken or inconsistent state.</p><h3>Types of Transactions: Incoming vs. Outgoing</h3><p>To understand ZetaChain’s approach, let’s define two types of cross-chain transactions:</p><ul><li>An <strong>incoming</strong> transaction goes from a connected chain (for example, Ethereum) to ZetaChain.</li><li>An <strong>outgoing</strong> transaction goes from ZetaChain to a connected chain.</li></ul><p>ZetaChain provides a structured approach to handling failures in both scenarios, including the new onAbort functionality that mitigates scenarios where a traditional revert process cannot fully complete.</p><h3>Handling Incoming Transactions: A Smarter Revert Process</h3><p>Consider a scenario where a transaction originates on Ethereum and calls a function on ZetaChain using depositAndCall:</p><pre>function depositAndCall(<br>    address receiver,<br>    bytes calldata payload,<br>    RevertOptions calldata revertOptions<br>)</pre><pre>struct RevertOptions {<br>    address revertAddress;<br>    bool callOnRevert;<br>    address abortAddress;<br>    bytes revertMessage;<br>    uint256 onRevertGasLimit;<br>}</pre><p>depositAndCall triggers an exection of the onCall function of a universal contract call on ZetaChain. If the execution succeeds, the transaction completes normally.. However, if onCall fails, ZetaChain attempts a revert.</p><h3>Ensuring There’s Enough Gas for a Revert</h3><p>For ZetaChain to execute a revert transaction back to Ethereum, the original deposit must include enough tokens to cover cross-chain execution fees.</p><p>If the transaction amount is sufficient for a revert, ZetaChain will:</p><ol><li>Use deposited funds to cover the gas costs of the revert. If the deposited amount is in gas tokens, the gas fee will be deducted from the amount. If the deposited amount is in non-gas fungible tokens (for example, supported ERC-20), ZetaChain will swap the amount required for a gas fee on the liquidity pools on ZetaChain (currently, a Uniswap v2 instance is used).</li><li>ZetaChain creates a cross-chain transaction from ZetaChain to Ethereum.</li><li>Call onRevert on the original Ethereum contract:</li></ol><p>The protocol first checks whether the amount of tokens supplied in the original transaction is sufficient to cover the costs of calling back to the source chain. If, for example, making a call from ZetaChain back to Ethereum costs 0.001 ETH, the original deposit must exceed that amount. If the deposited token is not the gas token (e.g., USDC), ZetaChain will use its liquidity pools to swap for enough gas to cover the return call, provided the deposit is sufficient.</p><p>If the amount covers the return call costs, the protocol initiates a cross-chain transaction that returns execution back to the connected chain. On that chain, the contract specified in RevertOptions.revertAddress has its onRevert function called:</p><pre>function onRevert(<br>    RevertContext calldata revertContext<br>) external onlyGateway {<br>    emit RevertEvent(&quot;Revert on EVM&quot;, revertContext);<br>}</pre><pre>struct RevertContext {<br>    address sender;<br>    address asset;<br>    uint256 amount;<br>    bytes revertMessage;<br>}</pre><p>Under normal circumstances, the flow is: Ethereum -&gt; ZetaChain onCall → Ethereum onRevert.</p><h3>Introducing onAbort: Preventing Stuck Transactions</h3><p>But what happens if there aren’t enough funds to pay for the revert? In many cross-chain systems, this would result in an aborted state, leaving assets stranded on the destination chain.</p><p>ZetaChain introduces onAbort, a new mechanism that executes locally on ZetaChain when a traditional revert cannot be completed: Ethereum → ZetaChain onCall fails → Insufficient gas → ZetaChain onAbort executes.</p><p>The onAbort function provides a final failsafe, ensuring assets are never trapped and allowing contracts to recover gracefully.</p><pre>function onAbort(AbortContext calldata abortContext) external {<br>    emit AbortEvent(&quot;Abort on ZetaChain&quot;, abortContext);<br>}</pre><pre>  struct AbortContext {<br>    bytes sender;<br>    address asset;<br>    uint256 amount;<br>    bool outgoing;<br>    uint256 chainID;<br>    bytes revertMessage;<br>}</pre><p>This is particularly critical for non-asset transfer transactions (gatewayEVM.call). Without onAbort, these transactions would have no way to recover.</p><p>The abort context provides the information you need to handle the recovery. sender is the original sender from the connected chain, asset and amount represent the deposited ZRC-20 tokens, chainID is the connected chain&#39;s ID and revertMessage has the same value passed to the original Gateway call. outgoing is false when a call was made from a connected chain and reverted on ZetaChain and true when the call was made from ZetaChain.</p><h3>Handling Outgoing Transactions: When Reverts Happen on Another Chain</h3><p>When a transaction is sent from ZetaChain to a connected chain, the flow is slightly different.</p><p>If the onCall function on the connected chain reverts, a cross-chain transaction automatically calls back into the universal contract on ZetaChain. Because ZetaChain features free cross-chain calls from connected chains, the revert mechanism doesn’t depend on having deposited tokens; the system will still call onRevert on ZetaChain, allowing the contract to handle cleanup or error logic.</p><p>In this scenario, the flow is: ZetaChain → Connected chain onCall reverts → ZetaChain onRevert</p><p>However, if onRevert itself fails on ZetaChain, the onAbort function is triggered to provide a final fallback: ZetaChain → Connected chain onCall reverts → ZetaChain onRevert reverts → ZetaChain onAbort</p><p>While most revert-related logic should be handled gracefully in onRevert, it’s reassuring to have an additional failsafe should something go wrong there as well.</p><h3>Why This Matters: The Future of Cross-Chain Reliability</h3><p>The introduction of onAbort makes ZetaChain’s failure handling far more robust than traditional cross-chain protocols:</p><ul><li>No stranded assets — Every transaction is either fully executed or accounted for.</li><li>Automated failure recovery — Developers no longer need manual fallback solutions.</li><li>Gas-aware reverts — The protocol ensures transactions have the resources they need to fail gracefully.</li><li>Safer cross-chain applications — App logic remains consistent, even in failure scenarios.</li></ul><p>This feature will be available in the next ZetaChain testnet release, and developers can already start integrating it with the <a href="https://github.com/zeta-chain/localnet">latest Localnet version</a>.</p><h3>About ZetaChain</h3><p>ZetaChain is the first Universal Blockchain with native access to Bitcoin, Ethereum, Solana, and more, offering seamless user experience and unified liquidity to the next billions of users. With its Universal EVM, ZetaChain empowers developers to build Universal Apps that operate natively across any blockchain, creating a fluid crypto ecosystem from a single platform.</p><p>Follow ZetaChain on Twitter <a href="https://twitter.com/zetablockchain">@zetablockchain</a> and join the conversation on <a href="https://discord.gg/zetachain">Discord</a> and <a href="https://t.me/zetachainofficial">Telegram</a>. Reach out to <a href="/service/mailto:partnerships@zetachain.com">partnerships@zetachain.com</a> if you’re building on top of ZetaChain.</p><p><strong><em>Any projects mentioned are 3rd party, not ZetaChain.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=313629c92e63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zetachain-tech-blog/zetachains-new-revert-handling-for-cross-chain-313629c92e63">ZetaChain’s New Revert Handling for Cross-Chain</a> was originally published in <a href="https://medium.com/zetachain-tech-blog">ZetaChain Dev Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Universal Apps on ZetaChain]]></title>
            <link>https://medium.com/zetachain-tech-blog/introduction-to-universal-apps-on-zetachain-15c1a608caea?source=rss----6f1c18f88b9a---4</link>
            <guid isPermaLink="false">https://medium.com/p/15c1a608caea</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[zetachain]]></category>
            <category><![CDATA[interoperability]]></category>
            <category><![CDATA[evm]]></category>
            <dc:creator><![CDATA[Denis Fadeev]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 14:25:16 GMT</pubDate>
            <atom:updated>2025-03-12T14:43:52.434Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pYrhDE9To1cFob2iPvj2w.png" /></figure><p><a href="https://www.zetachain.com/docs/">ZetaChain</a> is an EVM-compatible blockchain with built-in cross-chain interoperability.</p><p>A smart contract deployed on ZetaChain can handle <em>incoming contract calls</em> from any connected blockchain like Ethereum, Base, Polygon, BNB, Solana and Bitcoin. Contracts on ZetaChain can also make <em>outgoing contract calls</em> to contracts on connected chains. Contract calls can contain a payload of arbitrary data as well as gas and supported ERC-20 tokens.</p><p>Gas and ERC-20 tokens transferred to contracts on ZetaChain from connected chains are represented as <a href="https://www.zetachain.com/docs/developers/tokens/zrc20/"><strong>ZRC-20</strong></a> (an ERC-20-like token) on ZetaChain. For example, when you make a call with ETH, a contract on ZetaChain receives ZRC-20 ETH. Under the hood ETH is locked in ZetaChain’s custody on Ethereum and the same amount of ZRC-20 ETH tokens is minted to a contract on ZetaChain. Anyone can permissionlessly withdraw ZRC-20 back into native assets.</p><p>The mechanism that facilitates these incoming (to ZetaChain) and outgoing (from ZetaChain) is called <a href="https://www.zetachain.com/docs/developers/evm/gateway/"><strong>Gateway</strong></a>. Each connected chain has a Gateway that acts as a single entry-point for interacting with contracts on ZetaChain. There are Gateway contracts on <a href="https://www.zetachain.com/docs/developers/chains/evm/">connected EVM chains</a> like Ethereum and Polygon, Gateway program on <a href="https://www.zetachain.com/docs/developers/chains/solana/">Solana</a> and Gateway address on Bitcoin. <a href="https://www.zetachain.com/docs/developers/chains/zetachain/">ZetaChain</a> also has a Gateway contract, which is used to trigger outgoing calls.</p><p>For example, <a href="https://www.zetachain.com/docs/developers/tutorials/swap/">you can write a contract</a> that handles an incoming tokens from one chain, swaps them for target tokens and withdraws them to the destination chain. To perform a cross-chain swap using this contract a user would call a Gateway, for example, on Ethereum with an amount of USDC, which ZetaChain contract to call and data payload containing target token address. ZetaChain validators observing Gateways notice the transaction and make a cross-chain transaction to a swap contract on ZetaChain. A swap contract receives USDC and the payload, executes the swap, and withdraws the target token to the destination chain, for example, Bitcoin. In a single transaction an Ethereum user has initiated a cross-chain contract call to a contract ZetaChain, which swapped ZRC-20 ETH for ZRC-20 BTC and withdrawn native BTC to the recipient on Bitcoin.</p><p>A user was able to make a cross-chain swap between blockchains by making a single transaction on their chain of choice. They didn’t have to worry about gas, bridging assets, or switching wallets. Of course, swapping is just one example. NFT marketplaces, lending platforms, multi-chain governance mechanisms, yield aggregators, and more can be built on ZetaChain.</p><p>We call contracts like these <a href="https://www.zetachain.com/docs/developers/apps/intro/"><strong>universal apps</strong></a>, because they can orchestrate complex cross-chain transactions universally across all connected blockchains. Writing cross-chain apps as universal apps is easy, because most of the logic is encapsulated in a single contract on ZetaChain that can handle incoming calls and make outgoing calls to contracts on other chains.</p><p>Here’s a simple “<a href="https://www.zetachain.com/docs/developers/tutorials/hello/">Hello, World!</a>” universal app:</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity 0.8.26;<br> <br>import &quot;@zetachain/protocol-contracts/contracts/zevm/GatewayZEVM.sol&quot;;<br> <br>contract Universal is UniversalContract {<br>    event HelloEvent(string, string);<br> <br>    function onCall(<br>        MessageContext calldata context,<br>        address zrc20,<br>        uint256 amount,<br>        bytes calldata message<br>    ) external override {<br>        string memory name = abi.decode(message, (string));<br>        emit HelloEvent(&quot;Hello: &quot;, name);<br>    }<br>}</pre><p>onCall is a special function that gets executed whenever a Gateway on a connected chain is called. Gateways on Ethereum, Solana and Bitcoin all trigger the same onCall function. You can, of course, execute different logic based on the context.chainID or any other parameter.</p><p>It’s easy to <a href="https://www.zetachain.com/docs/developers/tutorials/call/">make outgoing cross-chain calls</a> from universal apps:</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity 0.8.26;<br><br>import &quot;@zetachain/protocol-contracts/contracts/zevm/GatewayZEVM.sol&quot;;<br><br>contract Universal is UniversalContract {<br>    GatewayZEVM public immutable gateway;<br>    event HelloEvent(string, string);<br>    error TransferFailed();<br><br>    constructor(address payable gatewayAddress) {<br>        gateway = GatewayZEVM(gatewayAddress);<br>    }<br><br>    function call(<br>        bytes memory receiver,<br>        address zrc20,<br>        bytes calldata message,<br>        CallOptions memory callOptions,<br>        RevertOptions memory revertOptions<br>    ) external {<br>        (, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(<br>            callOptions.gasLimit<br>        );<br>        if (!IZRC20(zrc20).transferFrom(msg.sender, address(this), gasFee)) {<br>            revert TransferFailed();<br>        }<br>        IZRC20(zrc20).approve(address(gateway), gasFee);<br>        gateway.call(receiver, zrc20, message, callOptions, revertOptions);<br>    }<br><br>    function onCall(<br>        MessageContext calldata context,<br>        address zrc20,<br>        uint256 amount,<br>        bytes calldata message<br>    ) external override {<br>        string memory name = abi.decode(message, (string));<br>        emit HelloEvent(&quot;Hello on ZetaChain&quot;, name);<br>    }<br>}</pre><p>To make a call:</p><ul><li>Query the gas fee in destination chain’s gas token ZRC-20</li><li>Approve the ZetaChain Gateway to use gasFee ZRC-20</li><li>Execute gateway.call</li></ul><p>zrc20 determines which chain a cross-chain call is made to (use ZRC-20 ETH address to call Ethereum), receiver is the contract being called on the destination chain and message is an arbitrary payload. By default an onCall function on the receiver contract on the destination chain is called, but it is possible to call any other function.</p><p>ZetaChain’s Gateway offers powerful features for developers to handle even the most sophisticated cross-chain scenarios:</p><ul><li>Deposit native gas or supported ERC-20 tokens</li><li>No-asset incoming contract call</li><li>Deposit and call</li><li>Withdraw ZRC-20</li><li>No-asset outgoing contract call</li><li>Withdraw and call</li><li>Outgoing calls to arbitrary functions (not just onCall)</li><li>Revert handling (Ethereum → ZetaChain onCall → Ethereum onRevert)</li><li>Coming soon: Abort handling (Ethereum → ZetaChain onCall → ZetaChain onAbort)</li></ul><p>ZetaChain and its universal apps make cross-chain interactions easier than ever. With ZetaChain, users can interact with your app from any blockchain without worrying about bridging, swapping tokens, or managing gas on multiple chains — it all just works. This opens up endless possibilities for developers to build cool, interconnected features like multi-chain DeFi platforms, NFT marketplaces, games, and much more. If you’ve been wanting to create apps that truly span multiple blockchains while keeping things simple for users, ZetaChain is the perfect place to start. The future of cross-chain innovation is here — time to build!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15c1a608caea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zetachain-tech-blog/introduction-to-universal-apps-on-zetachain-15c1a608caea">Introduction to Universal Apps on ZetaChain</a> was originally published in <a href="https://medium.com/zetachain-tech-blog">ZetaChain Dev Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>