We’re fortunate to have multiple Layer 2 networks that inherit the security guarantees of Layer 1 Ethereum at our disposal, like Optimism and Arbitrum, to name a few. Sidechains like Polygon have been a pivotal platform for Ethereum scaling and infrastructure development.
Because let’s be honest, the Ethereum mainchain doesn’t seem conducive for everyday transactions or onboarding new users. High gas fees can turn off even the most seasoned crypto native, and a myriad of scaling solutions is necessary for today’s environment.
In our prior tutorials, you learned how to move your assets from Mainnet to your L2 of choice using your MetaMask account. While it's great to have all these L2s—going back to the L1 to go to another L2 kind of defeats the purpose of having L2s, right? That’s where bridges come in handy—streamlining cross-chain activity—L1 → L2, L2 → L2, and L2 → L1.
If you can just hop around all the scaling networks, that removes the high gas fees bottleneck that people go through when moving through Ethereum Mainnet. Today, we’re diving into Hop Protocol, a token bridge for Ethereum’s layer 2 ecosystem.
Why Hop?
Hop Protocol is a way to connect different scaling solutions, facilitating a better user experience when moving assets.
Hop currently supports the transfer of funds ETH, USDC, MATIC, DAI, and USDT from and to the networks Mainnet, Polygon, Optimism, Arbitrum, and xDai.
Using Hop also allows you to withdraw your funds from optimistic rollups without the 7-day waiting period 🎉
Sending Assets Using Hop
First, you’ll need to have a wallet like MetaMask with funds to transfer.
Note: Keep in mind that it would also be a good idea to have the native gas token of the chain you are transferring to. For example, if you transfer ETH to Polygon, but have no MATIC, you won’t be able to do anything with your ETH as you’d need MATIC to pay for transactions. Have your wallet and assets ready? Head over to Hop to begin.
You’ll need to connect your wallet in the top right corner and select MetaMask. Once connected, you can choose which networks to transfer your assets TO and FROM. In this example, I’ll be transferring WETH from Polygon to Optimism. (You don’t have to worry about wrapping or unwrapping your tokens).
After selecting your token to transfer, entering the amount, and choosing your networks, click “Approve” to commence the transaction and sign in your MetaMask account:
You’ll receive a confirmation like this once that’s done. Click “Send”:
Note: I already had MATIC in my wallet on the Polygon network which enabled me to pay for the transfer.
After approving the transaction in MetaMask, you’ll see a window pop up, with a time estimate:
You should see your funds on the new network after ~ 5 minutes. Congrats! You just bridged between L2s without having to move back to Mainnet or paying an exorbitant amount in gas fees :)
How It Works
Hop Protocol works by leveraging Bonders, who earn a small fee by fronting the liquidity at the destination chain. At a very high level, a user sends tokens to the Bonder on the source chain and the Bonder sends tokens to the user on the destination chain.
The complicated part of the protocol is to ensure that the user does not have to trust the Bonder. The protocol wants to prevent the Bonder from receiving tokens on the source chain but never sending something on the destination chain.
Therefore, the protocol uses specialized tokens, called hTokens—which act as an accounting tool. The cool feature of hTokens is that they can be batched together and moved to Ethereum Mainnet and from there to another chain. But this might take a while. Waiting for hTokens to eventually arrive at the destination chain is no problem for the Bonder, but might be for the end-user. Therefore, the Bonder provides liquidity upfront for the end-user, once it knows that the user’s tokens are included in the batch to make the journey.
So, for example, when Alice wants to send DAI from Polygon to Optimism the protocol consists of five steps. For the user—Alice—those steps can be abstracted away and bundled into one transaction on the source chain.
Alice swaps her source chain DAI for hDAI - using an AMM on the source chain.
Alice then burns the hDAI on the source chain and she gets a slot in the transfer batch. Eventually, the information about her burnt hDAI will propagate through L1 to the destination chain.
A Bonder sees that Alice has burnt her hDAI on the source chain. It can now lock up DAI on the destination chain to mint hDAI.
Alice receives that hDAI on the destination chain and can now swap her hDAI for DAI using another AMM.
After many other transfers, the information of Alice’s burned hDAI will be propagated to the destination chain and the Bonder can finally unlock its DAI from step 3.
This all happens on the backend while you begin your transfer.
You can think of hTokens like a shadow token that follows the real token. Hop protocol allows for a near-instant transfer because Hop has assets on all of the chains, allowing someone on Chain A to easily go from B to C.
On a basic level, Hop’s security is comparable to the security of Optimistic rollups—if bonders try to cheat, they get slashed. There are “Challenge Watchers” that attempt to keep things in order. However, at the moment Bonders need to be whitelisted by the Dev team and it is unclear how many Watchers oversee the Bonders activity.
Source: Hop Protocol
Hop aims to be a trustless bridge protocol that allows for a lot of economic activity to happen. The more users and asset transfers happen, the cheaper the fees become as it’s amortized across users.
If you’re interested in earning yield through Hop, you can simply head to their Pool dashboard to start earning fees as an LP.
Final Thoughts
Hop will continue to add more rollups to make cross-chain activity seamless. For now, if you want to move from L1 → L2, L2 → L2, and L2 → L1, here’s a recap on how to do so using this bridge:
Go to Hop.Exchange
Connect your MetaMask wallet
Select the asset you want to transfer
Select the network you want to transfer to and from
Click “Approve” and “Send” and sign the transactions in MetaMask to start the transfer
Layer 2s and side chains will continue to scale Ethereum. As more of them arrive, bridges will ensure that our assets aren’t siloed on these networks. We can conduct cross-chain activity without friction, not have to wait extended periods to withdraw our funds, and not have to bring our assets back down to Mainnet to transfer to another network.
Bridges will facilitate a better user experience and enable users to become L2 citizens.
Keep enjoying your adventures while you hop your way around the Web3 world 🐇.