Gelato Network: Web3 Functions, Gelato Relay and 1Balance
July 21st, 2024

Cross-chain bridges play a crucial role in blockchain technology. One of the important aspects of bridges is to enable secure transfer of assets and data between different blockchain networks.

How Do Cross-Chain Bridges Work?

The process of transferring tokens via a cross-chain bridge typically involves several steps - Locking/Burning Tokens on the source blockchain and Minting/Unlocking Tokens on the destination blockchain.


Types of Cross-Chain Bridges

Cross-chain bridges can be categorized based on their underlying mechanisms:

  • Lock and Mint: Tokens are locked on the source chain, and wrapped tokens are minted on the destination chain.

  • Burn and Mint: Tokens are burned on the source chain, and new tokens are minted on the destination chain.

  • Lock and Unlock: Tokens are locked on the source chain, allowing the unlocking of equivalent tokens from a liquidity pool on the destination chain.

Which method is the best ? Depends on specific requirements.

If you are looking for maximum security then Lock and Mint might be preferred as it preserves original tokens. For permanent transfers and supply management Burn and Mint could be more suitable. For speed and existing liquidity Lock and Unlock might be the best choice.


Gelato Network's Role in Cross-Chain Bridging

There are Centralized bridges and Decentralized bridges.

Centralized bridges often suffer from single points of failure, making them vulnerable to hacks and security breaches. Decentralized bridges, while more secure, can be complex and inefficient. They may struggle with scalability and liquidity issues, and the user experience can be exhausting due to the need for multiple transactions and high gas fees.

This is where Gelato Network comes in.

Gelato improves cross-chain bridges by providing several key functionalities: Web3 Functions, Gelato Relay and 1Balance. Let’s look closer at each one of them.

Web3 Functions

Gelato's Web3 Functions allow developers to create automated workflows that listen for specific blockchain events, like token burns, and trigger corresponding actions, like minting tokens on another chain.

Think of Web3 Functions like of super-attentive, always-on nanny for blockchain operations. Just as you give a nanny instructions about kids' routines and preferences, developers program Web3 Functions with specific tasks.

This digital super nanny remembers and executes these instructions across different blockchains without constant supervision. They ensure the children's safety and well-being across different locations, just how Web3 Functions manage activities across different blockchains.


Gelato Relay

Gelato Relay is a service that enables gas-less transactions, which are essential for user-friendly cross-chain operations. By using Gelato Relay, developers can ensure that transactions like minting and burning tokens are executed seamlessly across different blockchains.

Let's think of it as a postal service for blockchain transactions. Just like a postal service handles the complexities of delivering mail (sorting, routing, delivering), Gelato Relay manages the details of blockchain transactions and ensures that your transaction is processed correctly and reaches its destination on the blockchain.

A postal service can deliver mail to different locations around the world. Gelato Relay supports transactions across different EVM-compatible blockchain networks, handling multi-chain operations.

A good postal service also provides a seamless and user-friendly experience, making it easy to send and receive mail. Gelato Relay improves the user experience in Web3 by abstracting the complexities of blockchain transactions, allowing developers to create more accessible and user-friendly applications


1Balance

1Balance allows developers to deposit funds (typically USDC on Polygon) into a single balance, which can then be used to cover gas fees across all supported blockchain networks.

Let's think of it as a prepaid gift card for blockchain transactions.

Similar to how a gift card might work at multiple stores in a shopping mall, 1Balance can be used across different blockchain networks that Gelato supports. 1Balance allows you to load up funds in advance. This balance can then be used to cover transaction costs (gas fees) on various blockchain networks.

With a gift card, you don't need to carry cash or a credit card for each purchase. Similarly, 1Balance eliminates the need for users to hold native tokens of each blockchain for gas fees.


Use Case: ERC20 Mint & Burn Bridge between Arbitrum and Optimism Sepolia

I’ve built the bridge between two chains using Gelato Relay, Web3 Functions and 1Balance.

A quick overview of how this bridge works:

  • I have ERC20 contract deployed on both Arbitrum Sepolia and Optimism Sepolia. The smart contract on each chain is responsible for burning and minting tokens.

  • The Web3Function acts as the bridge, it listens and monitors both chains for Burn events and initiates cross-chain actions.

  • Gelato Relay is used to handle the cross-chain communication and transaction execution.

  • 1Balance allows me to maintain a single balance to cover gas fees for both Arbitrum and Optimism, eliminating the need to hold native tokens on each chain.

You can find my GitHub project repo here and follow the instructions in README to start the project. Initiate a Burn transaction using the UI and keep track of the transactions using your digital wallet.

Getting Started with Gelato Network

The easiest way to start building using Gelato Network is by reading the official documentation and understanding more in detail how Web3 Functions, Gelato Relay and 1Balance work.

You can also find a quick-easy guide on how to deploy your first rollup here


Subscribe to Diana
Receive the latest updates directly to your inbox.
Nft graphic
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from Diana

Skeleton

Skeleton

Skeleton