Skip to main content

Bridging XTZ between Tezos layer 1 and Etherlink

You can bridge the native token on Etherlink and Tezos, which is called tez and shown on price tickers with the symbol XTZ. You can bridge tez from Tezos Mainnet to XTZ on Etherlink Mainnet and back, and you can bridge tez from Tezos Testnet (Ghostnet) to XTZ on Etherlink Testnet and back. For more information about tez, see Tokens on docs.tezos.com.

Etherlink provides canonical bridges for XTZ tokens. These bridges are trustless and permissionless; anyone can use them without restrictions or the intervention of a third party.

Bridging time

Tokens that you bridge from Tezos layer 1 to Etherlink are available for use on Etherlink immediately.

Tokens that you bridge from Etherlink to Tezos layer 1 are available for use on Tezos in two weeks.

This delay is caused by the Smart Rollup refutation period. As with all Smart Rollups, Etherlink nodes post commitments about their state to Tezos layer 1, including incoming bridging transactions, on a regular schedule. Other nodes have the length of the refutation period (14 days) to challenge those commitments. At the end of the refutation period, the correct commitment is cemented, or made final and unchangeable. Users can execute the bridging transactions in a commitment only after the commitment is cemented.

The Etherlink indexer run by Nomadic Labs automatically executes these bridging transactions when they are cemented, which makes the bridged tokens available on Tezos.

Using the canonical bridges

To use these bridges, follow these general steps:

  1. Connect your Tezos and Etherlink-compatible wallets.

  2. Select the type of transfer:

    • Deposit transfers XTZ from Tezos layer 1 to Etherlink
    • Withdraw transfers XTZ from Etherlink to Tezos layer 1
  3. Enter the amount of XTZ tokens to transfer.

  4. Click Move funds to Etherlink or Move funds to Tezos.

You can monitor the status of your bridge operations on the Transaction History tab.

How bridging XTZ works

The process of bridging XTZ between Etherlink and Tezos layer 1 uses two contracts on Tezos layer 1:

  • A bridge contract that accepts deposits and sends them to be exchanged. This bridge contract is not a fundamental part of the bridge; it is a helper contract that avoids limitations around tickets by forwarding them to the Etherlink Smart Rollup on behalf of user accounts.

  • An exchanger contract that stores the tokens and issues tickets that represent those tokens. This contract is a fundamental part of the bridging process because Etherlink accepts tickets from only this contract for the purpose of bridging XTZ.

Deposit process

The deposit process (moving tez from layer 1 to Etherlink) follows these general steps:

  1. A Tezos user sends a request to the layer 1 bridge contract's deposit entrypoint. The request includes the tez to bridge, the address of the Etherlink Smart Rollup, and the user's Etherlink wallet address.
  2. The bridge contract stores the address of the Etherlink Smart Rollup temporarily.
  3. It sends the tez in a transaction to the exchanger contract's mint entrypoint.
  4. The exchanger contract stores the tez and creates a ticket that represents the receipt of the tokens.
  5. The exchanger contract sends the ticket to the bridge contract's callback entrypoint.
  6. The bridge contract forwards the ticket to the Smart Rollup inbox and clears its storage for the next transfer.
  7. Etherlink Smart Rollup nodes receive the deposit transaction from the Smart Rollup inbox.
  8. The Smart Rollup nodes put the deposit transaction in the delayed inbox.
  9. The sequencer requests the state of Etherlink from a Smart Rollup node and receives the delayed inbox.
  10. The sequencer creates a corresponding transaction on Etherlink to transfer XTZ from the zero address to the user's address.
  11. The sequencer adds this transaction to a blueprint as in the usual transaction lifecycle described in Architecture.

This diagram is an overview of the deposit process:

Overview of the token bridging deposit process

Withdrawal process

The withdrawal process (moving XTZ from Etherlink to tez on Tezos layer 1) follows these general steps:

  1. An Etherlink user sends XTZ and their layer 1 address to the withdrawal precompiled contract in the Etherlink Smart Rollup via an Etherlink EVM node.
  2. The contract locks the XTZ.
  3. The contract creates a transaction to the exchanger contract's burn entrypoint and puts this transaction in the Smart Rollup outbox. This outbox message becomes part of Etherlink's commitment to its state.
  4. When the commitment that contains the transaction is cemented on layer 1, anyone can run the transaction by running the Octez client execute outbox message command.
  5. The exchanger contract receives the ticket, burns it, and sends the equivalent amount of tez to the user's layer 1 address.

This diagram is an overview of the withdrawal process:

Overview of the token bridging withdrawal process