TLDR:
Bridges allow us to move liquidity and data between otherwise disconnected blockchains - there’s an example below of bridging from Ethereum to Polygon.
Bridges have smart contracts holding tokens on either chain, and a central validator that on receipt of tokens on one chain will release them on the other.
Risks include hacks of these smart contracts and dodgy bridges that don’t send you your tokens.
Layer 0 protocols are an alternative to bridges, providing natively multi-chain envrionments. Yet bridges are still needed to jump in-out of them.
Over the last two weeks I wrote about CEXs and DEXs and their main differences, and went deeper into the most popular type of DEX, namely the AMM. CEXs, DEXs and AMMs are fundamental concepts to being able to navigate and understand the more complex topics in Web3.
Today I’ll cover “bridges” another fundamental topic!
We live in a multi-chain world and while you can use a centralised solution like a CEX to move tokens between blockchains, the decentralised Web3-native method is through bridges!
What is a Bridge?
From Bitcoin to Ethereum to Polygon to Solana to Avalanche, there are already hundreds of different blockchain networks out there! We live in a multi-chain world and over time there will only be more and more chains.
However, these chains for the most part live in their own little virtual islands, so how do we connect between all these islands?
The answer is: Bridges!
Bridges are the most popular Web3-native solution to hop between networks, they are the code equivalent of real bridges connecting these otherwise separate blockchain islands.
The most basic implementation of a bridge is to have a smart contract on either network alongside a centralised validator owning and monitoring these contracts. Bridges get very close to being a decentralised solution but currently still need a centralised middleman in the form of validators to help.
So for example a bridge between Ethereum and Polygon such as Polygon’s native one, will have the following parts:
A smart contract on Ethereum
A smart contract on Polygon
The centralised website and validators that Polygon runs
Then when someone on Ethereum wants to bridge some MATIC, they will open the Polygon bridge site and send the MATIC to the bridge’s Ethereum smart contract. The validator will monitor the Ethereum contract and on receipt of the MATIC it will inform the Polygon contract to send MATIC to the user’s Polygon address.
Bridging can also be used for NFTs, where on transfer an NFT gets locked or burned on one chain and minted by an official bridge contract on the other chain. For example Pudgy Penguins have done this with the help of Layer Zero creating what they call a Soultransport to bridge Lil Pudgy NFTs between Ethereum and Polygon.
With all that said let’s go through an example of bridging to highlight how simple it is.
Using the Polygon bridge
In continuing with the Ethereum and Polygon example we’ll look at the Polygon bridge and run through the exact steps below:
Open the bridge website
Connect your wallet in the top right
Select the exact token and the amount to bridge in the Deposit box in the middle, in this case I’m transferring 10 MATIC.
Hit Transfer when you’re ready and take a look at the transfer overview, which displays the two transactions needed and gives you an approximate gas cost.
Select “Continue” then sign the transaction to approve spending.
Select “Continue” once again and this time approve the transfer transaction.
At this point you’ll just need to wait and the transfer will eventually arrive!
It can take up to 30m for the transfer to go through but Polygon’s native bridge is very reliable and you can be certain you’ll receive your MATIC!
Most EVM compatible networks like Avalanche and the recently released Base have their own specific bridge. Yet, there are also more generic bridges that link up multiple chains like Portalbridge, these more generic bridges work very similarly and I’ll cover one or more in a future post since there are countless ones out there.
Be aware of the risks!
Since most bridges require a centralised middle-man and a pool of liquidity on either chain there are many risks involved. The fact these contracts end up storing a lot of liquidity means they become what’s known as a “honeypot”, in other words an easy target for hackers to go after.
Bridges accounted for over half of the largest hacks last year in 2022 and so in time we may see new and more innovative methods of bridging. You can see here that the 2 largest scams other than FTX imploding were the Ronin and Wormhole bridge hacks!
Sometimes when bridging you may receive a wrapped version of the token on the new network - don’t ever leave your money in wrapped tokens because if the bridge gets hacked then those tokens will lose value or worse become worthless!
Moreover sometimes bridges are just faulty and you send tokens on one side but don’t receive them on the other side. For example during my testing for this post I made use of the Multichain bridge (previously Anyswap) but it has been switched off for weeks, which I discovered the hard way as I lost some tokens in the process.
Fundamentally all bridges work with this principle of having a contract on either side, however some are more secure than others.
For example with Bitcoin’s Lightning Network, to transfer Bitcoin into Lightning you need to send your BTC to a hash-time locked contract (HTLC), then it will lock up some BTC on the Bitcoin L1 network and create some new Lightning-BTC for you on the Lightning L2 network.
The architecture of Lightning is so secure that you don’t rely on a middle-man here, there’s essentially thousands of little contracts locking the respective BTCs so there’s no honey pot for hackers!
As you can see there’s space for bridges to improve. However, the concept of a bridge is an incredibly important one for Web3 and any new solution that emerges will just be a more secure variant of today’s solutions.
Layer 0 Protocols
Layer 0 protocols attempt to solve the problem of connecting multiple chains by natively supporting multi-chain environments. Cosmos and Polkadot are two of the best examples of this.
With Ethereum there are lots of L2s and so setting up bridges is required to navigate between them, meanwhile with both Cosmos and Polkadot you have ways of simply spinning up new chains that connect up natively.
For example with Polkadot there’s a single central chain for co-ordination and lots of sidechains (known as “parachains”) that connect up to this central chain. This is a similar concept to how Ethereum 2.0 uses the beacon chain for consensus and will have hundreds of shards connecting up to it, yet in Polkadot these aren’t shards of the same blockchain but rather entirely different chains that all connect together.
Polkadot is often then visualised as tight ring of chains connecting and cross communicating as shown below.
Nonetheless, to move liquidity in or out of Polkadot from a separate ecosystem like Ethereum you still need the traditional bridges discussed before.
Therefore, as Ethereum scales further and further with more L2s, and bridging becomes easier and better, its not entirely clear whether the L0 use-case will thrive. This is because Ethereum’s network effects are huge and people will likely prefer to build their own EVM based L2 than use Polkadot’s lesser known Substrate framework.
A clear example of this is Coinbase’s recently released Base which has been built as its own EVM-compatible L2 blockchain (with the Optimism stack), rather than a Polkadot parachain! But only time will tell which of these will be most popular.
I’ll likely discuss L0 protocols further in a future post, but it felt important to include them here to show competing views in the space on connecting our multi-chain world.
And that’s a wrap!
Today we’ve covered bridging well enough for you to be able to understand how it works and be able to bridge your own assets between chains.
So now you don’t need to send coins to a CEX to move liquidity onto another network, you can just use bridges to jump straight between blockchains!
But there are risks, be wary of hacks and dodgy bridges, and never leave tokens in their wrapped form when you receive them from a bridge.
Yet, as more and more blockchains emerge the likelihood is that more and more bridges will too and the technology will become better and more secure!