How To Bridge Your Assets Using Hop Protocol
We鈥檙e 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鈥檚 be honest, the Ethereum mainchain doesn鈥檛 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鈥檚 environment.聽
In our prior tutorials, you learned how to move your assets from Mainnet to your L2 of choice using your MetaMask account. 鈥嬧媁hile it鈥檚 great to have all these L2s鈥攇oing back to the L1 to go to another L2 kind of defeats the purpose of having L2s, right? That鈥檚 where bridges come in handy鈥攕treamlining cross-chain activity鈥擫1 鈫 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鈥檙e diving into Hop Protocol, a token bridge for Ethereum鈥檚 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鈥檒l 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鈥檛 be able to do anything with your ETH as you鈥檇 need MATIC to pay for transactions.聽Have your wallet and assets ready? Head over to Hop to begin.
You鈥檒l 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鈥檒l be transferring WETH from Polygon to Optimism. (You don鈥檛 have to worry about wrapping or unwrapping your tokens).
After selecting your token to transfer, entering the amount, and choosing your networks, click 鈥淎pprove鈥 to commence the transaction and sign in your MetaMask account:
You鈥檒l receive a confirmation like this once that鈥檚 done. Click 鈥淪end鈥:
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鈥檒l 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鈥攚hich 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鈥檚 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鈥擜lice鈥攖hose 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鈥檚 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鈥檚 security is comparable to the security of Optimistic rollups鈥攊f bonders try to cheat, they get slashed. There are 鈥淐hallenge 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.
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鈥檚 amortized across users.聽
If you鈥檙e 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鈥檚 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 鈥淎pprove鈥 and 鈥淪end鈥 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鈥檛 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 馃悋.