Building with Hyperlane Interoperability Framework - ETHGlobal London 2024
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Join Dan Savu from Hyperlane for a workshop titled, "Building with Hyperlane Interoperability Framework." This workshop took place at ETHGlobal London 2024, a 3-day hackathon held at the Truman Brewery in London from March 15 to 17, 2024. The event brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com Email us at: hello@ethglobal.com
Transcript
[Music] uh nice to see you all I'm Dan I'm an engineer on the team at hyperlane um who here knows about hyperlane already that's amazing um so you may have heard about hyperlane in the context of a protocol uh today I want to talk about it in the context of it being an interoperability framework and what you can build on top of it but also for it because it spans many VMS and chains and uh it's a very kind of like wide encompassing protocol um to set some context you know nowadays daps live on increasingly Divergent infrastructure layers or like settlement layers um sure you fored about like monoliths if you have a your dap live on ethereum maybe there's one tradeoff space that you're looking to make maybe you want access to lots of liquidity and a lot of uh protocol composability at the cost of high fees uh and you know solidity if you want to deploy on Solana you're going to have lower fees but you have to learn a new like Paradigm with managing account State and learning rust um some Ops for going the app chain route like Cosmos and polka do you know those who want to have control over block production maybe they want to tweak consensus parameters or uh you know transaction inclusion priority uh but that still requires you to learn a new I guess smart contract Paradigm uh if you want to stay within the ethereum realm in the evm and uh use solidity you might build your dab as a rollup uh and you're going to have to do with da layers and uh whatnot but obviously going on the layers two you lose some composability that's inherent on the layer one um but you do give users lower fees and then there's even been talk recently about ephemeral chains uh you know those spinup uh based on demand just like in web 2 with Cloud Computing Services and even l3s um but with that you know interoperability today is highly fragmented say if you're building rollup um as a developer with your Dap You have to support several interfaces like deposits and withdrawals from L1 into L2 um asset bridging like you have to integrate another provider most likely to bridge tokens to other l2s uh and that doesn't even touch on General message passing like if you have um a Dap that lives on several chains and you have a cross-chain dow and you're on a like propagate the Dow decisions from one chain to all of your deployments that falls under General message passing and you know I don't think there's too many providers that uh help with that off the shelf we've had a integrate with us but with a custom integration but we're trying to service like all of those use cases uh on as many VMS as possible in Chains um if we keep to the rollup world and you look at Caldera you can go onto their website and within 5 minutes it's really just um mix and match for a variety of parameters and you can launch a roll up like can use the op stack pick the native token and the da layer um and then you have a rollup and that's it's up and running it's probably scalable uh it's up to you to you know how you I guess take it further and if you want to decentralize the sequencer and so on but you're still kind of secluded you don't have have easy access to liquidity other than via the layer one and you have to start playing the BD game uh you go to other you know bridging providers or l2s and you set up a road map to plan uh a bridge deployment um and we think this could be different we view for instance if you look at this modular stack um I think interoperability should be part of it intrinsically like maybe when you deploy a rollup you'd also have a bridge deployed by default onto like for all the chains you want to connect to and this was like I guess the original hyperlane Vision which all of you might already be familiar with uh and we're trying to make it clear that hyperlane is like way more than that um hyperlane really what it does is it separates the transport layer of interoperability from the application layer so if you think about the layers of the internet OSI stack um you know you have like four broad layers and say your dap lives at the application layer ideally you don't want to have to think about the bridging provider you're using or the security they're using maybe you want to have it configurable but not have to deal with all that complexity yourself so all you have to do is integrate with the hyperlane smart contract and then that abstracts away again if you're talking to an evm like to your up and you talk to the lar 2 maybe use the canonical bridge if you're talking to a cosmos chain maybe it's a multisig but that's all abstracted away from you at the DAP layer and then yeah below the transport layer there's a bunch of offchain infra where there's a relayer that's running there's a key fun that makes sure the relayer has funds so it can keep sending messages cross chain and a bunch of other stuff and obviously at the lowest level we're kind of just abstracting away the internet uh so we're really trying to provide the consistent interface you integrate with hypine once and then your protocol is future proof to any sort of like bridging models that become available uh at a bit of a lower level say you're You're On An Origin chain want to send it to a destination what you do is you call a contract we call the mailbox uh you tell it the destination chain the recipient and the body can be anything like a bunch of btes it could be an encoding of your choice or whatever then there a relayer that indexes that mailbox and we'll see hey there's a new message going in a certain direction by the way the relayer is permissionless um and it will call the destination chain uh the mailbox contract on it and very interestingly the mailbox will call into the recipient contract which gets to pick the security module it wants to use to validate like the authen authenticity and security of the message um so say again you on a Cosmos chain maybe uh and your message is incoming from a cosmos chain you can use IBC for that and tell the mailbox just use the IBC security module you're on an L2 and the message is coming from the L1 the recipient can just say hey just use the canonical Bridge um and this is kind of the same thing uh but visualized more broadly like across ecosystems um if you're launching something on Cosmos and IBC is amazing but you don't want to you know be constrained to that and there's lots of liquidity and users available outside of that same with the layer two you just it took you 5 minutes to learn something on Caldera but you don't want to be isolated uh you can pick different security modules obviously this isn't ideal from a security perspective but we try to take a very pragmatic view where you can launch something from day one and you don't have to wait for like two years to wait for a light client to be developed between you know the roll up the VM that your rollup runs and then the broader crypto ecosystem uh but obviously making it very easy to select different uh security modules wouldn't make much sense if you then need to come to us like hyperlane and uh Lobby us to deploy onto your chain and so to that end we've invested a lot of time and resources into being fully open source and having uh great docks to help you deploy hyperlane and run the infrastructure on your own should you want to um there's a link to our DOC website in there and I'm actually going to run you through deploying a hyperlane general message bridge but also a token Bridge um without actually running commands Cu uh Workshop internet tends to be terrible but um what you have to do is basically go to mpm and install the hyping CLI if you're just you've just launched a new chain um you do yeah config create chain which just asks you for the RPC URL a name basically stuff you'd add onto your metamask wallet when when when supporting a new chain uh you can specify the ism like the security module you want to use and say if it's a multisig is going to ask you for the list of signers and the threshold and then that's all you're going to have some output Json files that you're going to be able to use like uh with the configurations you just created and run this deploy command which is like Target chains the files you just created uh an assigner key and it's going to deploy all the contracts to all the chains you specified and we going to have basically a production ready or like at least the private key is going to own it for a start but it's going to you know it's going to be a bridge that you can start working with further decentralized maybe later um ready to go but now you need like infrastructure to connect those various uh chains right again using the artifacts from the earlier commands you can run hyperlane deploy cytosis agents and cytosis is this um cloud uh infrastructure company that we've partnered with it will take your Jon artifacts and output a URL you click on it you just input a private key to run uh the relayer and validator with and you're going to have infrastructure spun up for you just like that so you don't need to worry about it and you can start working on your cross chain dab having like the entire bridging later abstracted away from you and you can even send the test message uh with the hyper CLI cool so now you have like General message passing live maybe you want to start bridging tokens uh and war routs is our take on token bridging it's again a collection of contracts that allows you to move like either native tokens rc20 RC 721 uh to foreign chains and it's basically an abstraction on top of the mailbox contract that I mentioned earlier and we provide the UI template as well takes another 10 minutes to deploy token Bridge uh again you run a command to configure the war prow you deploy the contracts you clone the warp UI template pasting the configuration from you know your earlier deployment so it knows how to connect to the chain and um all of that and just the yev to spin up a local UI and you have a live token Bridge with a nice UI again ready to go uh and to show to your investors and maybe convince them that maybe it's time for them to fund you to build a light client because you know you're kind of of uh app works at the proof of concept level uh and since we're at the hackathon let's also quickly cover the bounties so you can build at any layer we tried to keep the bounties as um General as possible so you can build a Dap on top of an existing hyperlane deployment you can uh build a contract like an ism or tooling for deploying and versioning contracts cross chain uh you can improve offchain agents like um maybe creating a better key funder uh or tooling for it or analytics just to track how messages move across chain um one of the bounties is called best permissionless use and that would involve deploying hypol yourself an idea is to create the Dex on Main net that allows you to buy test net tokens cuz some of them are pretty darn hard to get you know a handle of uh so you can deploy a war Prout testet domaina uh deploy like either Unis V2 or a fixed price contract for Redemption um and then you know buy say from sapoia to base and buy on base some eth sapoia uh and then you're able to bridge it back and you have a bunch of spolia eth I know the hackathon is very generous and gives you like a thousand of that but you know you get the point um you can also build like a cross chain key funer where you have balance on a single chain but you have like deployments several chains uh and you want to be abstracted away from having to fund all of that cuz it's an operational nightmare you can Bridge via hyperlane uh then swap on whatever decks you want that's available on that VM like you know yeah obviously in the evm you have Unis swap but maybe on Solana you have to use Jupiter or something uh and you swap there and then maybe switch to the native gas token of that VM and there you go it's all all automated and you just run a service and it will do the topping up for you um and we also have something called the most creative use of hyperlane where we really just want you to I guess go crazy like this protocol really spans a lot of layers of complexity and a lot of VMS and a lot of chains like there's many things you could do with it one of them being like you can register uh cross chain limit order on a unisoft V4 hook which you've just seen the uh Workshop of earlier and you can customize the hyper reler to scan for prices cross chain to find the price limits and then fulfill it um and then we also have a bounty that's the most generous Bounty it's uh $4,000 on top of an existing uh category for the best project cuz uh some of these projects are kind of like uh big undertakings um so again you can build anything you want but um should you want more inspiration scan this QR code and it'll take you to a list of our GitHub issues that have a bounty label um again some of them are like quite involved but maybe you can find something that you find interesting and with that uh I'm inviting you to build the modular expansion and I'll take some questions if there's no questions I can keep talking um okay I'll tell you a bit about like some other abstractions please raise your hand if you have questions we have some uh abstractions on top of the contracts we already provide um one of them they're kind of inspired by IBC one of them is called the interchain accounts API that allows your contract that you own to have uh control over an address on foreign chains and the way it works is via an API contract uh that's deployed and again it lives on top of the mailbox uh and it can hold funds and you can basically use this interchain accounts API for the Dow example that I just gave earlier where you want to run voting somewhere on some chain and then propagate governance changes or yeah who knows what other use cases and then there's another API we support uh I think both of these are available via the by the way like you can deploy them on top of the general message passing Bridge uh and The Interchange queries API is basically a round round uh trip call to read some data from a destination chain at like some contract interface that you probably already know uh and once that data is read the API contract will itself make a call to the hyperlane mailbox uh that's like bound back to you and it will call your contract back with the result of that call so this is essentially you know an asynchronous interface similar to like how we use the internet today to read data um cross chain and probably in the future do right operations cross chain as well um and you know solidity today is built to support only synchronous code but I think in the future we might be seeing a in Kuwait hit the solidity world as well and start using more and more uh kind of like web 2 paradigms we're used to yeah so question in that context so for example let's say you want to build a okay question let's say you want to build a very Universal uh Oracle with prices from many many many dexes and so you want to grab those prices you you you're noding songs like that would be a good use of that yeah definitely like you can use the interchange query API obviously like you'd probably have to Lobby chain link to deploy to your chain if it's like a new rollup or something but if you use the interchain query API you can like bring that data to your chain on demand whenever you need it uh so that' be a great use case actually and yeah we've had an event with Flare yesterday and they're basically a layer one that's dedicated to you know oracle data you could use that as well cool yeah okay when we need to pay the fees uh need to be in the or um we can connect a pay Master on the front what the recommendation there uh you mean for paying fees to send the message cross J mhm uh so I said earlier that relaying messages is permissionless uh for the bridges that hyperlane supports uh say off the shelf there's a default relayer that's configured then you'll have to pay based on a gas Oracle but you know if you want to relay a message yourself you could do that for free right I mean you pay the gas out of your own wallet but normally yeah the relayer or whoever registers to run as a relayer they would have to maintain a gas Oracle for all the destination change they support uh but you get to pick your relayer actually when you call into the mailbox so it could be any service provider yourself yeah very quick yes yeah exactly so there's the warp route contract basically have counterparts one that lives on the origin chain and one on the destination and they're kind of aware of each other we can talk more outside if you want that's cool thanks for attending everyone happy building [Music]
Automatic transcript — names and jargon may be misspelled.