Overview

Learn about how ZKsync Connect enables interoperable ZKsync chains.

ZKsync Connect enables interoperability across ZKsync chains in the Elastic Network. Interop, or interoperability, is a way to communicate and transact between two ZK Stack chains, or between a ZK Stack chain and Ethereum L1. It is made possible by smart contracts that verify transactions across chains using Merkle proofs.

It allows you to:

  1. Observe messages: Track when an interop message (think of it as a special event) is created on the source chain.
  2. Send assets: Transfer ERC20 tokens and other assets between chains.
  3. Execute calls: Call a contract on another ZKsync chain or Ethereum L1 with specific calldata and value.
  4. Execute bundles of calls: Group multiple remote calls into a single bundle, ensuring all of them execute at once.
  5. Control shadow accounts: Manage smart accounts on other chains, including L1, to execute transactions and manage assets without needing a local account on that chain.

Enhanced user experience

Interoperability enhances the blockchain user experience by abstracting complex cross-chain interactions. Users do not need to manually bridge funds to another chain in the Elastic Network if they already have funds on one.

  • Reduced Complexity: Users interact with a seamless interface that hides the underlying complexities of blockchain operations.
  • Asset Bridging: Relayers manage the process of bridging assets between chains, handling the necessary burning and minting of assets as they move across the ecosystem.
  • Lower Fees: By leveraging efficient relayers and minimizing manual operations, transaction costs are kept low, akin to standard gas fees within a single chain.

Real-World Application: Crosschain Transactions

Consider a practical scenario where you want to swap ETH for DAI using a crosschain transaction on a defi platform:

  1. Transaction Initiation: You initiate the transaction directly from your wallet.
  2. Relayer Involvement: A relayer picks up your ETH and deposits it into the defi chain.
  3. Asset Swap: On the defi chain, your ETH is automatically swapped for DAI.
  4. Completion and Return: The relayer then transfers the DAI back to your original chain.

This entire process is executed as a single transaction, making it feel as seamless as if no chain-switching occurred. The only difference a user might notice is a slightly longer confirmation time, depending on the specific ZKsync chain used.

Interop Swap

Transaction Lifecycle

An interop transaction in the Elastic Network follows these steps:

  1. Initiation: A transaction is initiated on a ZKsync chain, aimed at crossing to another chain within the Elastic Network.
  2. Settlement on L1: The sending ZKsync chain compiles a cryptographic proof of the transaction and settles it onto Ethereum's Layer 1, anchoring the transaction's validity.
  3. Interop Root Update: Gateway updates the shared interop/message root to include the source chain's new message root.
  4. Root Importation: The receiving ZKsync chain imports this updated interop root through its consensus mechanism.
  5. Bundle Submission: A relayer submits the bundle together with a message inclusion proof to the receiving ZKsync chain. This proof connects the bundle message to the imported interop root.
  6. Verification and Execution: The receiving ZKsync chain verifies the bundle message against the interop root. If the verification is successful, the transaction is executed, and the relayer is compensated for their service.
  7. Proof Settlement: Finally, the receiving ZKsync chain settles its proof on L1, conclusively validating the transaction within the Elastic Network.

Rollout Phases

There are three steps planned for rolling out full interoperability:

  1. Messaging
  2. Asset transfers, and transaction bundles
  3. Automatic crosschain transactions, L1 interop, and shadow accounts.

Only chains that settle on top of Gateway have access to interop features. To see which chains use ZKsync Gateway, check the Elastic Network Chains table.

Messaging is already available on all ZKsync chains that use Gateway. Asset transfers and transaction bundles are currently only available for local testing, but will be available for mainnet chains as part of the upcoming v31 upgrade.


Made with ❤️ by the ZKsync Community