How to reach cross-chain interoperability
ETHCC 4 · July 2021 · 14:23
Polina Aladina introduces ChainBridge, explains how it works and discusses what projects need to use it for cross-chain interoperability.
Speakers
Topics
From ETHCC 4, hosted by Ethereum France.
Transcript
all right we're starting awesome hello everyone yeah not so much people after yesterday's rave anyways um so today i'll be talking about how to reach cross cross-chain interoperability and yeah usually the way to do it is to build a bridge so obviously we'll be talking about bridges today and specifically we will be talking about the chain bridge that's an awesome product made by chainsafe but first let's talk a little bit about chainsafe so we're a blockchain company who believes that only working together we can actually build a nice bright future and reach a common goal of adopting a web 3 and reach mass adoption so my company works at a lot of
projects within the ecosystems like ethereum or filecoin polkadot cosmos and so on and so on also we'll do an audits and we have couple projects of our own because yeah like some of the projects are being screenshoted right here from our website and yeah that's definitely not all of them we have some more and having so much projects spread out around different ecosystem actually made us thinking that we definitely need to build a bridge so talking about it there are several types of bridges written down out here there are several bridge types obviously here listed by the centralization so we can start with centralized centralized bridges are
run by one entity usually by a company that you trust and the only thing that keeps them from stealing or your money is actually reputation but technically they have a possibility to do so and yeah to prevent from that there is like a next step a semi-decentralized bridges and also known as trusted federations that's when you have a partnership of companies or you have several entities that have may not trust each other but definitely have reputation on stake so they preserve in this bridge and there's not one point of failure at this moment and but the bridge is still secured by reputation technically if they all come together and decide
that they would all want your funds get out they have a technical possibility to do it and the very last step is absolutely trustless bridge it's secured by either math cryptography or incentives this is when pretty much anyone can run a bridge but they have for example absolutely no ability to either transfer your funds or they don't have like an incentive to to do that for example they staked a lot of funds so they're not interested in getting your funds uh out of the bridge and so why i put it exactly this way because this kind of looks like chain bridge road map at this moment and yeah let's talk a little bit more about chain bridge in this
step and where what is chain bridge and where are we now so chain bridge is an open source white label solution that natively supports token transfers between avm compatible chains and substrate out of the box and as well it allows for passing pretty much any arbitrary message from one chain to another and yeah let's take a little bit deeper dive into infrastructure it's still pretty abstract very straightforward so this is how the usual bridge architecture looks like you have two chains and you have a server in the middle well we call it a relay some people other call it different ways so relay passes information from one chain to another depending if the bridge is centralized
you must probably like there's just one entity who owns the relay or in case of trusted federation also partially case for centralized if it all the relayers are owned by one entity it's centralized if by several entities like every entity run every layer then it's trusted federation also it can be a multi-signature for example two out of three three out of five you name it three out of three if you want it and this is a basic setup for passing messages from one blockchain to another um yeah a little bit of chain specific properties for chain bridge within every layer there are modules that that are set up for connection listener and writer
connection obviously to connect to blockchain you can either run your own node or you can use something like infuria just to be connected to the blockchain then listener and writer is pretty straightforward so listener listens for events in one chain and writer writes them on the other so then we have a set of bridge smart contracts on the blockchain and those smart contracts are setting up the on-chain interaction infrastructure so you have one bridge contract for example if you're transferring talk and you interact with bridge contracts but itself he doesn't know like what kind of contract do you have so you need an additional infrastructure for contract to know what kind of messages to pass around so there is some amount of handlers that
goes with it and for example if it's on ethereum you have smart contracts if it's on substrate there is a pallet obviously for blockchain site there's always an admin a person who deploys contracts at first and owns them and first this is the person who sets up for example all the realer because to write a mess to write into the blockchain you would need an access to the to the blog to the bridge contract just for for example unlocking the funds or transferring the funds or transferring message whatever and as well like relayers usually operates on fees in case of centrally centralized bridges there is a possibility like you may be
paying fees for your users in case of decentralized or close to decentralized bridges there is always some incentives for layers to run so admin is the person who sets that fees for relays as well within the blockchain contract because they're withdrawn on chain all right um what else yeah admin also adds in case you're in a decentralized application and you want to add yourself into a bridge admin is the person who also does it and so it's one address usually who admins everything but it is also possible to set up a dao or a multi-signature or pretty much any governance protocol on top of it as long as it controls a bridge right and so with this properties you
can connect to blockchain so each layer we have will have modules for one blockchain and for another blockchain right now it is possible within the chain bridge to connect to pretty much any blockchain existing so for example if you take like ibc it has to be embedded into the protocol but with the chain bridge you just like implement these modules and you're good to go um yeah there may be some uh slight problems with like depending on the block time on finality of the blockchain there may be some back and forth with implementation but generally we support pretty much all the chains all right so one more thing i wanted to mention on this slide specifically within the blockchains it is possible to
run ultimately like as many bridge contracts as possible so right now for example in mainnet we have three live production instances for like avalanche for centrifuge that is from centrifuge chain to ethereum magnet and so these all bridges are run like a use case specific each of them run their own infrastructure but technically if you want your decentralized application uh run by someone else you can just deploy it and run it by an existing relayer this is possible all right as well if you're not a decentralized application but you're actually owning your own chain and you want to add it in relays like within chain bridge it is possible to go from one chain to second to the
third one for example i don't know you minted tokens on like a white blockchain and then you transfer it to the yellow blockchain and then to the black so when you get back tokens from black blockchain to the white one you will actually have the very same tokens you locked up at the first place so yeah this is possible within the current current chain bridge and you can add as many blockchains as possible and you can circle tokens around them pretty freely and yeah like you can add all the power chains i don't know uh you can deploy a lot of bridges on ethereum and so on and along with that for example if you were to add an additional set of three layers that for example you have a couple blockchains you have couple bridges deployed on that
blockchain and you have different layer sets you can actually have sort of decentralization because you have an option of using different layer set it very much depends on your partnerships and so on but with the current architecture it's kind of possible to reach some level of trustlessness just by the option of having choice of different layer sets all right so the technical summary around here or what can you do with the current chain bridge so right now the most common configuration is a very use case specific bridge and usually it goes something like a trusted setup or a trusted federation where you have an admin set up as a multi-signature
and here's like a functions that you can do as an admin and yeah usually it's it's a multi-seg instead of admin but you can as well have a dial then yeah you can bridge pretty much everything out of the box we have erc20 tokens and nfts however you can you know bridge for example white white listed tokens or tokens with blacklist you can vote on proposals or like pass hashes from one chain to another should you want it and yeah in case uh you have adapt and you have very specific sophisticated contract you most probably will need to implement a generic handler and then include it into the bridge so just the bridge understands uh what you do within your contract i don't know maybe you're a dow that
mints unicorns with rainbows so for bridge to know that we would need some sort of implementation for the handler alrighty so what's in right now we have evm support if your chain is evm compatible most probably we can run it right away you just can you can just deploy it and have it if you're a power chain you're also good to go because we have a substrate palette that allows for pretty much the very same functionality and work in progress integrations right now so layer 2 to layer 2 bridging we're taking a look at optimism and working on optimism to matic right now and yeah other thing that is work in progress is cielo tuclea bridging specifically that because it also comes
with proof that of transaction inclusion and yeah it's pretty hard to do exactly the same thing on ethereum without spending like a lot of gas so it's possible to run it on ethereum but not without the inclusion verification all right that's pretty much it from my technical perspective there is like just a couple of frequently asked questions that i get so can we build or deploy an integration for example some chain it very much depends depends on the blockchain and then our availability so in case it's evm compatible or a safari chain it's very good to go we can help out you can reach out to us otherwise we just need to analyze a lot of things like how do you validate blocks and stuff like that
and then we can answer that question and next is if we can run every layer we do not uh maybe for now i'm pretty sure like for now we don't maybe we will in future so stay tuned and yeah in case you have any other questions check out our documents there's also see the repository documents are pretty good you can also try testbridge it's run by moonbeam they are having evm power chain and they have a very nice rx so if you want to actually click through the interface you can like mint yourself tokens and pass them from i think kovan to the moonbeam try this out all right and yeah then if you have any more
questions technical non-technical whatever feel free to reach us at discord and yeah there is always someone who can answer like any complexity or debugging stuff should you want it if you want to reach out specifically to me you can tweet at palikarpic that's myself and yeah or just find me around the venue and speak to me directly and yes one more thing probably the most complicated thing in chain bridge right now we always need a very good talent so if you're a good developer you know rest or go link or type script not for bridge projects but still uh please see careers the chain safe and yeah stay tuned for other things thank you and if you have any questions
feel free [Applause] all right all right guys done thanks everyone thank you for waking up so early after the rave [Music] awesome do i need to turn it off you