Episode 241: Deconstructing Bridges with Vaibhav Chellani
19 Aug 2022 · 1:07:42
Zero Knowledge host Anna Rose talks with Vaibhav Chellani, co-founder of cross-chain bridge Socket, about how bridges actually work. They break down the core components that make up a bridge, the different bridge architectures in use, and a framework for analyzing the security trade-offs between them at a time when new bridges, and new exploits, keep appearing.
Speakers
Topics
Transcript
[Music] welcome to xero knowledge i'm your host anna rose in this podcast we will be exploring the latest in zero knowledge research and the decentralized web as well as new paradigms that promise to change the way we interact and transact online this week i chat with vaipov chilani a bridge builder and the co-founder of socket we explore what makes up the components of a bridge the types of bridges and then look at a framework that they've developed to analyze the trade-offs around security and bridges this episode comes at a really good time
since at the moment there are more and more bridges emerging to connect all these different chains together and since they're so new there are also a number of bugs hacks and exploits happening at the same time hopefully this gives you some insight into what's going on with bridges before we start in though i want to highlight a new video series we've launched this summer it's called the zk whiteboard sessions it's produced by ck hack as well as the zk crew from polygon in it hosts bobbin and brendan interview the top experts in the zk space and explore the most important concepts and building blocks in xero knowledge so whereas this podcast is very conversational and quite broad in terms of topics the zk whiteboard sessions is educational and very much focused in on
zero knowledge it's also on video so it allows you to explore the math in a much deeper way if you want to learn more about zero knowledge tech this would be a great place to start we already have a number of videos published so be sure to check it out i'll add the link in the show notes one more thing the zk summit returns for its eighth edition this time we're going back to berlin and it's happening on september 15th be sure to apply to attend and now tanya will share a little bit about this week's sponsor today's episode is sponsored by manta network menta is a privacy hub for web3 by leveraging zero knowledge proofs menta brings on-chain privacy to any crypto asset mantapay which is their first app allows users to privately swap crypto assets
cross chain manta is also hiring they're looking for skill developers and engineers passionate about cryptography and passionate about bringing privacy protection services to all of web3 manta is remote first backed by teams like polychain binance and other industry leaders check out careers.manta.network to apply so thanks again manta now here's anna's episode with vaipov chilani [Music] today i'm here with vaipov chilani a bridge builder and the co-founder of socket welcome to the show of apov thank you so much anna it's always been a dream to come here yeah i've been a follower of the podcast for the last two years really excited to speak with you today for sure cool
well i welcome then as a guest this time around you're on the other side so today i think what i really want to chat about is bridges i was introduced to you by kobe uh our sometimes co-host here and he had told me like i was you know i've been doing sort of an informal interview series with various bridge projects and i've been doing this over the last year or last six months at least and yeah he introduced me to you because he said that it might be cool to get sort of a meta perspective on the bridge landscape and that you would be someone who could help i feel like it's super super relevant right now obviously we're kind of speaking in the midst of a number of like high profile
high value bridge hacks happening or i guess you can call them hacks or vulnerabilities or bug exploits or something but yeah there's just a lot of interest and money flowing into bridge protocols but also a lot of these kind of i don't know like earth-shattering yeah vulnerability or like these hacks that scare people away from it and there's kind of this push and pull around the concept of bridges but yeah i think to start off why don't we find out a little bit about you like what is your road to bridges what led you to this that's a fairly interesting story yeah let me kind of start off from the very beginning i was still in college when i joined as one of the first hires at polygon which was back in the day called matic yeah i was doing a bunch of plasma research starting group
was recently formed plasma was the way ethereum would scale going forward like vitalik was you know very behind it like the whole group it was super fun we were having like youtube sessions community calls whatever you may want to call it um that was super fun you know we did like plasma prime we did plasma debate we did like about 360 flavors of plasma but unfortunately like none of that worked out so i was pretty bummed because of this but internally like polygon decided to build a pos system which i also heavily contributed to and it was a fairly new tech at that point because tezos was the only kind of pure system in production and tournament cosmos these were still you know kind of trying
to build the systems so this was fairly interesting but i still wanted to build this scaling system that inherits the properties of ethereum like plasma wanted to and clearly like the poi system was not that so one fine evening i noticed uh anonymous guy post a proposal on eat research barry whitehead that hey guys you know we should probably try to scale ethereum via zkp's and i was like okay let's check this one out maybe it's just like another version of plasma but as it did turn out towards the end i was fully convinced okay this might as well work it's a very new tech but it looks really really promising that was the origin of the zk roll up concept right that was
what he had sort of proposed did he call it a zk roll up off the bat or was it just sort of like let's scale with zk yeah i think it was more of like you mentioned like you know scaling the theorem to 500 tx's okay something like that that was the exact title i got pretty excited i texted him on twitter as as generous he is he kind of agreed to kind of form like a working group to start working on an implementation uh little did you know this was like one of the first implementations of zika roll-ups in its entirety uh and for me like i did not understand anything about ckps right so barry you know pretty much hand hold it kind of black box did really nicely introduced
me to things like sircom circuit days which were these like domain specific languages for writing zkb circuits so i got really deep into that back in 2019 and i built a roll up i presented that system during devcon osaka i gave a tutorial around like how to build a zkp and uh yeah that was how i got extremely excited about roll ups but roll ups is i mean and this is a question i have for later is like what is a roll up what is a bridge here but now i mean would you say was there a transformation from roll-ups to more bridge and like kind of multi what is it cross-chain bridging oh yeah like what happened was like after i you know kind
of built a zk roll up um i wanted to kind of do that full time right so i joined the theater foundation officially joined barry's team and we built out hubble hubble is this like fastest optimistic roll-up and during that one year of like building this out hubble is now being used by the team at the world coin which is this orb thing eyeballs yeah yeah all the good stuff yeah but that was like a super fun project but a unique insight that i had during that project was okay you know while roll-ups are good the actual problem is like state charting what that means is like if you took all the transactions on ethereum and started doing those on a
roll-up we would not have any ceiling at all so this meant we would need multiple roll-ups to kind of scale ethereum and that meant we need a system that allows inter-roll-up communication i just wanted to accelerate this journey towards asynchronous communication happening between different roll-ups because i see the future as like multiple roll-ups you know paired to ethereum paid to celestia paid to other ecosystems maybe i can ask the question now is a roll-up a bridge does a roll-up have a bridge what is it just a bridge what is it yeah it's a it's a fairly interesting question to be honest like i don't know yet on how to actually term
it we recently kind of created a framework to evaluate bridges uh in collaboration with l2beat and if you go on that proposal this is like the topic that you're debating about unlike you know is roll up a bridge if yes what kind of a bridge like everyone agrees it's a bridge but it's a pretty different kind of a bridge where it's so closely tied to ethereum that social consensus of l1 also affects l2 right so it's a very unique kind of and very closely attached to ethereum kind of focus i would say got it so what's what leads you to the work you do today actually what is the work you do today yeah so socket is essentially an interrupt protocol
which tries to allow developers to kind of send data and assets across streams so part of our protocol is out there on mainnet today the asset bridging part it allows people to send assets from one chain to the next the way we do that is we aggregate all third party bridges but we only do like native assets right so like native assets on one chain for native assets on another team so yeah uh excited to kind of get in into that also later during the podcast cool yeah so let's kind of go into bridges as mentioned i've had a number of teams on who've talked about their particular bridge constructions but i kind of want to explore this framework you just
mentioned but let's start sort of the highest level you sort of mentioned the roll-up could be a form of bridge but why don't we just say even above that what is a bridge yeah what is a bridge i think the definition has changed quite a bit uh over the last year specifically for this event i would kind of term a bridge as something that sends assets across scenes okay i would also introduce another interop system called messaging protocols and i would place things like there are two chains always connected by a messaging protocol and a bridge is an application on top of this messaging protocol so a token bridge is a bridge that allows you to send tokens across chains
an nfc bridge would be an application on top of this messaging protocol that allows you to send nfps across chains we can imagine a governance bridge that allows you to work from different chains so i would kind of turn bridges as applications built on top of top of a messaging protocol generally would you say that i mean we can talk maybe about some of the different techniques that people are looking at when it comes to bridges do they live primarily on one chain are they a collection of smart contracts on or on two chains potentially or are they their own entity usually it's like a collection of smart contracts on two chains orchestrated by an off-chain actor that
kind of becomes the man in the middle uh how much do you trust this man in the middle how much of the trust in the system relies with the man man in the middle that essentially describes security and i guess going back to that question about what is a role is a roll up a bridge in that case it usually only has connection to one chain right it's not necessarily between two different chains but rather one and then the question is the little link between the roll up and the main chain is that a bridge and that would also just be some contracts right oh yeah like if i talk about like on an implementation level almost all the roll-ups operate on our bases of like you know
let's have a get uh node running and have this component bridge like r bridge optimism as the optimism messenger that connects the gets node the sequencer would be running to an l1 smart contract so it's essentially also like you know two chains connected by an extremely secure bridge uh patrick calls rollups as validating bridges i think that's a that's a pretty nice term yeah interesting is it possible basically basically to construct a rollup where it doesn't have its own chain it's literally just within the smart contract itself that some logic is in there it's almost like a dap is that possible yeah that's why i like these roll-up systems these roll-up systems are essentially
just smart contracts smart contracts with a guy who's like you know hey just give me your transactions i'll batch it and send it to l1 that's that's all the roll-ups operator or the sequencer does right but then you know to kind of elevate some liveliness concerns and things like that people add some consensus mechanism to make sure if like the sequencer goes down the transaction still keep processing and that's how this like very simple model becomes like a chain that's connected to an l1 right but at the very core it's a develop it's just a smart contract on l1 that's it cool i know that there was this comment by vitalik i think of four or five months ago there's a blog
post where he argued for a multi-chain future but not a cross-chain future so in this case he's using the term multi-chain i think to refer to more like a roll-up centric model with one data availability solution at the center ethereum i don't know if you mentioned celestia but like it could also be something like that or like polygons avail solution but so that's a multi-chain in that definition and he's kind of arguing against a cross chain and i'm curious a little bit like what you guys think about it i know you also had a rebuttal blog post so you might have some ideas yeah it was not exactly like a rebuttal it was more like
i think yeah some nuances get missed and like the comment that vitalik posted was very interesting given like no one had actually talked about that in that tone or like with that perspective before uh and we are starting to see some similar discussions happen with each two uh over the crypt with twitter or the last couple of days where people have mentioned concerns that there will be like a eth1 proof of work chain still running some miners would still run it and what happens then you know what happens to people providing liquidity on uni swap things like that but yeah it's getting like fairly uh hairy so let me kind of address the comment directly
first and then we can get into like how it's similar to the current situation so yeah like the comment was generally okay you know you cannot really move assets from one chain to the next because blockchains have this unique property of social consensus that make sure the blockchain is secure right uh what that means is like even a 51 percent of the participants in the network somehow call you your funds are still safe because you can perform a hard fork you can socially agree that some form of like collusion happened and you can start a folk before the attack or the wrongdoings you know started to happen and that's what
essentially makes a blockchain secure but once you start bridging out of it you know things start becoming hairy right because what if the bridge accepts a deposit from a fork that's non-existent after a while because the chain socially heartbroke to something else yeah we've talked about this a little bit on the show there's this also this idea of like a fragmentation of liquidity and i just picture trying to track that back across multiple you just don't know what actions have happened with that and so this idea that you could hard fork that maybe it's possible it just seems more and more complicated if you're also dealing with these like sort of third-party bridging protocols in the
middle yeah or if maybe even if like the origin contract gets messed up on the main chain like how quickly does that proliferate through it and what effects does it have it just becomes very crazy but at the same time i mean i think the argument is like he prefers a multi-chain to cross chain but like it's not reality that we live in today whatever four or five months after this blog post comes out maybe even then there's so much cross kind of chain liquidity happening i mean the attack that that you mentioned is also like an extreme case a chain getting 51 percent attacked that has not happened very frequently in the history of blockchains so it's it's a fairly extreme state and uh
i think we are already kind of using a lot of bridges i see circle as a bridge between a bank in u.s and on ethereum on solana on polygon and things like that why do you see that as a bridge that's actually i'm curious like it's not the bridge between the bank and these chains is it is it because it's the same underlying asset and they live on different chains so they could be interchangeable somehow or what do you mean let me kind of start off with let's say biomats right so how balanced and coinbase work is you transfer money to binance on an address that they give you let's say on ethereum and finance kind of waits for let's say 12 confirmations and then starts showing
that asset as received on balance and it allows you to trade right uh now what happens if this deposit this was lost in a new social hard fork created by achieving finance just allowed a user to place a trade on an asset and book a profit when they did not receive money from him on ethereum right now if you just replace banan's with solana or polygon that essentially becomes the bridging infrastructure that we have right now and that's exactly like the attack vector with alex trying to point at in the usdc example right uh firstly it's like a it's definitely not very close to like the bridging infrastructures that we have right now given it's like trying to it's it's more of an oracle because it's trying to like
kind of map a physical entity to a digital one but in some sense it's accepting deposits or withdrawals from ethereum back to the bank as well right so it also has to wait for finality on ethereum and it's also it also has the same attack vector that i like mentioned about bridges right what if a user kind of comes to circle says hey i want to withdraw my usdc and circle accepts that after 12 confirmations right and then the deposit is lost in a new social hard fork right okay it's it's kind of the same attack vector i would say you sort of just mentioned that it was like an oracle i've actually heard that
i think in the interview we did with nomad they also mentioned that bridges are like oracles can you explain how that is yeah so it is quite interesting bridges are essentially like oracles kind of trying to define oracles here oracles are things that let a blockchain know that something happened in the physical world that's the definition that we have for oracle right now you know let's say there's a weather oracle it will tell an on-chain smart contract that hey you know whether in california today is this much right that's so that's an oracle now maybe the most common example that we see are our price oracles so it's
often like determining a price pairing like what what do they compare this this token to this token at this time exactly so this oracle is trying to you know let's say relay some information from binance to ethereum mainnet here right uh as i did before let's just replace binance with something like solana or polygon it essentially now becomes a bridge right because uh this oracle can also go to ethereum and can tell that they just received a deposit from a user on polygon so oracle can become a bridge but i like to kind of highlight a nuance here
i think oracles that kind of feed real-world data to ethereum in it are very hard to trust trust and there are essentially no way uh to kind of do it without trust and that's why chain link is pretty popular in that kind of scenario uh because it's like really hard to map like physical entities and digital entities together because it's just like such a different realm but i feel we could do a lot better in the digital ecosystem because when we are connecting two different blockchains these are two digital entities that we are trying to connect and there are ways to kind of prove to one entity that something
happened on another entity and we have to strive to not trust an oracle here uh that would be like the worst case scenario if you're not able to figure out the spinning situation of course you can you know kind of uh start trusting chain link again but the fact that both of these chains operate on chain they are digital in nature and they have a way some kind of crypto economic security or other methods i think we should be able to do better than like providing oracle level security in uh bridging so we're speaking on this topic seems kind of related another point that was brought up i think on the nomad episode was this idea of almost like the call answer problem where it's like
unlike a web call you're sort of expecting something to bounce back when it comes to blockchains like they don't talk to each other that way and the bridge in a way is trying to get like state of both so that it can act as this conversation piece between the two blockchains kind of going back to what you just said about the oracle like in the case of them thinking of them like an oracle are they also acting a little bit like that communication layer in between yeah i mean oracle is trying to like map a physical and digital entity it might as well replace that physical entity with the with the digital entity and that would be like the worst kind of bridge that we can have
and i basically define as like oracle's being the lowest security possible and everything else yeah it can only only become better and we can use like you know some sort of proof some sort of crypto economic guarantees some ckps hopefully to kind of make this system trustless or trust minimize and not as stressful as oracles and yeah then you can do all sort of messaging all sort of communication between two different genes can you actually go a little deeper on that problem though this call answer thing like what happens when some something happens on one chain like basically how do you get message and reaction how does that even work
i'm not 100 sure about what the context was when uh maybe james told this but i'll try my best okay yeah sorry reference maybe you haven't heard it all good uh basically maybe the problem that he's trying to refer to is that you know a normal systems like web 2 is built in a pretty async fashion right everything is async in web 2. like making an api call is how you do composability between systems in web 2. in web 3 it's been synchronous communication so far right no one really synchronous it always has to happen at the same time okay exactly in the same transaction that's been the programming paradigm so
far right but over the last two years we just realized that to scale a public blockchain we have to break it down and there will be some asynchronous system we have to sacrifice some synchronicity to get scaling and no one really knows like what's the best way to do async communication in a blockchain context and bridges are an attempt to figuring that out and yeah socket is an attempt to kind of uh actively push towards that you know let's figure this problem out because that's the only way we can scale the theory on another chains that's interesting that idea of this right now everything being synchronous do you feel like the bridge solutions that exist today are actually
making it asynchronous or is it more just like we're making tiny baby steps towards having a more more asynchronous system kind of like going down the same analogy of like you know web 2 operating you know fully asynchronous if i were to kind of like one is to unmap it to the current bridging infrastructure the api call in the web 2 world takes 60 seconds at most at 60 seconds the communication stops no matter what right yeah either it works or it just gets cancelled exactly and it's fairly cheap depending on like what kind of data you're trying to request it's fairly cheap but if i were to like one is to one map this like web 2 system that we have right now to web 3 it would
mean one api call [Music] costs like 100 200 at the minimum and the latency that you can expect is like 60 minutes or even a lot more like seven days in case of roll-ups right so we are definitely like taking baby steps towards it kind of hard to provide any sort of like guarantees in terms of like latency because you know no one really knows if a bridge kind of promises that hey man i like i'll bridge your transaction like five minutes so no one knows what the gas price is going to be right so it's like extremely hard to provide these guarantees and the api calls are extremely expensive extremely slow so the amount of
asynchronous communication that's happening right now is super small it's mostly tokens where you send the token from one chain and you receive it like whatever you know like 30 minutes later but we will you know kind of get there slowly i guess well thank you for answering all these sort of like random questions these are leftover bridge questions that i feel like i've accumulated over the the last few months of doing these interviews but let's talk more about this framework i think that's what we wanted to really cover in this show which is like the way of thinking about different bridges maybe it touches on some of the things we've already mentioned i know that there's other concepts like like clients and yeah even the sort of optimistic style that nomad has or the
cryptographic style that axler has so yeah i'm just curious like let's let's go into it let's start to dig into this framework okay oh just to kind of like have some context about like why we started looking into this stuff uh sockets liquidity layer is essentially built like a aggregator of like third-party asset bridges and uh we were like okay you know there are like all of these bidding solutions out there that are always trustless of course uh they're marketed you know pretty heavily to like normal people and this tech is generally hard to understand so people use it and then they get wrecked right so us
as a aggregator yeah probably bad timing but we just felt it was important for us to provide some transparency on the security properties of uh the bridges that we are trying to integrate right so we have this list of like 150 different bridges and we were trying to find ways to provide some information about how secure a particular bridge is without it being too researchy for a normal person to understand wow so 150 bridges is this is this sort of like bridge instances or bridge projects because i'm just thinking like would you count one
of these bridges as like if you have solana to eat and then another bridge would be like even if it's from the same company like eth to i don't know something else algorithm now these are the actual projects like these are actual bridging projects that are on mainnet they have like small amount of liquidity uh yeah things like that okay so this is not each individual connection these are projects yep and and would you say that like in those that 150 do you see very very clear classifications of how of these approaches yeah um not very clear classification uh that's essentially why we had to kind of like do it in like a more
community oriented way uh we could not find a common framework that's very clear a lot of bridges kind of lie in in two buckets a lot of bridges like do one thing differently that could change the whole dynamics of the system wow and the security i guess exactly exactly wow okay so we wanted to kind of do this more holistically kind of chat with a bunch of teams on like how to exactly categorize these systems because these are like so different and for us we just wanted to try and create a kind of score that we could assign it would definitely not be super accurate but that's what like we felt that people actually wanted
they don't want to kind of dive into details about like how this bridge works things like that uh to understand when they're trying to bridge assets we just want to tell them okay you know this bridge is like three out of five uh this bridge is 3.5 out of five just so that they have this upfront and it's not hidden behind like layers of marketing how did you do that score though yourself like were you did you score certain kinds of bridges higher like say a like client bridge would you just like if there's a light client on either side that's more secure in your boat definitely okay definitely definitely uh like the light clan bridges are definitely like the most secure ones
after roll-ups uh because roll-ups are like light lines with social consensus uh light lines have the same like problem that we talked about vitalik mentioning earlier so light lines with social consensus that's roll-ups like lines with validity proofs that's something like what mina is trying to do and then there are like normal light lines but yeah i can yeah this is probably like a good time to like get into all of this like classification details sure yeah let's do it okay sweet so like starting from the very beginning uh we talked about this a little bit earlier but i'm talking about bridges as like as a application on top of a messaging
protocol so if the messaging protocol has a security property all applications on top of it inherit that security property directly just to give an example let's talk about ethereum and optimism optimism has an optimism messaging bridge of such and any token bits that's built on top inherits the same roll up security right what that means is you know going from ethereum to optimism would be super fast going from up from optimism back to aetherium would be super slow like seven days or things like that just one thing when you talk about like the token you're using this term for like what's built on top what did you say again the token bridging i call it uh token bridge
the token bridge so the token bridge itself like i think of optimism as sort of a bridging pro like it would provide you with the application to actually do the bridging but are you saying that like any zap developer could basically make their own at their own interface and it would be kind of living on both sides but using this bridge and that would always have the same properties of the underlying message passing protocol i think is that how you say it yeah i gotta get this language right i mean no one no one really kind of has defined these terms so we are free to use whatever you want okay yeah so like optimism essentially has provided a way to securely send data from ethereum to optimism and vice versa
now this data can be anything it can be a data about like bridging of a token bridging of an nft and applications uh like people can come and kind of build bridge applications on top of this messaging protocol that they have built so optimism token bridge is just one example that optimism team has built so synthetics for example uses the same messaging system but they have a different kind of like bridging mechanism that's not the same as optimism token bridge okay so yeah people can come and experiment as they like uh build like different sort of like logic on top
uh things like you know i'm on l2 i want to vote on a proposal that's on l1 yes you can do that via optimism messaging bridge right you just have to build an application on top yeah so the hierarchy is a messaging bridge i just call it a messaging protocol just to not use like bridges very frequently so messaging protocol bridge applications on top and then comes this new term called liquidity networks on top of token bridges right so token bridge is something that allows you to send tokens from one chain to the next liquidity networks are systems that allow you to
swap these tokens from one chain to the next so when you use a liquidity network you basically swap out a already minted asset and not kind of meant a new one right this difference is like pretty simple uh pretty subtle pretty confusing at times so happy to kind of dive a little bit deeper i want to go over those steps again because i started writing them down as you were saying them but it's messaging bridge message protocol token bridge uh i would just call it a messaging protocol a token bridge on top then a liquidity network you can kind of remove the bottom list the bottom layer
okay um and then but the liquidity network is that sort of like a dex is that like when you're trading like instead of it being that you're going like if you wanted to trade a dot for eth could you just in this other sphere just like do it automatically kind of immediately without having to transfer your like transfer and wrap your assets to each one is that sort of what you mean when you say liquidity network yeah that is kind of close so essentially let's say usdc on ethereum is not the same as ustc on solana okay right so these are different assets so you can kind of imagine liquidity
networks as being across index such that they allow you to swap usdc on solana for usdc on ethereum because these are different assets okay all together but it doesn't allow you to swap it's not allowing you to do full cross network trades or could it no it's not allowing you to like no token actually crosses ethereum yeah and sarana boundaries it's just that you exchange ownerships with the counterparty okay so the so the guy who is holding usdc solana you take the ustc surana from him in exchange for taking the ethereum solana you know from the other guy so
it's like kind of changing ownership on both sides but no actual asset movement happened between the boundaries but do you have to do they have to be the same asset synthetically on each side the example you gave was usdc on two chains but does it yeah could it be two different tokens on two different chains yeah it definitely could be yeah well usdc here it's technically the same as it but it's on salon and ethereum so it's yeah it's different assets i just i guess i'm just like i'm thinking almost like from a trader's perspective where like maybe just a simple trader's perspective where you'd really just wanna you have it sitting somewhere you want sort of maybe the native token on the other chain and i'm wondering if if this liquidity network would be something
that could happen what about stuff like like loans and like could you also use a liquidity network to do more sophisticated defy stuff like potentially locking tokens on one side to provide like as collateral and then providing liquidity on another i mean there are some like tricky ways to do it but at that point you might want to use the token bridge or the messaging protocol to do it right because you could just build this whole thing as a application on top of the messaging protocol you know uh yeah that would make it a lot more simpler because these liquidity networks are a lot of time kind of restricted by the amount of liquidity uh so you you likely will not want to be
restrained by that can we go a little deeper into liquidity network then because i don't know if i fully see the distinction there first uh let me maybe like start off with some examples right so an example of a liquid network in production right now is are things like hop and connects right so hop and connects they allow you to get into an engagement with the counterparty or with the market maker who swaps the token with you uh for a fees right uh and that's the reason why these things can be like super fast super cheap things like that right to kind of elaborate on the difference between a token bridge and a liquidity network
maybe let me kind of walk through the journey in both cases so let's say you want to move some money from polygon to ethereum right or you know let's do ethereum to polygon let's say you want to move 100 usdc from ethereum to polygon uh you go to the token bridge the token bridge escrows the money on a smart contract on ethereum and the polygon native bridge mints a wrapped version of usdc on polygon and now applications use this wrapped version of ustc as normal usdc and it's you know it's like the native ustc until like circle starts minting there
okay and before until it goes direct until circle goes direct okay okay yeah yeah so assuming circle is not mending directly on polygon this is essentially polygon ustc right okay uh so now a user when he's trying to kind of you know bridge from ethereum to polygon he has this one way of doing it which is going by the polygon native bridge that would melt new ustc and escrow his ustc on ethereum yeah the other way that we're talking about which is the liquidity networks uh what happens there is qr on ethereum you look for guys who are willing to give you a hundred or let's say 99 usdc on polygon uh once you find this guy you lock your
money inside a smart contract on ethereum this market maker or this counterparty he gives you money on polygon so you receive 99 usdc on polygon and then this guy can go back on ethereum and take your 100 ustc there i see so it's you don't mint it you just use existing on one side that actually speaks to a very old episode we did about like the lock unlock mint burn kind of concept so what you described with the token bridge there is that you would basically lock on one side and then mint on the other and then i guess to move backwards you have to burn it and then you'd unlock it on the main on that original space here what you're
talking about is like lock unlock on one side and lock unlock on the other right or just like trade to you yes like you get it yeah it's more more like a swap you know okay so it's like a token swap uh there is no token transfer there's just like swapping of tokens that's happening across just to kind of highlight a very interesting difference here is that usually these liquidity networks can be pretty fast because you are essentially kind of engaging with the market maker right so let's say i'm trying to move from ethereum to polygon and you are kind of offering me a rate uh let's say you know uh 98 usdc right so you might be willing to take on some kind of rollback risk
in exchange for more fees right what that means is you would allow me to get from ethereum to polygon in let's say two minutes instead of polygon native bridge doing it in 15-20 minutes yeah because you can offer more competitive raised rates because you can take on additional risk for a fees right okay so usually people use these liquidity networks for like faster transfers and uh you know kind of bypass the native bridge uh and if you notice clearly this concept started coming up like a lot of these kind of bridging designs started to come up when albertum and optimism went live because using the native bridge there
for going from optimism back to ethereum is not really an option because it took takes seven days or so yeah yeah so we needed like a swap protocol that would give give it to you instantly got it behind the scenes though are they manually using those bridges as well like are they moving those tokens over sort of and then in the meantime lending stuff out to you or like giving you things is that sort of how it works yeah definitely so these guys would be maintaining like liquidity rules on both chains and they would be like kind of swapping between these liquidy pools but you have to imagine at some point one of their pools will not have liquidity anymore so at that point they would rebalance and they would rebalance via whatever messaging bridge or token
bridge that's connecting these two chains so at some point they would be using it but would it would be in a more batched fashion right and only when they've run out of liquidity got it so you've just kind of given that description of how these bridges are built and these different components of like a bridge or a i don't even know how to describe it because it's like multiple bridges protocols whatever basically like how these cross-chain entities are starting to develop and the stack that they have but i will kind of want to go back to the framework and the security and actually i want to i want to step back because you had started to tell us the the most secure and you were kind of
going down and i'm curious what happens after where did you stop you stopped it like like client but not validity proof and then i don't know what happens after in terms of security yeah definitely let's get into that stuff um yeah so maybe we can we can go in some sort of order right or drop security right yeah so we have kind of nailed down the structure a messaging protocol on top of that a token bridge on top of that or liquidity network right uh and now we'll start going into some uh like how are these bridges designed and how that affects security and we'll do that in a decreasing order we start
with the most effective way to move assets or data across chains and that would be what roll-ups do right so in the framework itself we call it like like client verifying validity of the state okay right these are like the most secure way to do crosstown building uh we essentially kind of describe it as like bridges that verify the validity of a state transition that happened on the source chain but we validate or verify it on the destination chain so the destination chain will take all of those transactions it will validate it somehow that these were correct and only then kind of accept it so let
me kind of describe how roll ups are an example of this right so when we are talking about you know zq roll ups or optimistic roll ups uh let's assume these are two different chains connected by a bridge right so a zika roll up essentially proves to ethereum that hey man i just processed some transactions on my side and here's the zkp that attests or like that proves that all of these transactions were done correctly and in the optimistic scenario it's like hey hey ethereum these are the transactions i processed prove me wrong yeah yeah it's like a very lazy way of doing it but essentially ethereum is the source of truth ethereum verifies
kind of verifies all transactions and the validity of those transactions so this is one kind right uh be more secure kind we can get into other trade-offs but talking about only security yeah this is the best that you can get okay so now we go a little bit less right so the second thing that we introduced was like lines validating consensus so these are systems that allow acid and data movements but they only validate consensus okay right so let's say you were trying to bridge between ethereum and solana this is all theoretical i don't think it's actually possible but uh you would be verifying consensus of
solana on ethereum and vice versa okay you wouldn't be checking all transactions you wouldn't be like you know kind of seeing if the transactions were executed correctly you would just be like okay if two by third of the validators say it's secured then it's secure right you don't have to get into the nitty-gritties just to elaborate the difference between both of these things the earlier one like line to validating transactions that's more like a full node in ethereum's context uh a lifeline validating consensus it's more of a like client in ethereum's context like a light node that people can run in their browsers right and we obviously know like you know kind of running a full node is definitely
more secure than running a light client right so it's kind of like boring some like similar properties there a bunch of examples here for the first one it was like roll ups for the second one it's like the polygon pos bridge uh cosmos ibc is a great great example you know like ibc it's all likely based uh you have two chains they would validate consensus of each other as long as they both are honest things are extremely good it's interesting to me that you put roll up as more secure than ibc i guess i never really thought of that comparison you also mentioned sort of like the mina the meena setting but that is that one layer down from ibc where it's like it proves itself kind of
but it doesn't necessarily it just submits a proof it's not that that has to live somewhere else just the proof is enough yeah you touch upon a very interesting point this is like the exact point that we are fighting on right now or the l2 beat forum okay so the meena bridge is interesting because it's also validating transactions but it's not it's not as secure as rollups so i would put it somewhere in between i would put it somewhere between cosmos ibc and rollups okay so it's even higher in terms of security than ibc definitely okay definitely because in cosmos ibc if one of these chains lie oh yeah that divided divided
bf consensus you know let's say you know two by third variator collude then the destination chain would gladly accept it okay but here the meena chain is posting a ckp so if the ckp is valid the state transitions are valid and the destination chain would accept it and they have no problem with like consensus failures or things like that the problem the meena chain has that roll ups don't is social consensus what does that mean let's say you try to bridge out of meena to ethereum [Music] and you created a valid ckp for it ethereum gladly accepted it but mean are hard forked oh ah yes okay okay
okay okay this is that okay yeah uh meena heart folk to something else and it's gone now it's like fully wrecked okay uh rollups don't have this problem because there is one source of truth that's a theorem l1 got it but in mena and ethereum both are at the same level i would put it like that and the idea is if if ethereum hard forked which is hard to do and unlikely but like say that happens then it would carry with it all of its roll-up stuff anyway exactly so it would kind of follow it okay cool so i got that so then in the case going back to ibc though and then ibc also doesn't have the social consensus part it could also have one side of it hard fork and it would kind of wreck a lot of
transactions or like you know assets being held on either etherchain okay yeah this is exactly why i think cosmos trying to build tendermint makes a lot of sense because tendermint has this really nice property of instant finality what that means is like as soon as a block is minted you can be assured that it's final that there would be no folks and this is really good for bridging because then you are not worried about like folks uh and things like that so that's why i like tenement makes a lot of sense okay going down the stack so yeah going down the strike we're not the stack it's going through the list on the spectrum okay yeah what are we where are we at so the next one
is where most of the bridges lie right now uh and that's external validator side right okay so so far we haven't seen anything adding security in the middle or like taking off security in the middle right it's been two chains trying to communicate with each other and we've been like talking about different ways to do that but with the external evaluator said we kind of say uh that we'll add another chain in between and both of us we would trust this chain for crossing transactions right so all the security moves from trusting the execution on both of these chains to trusting the execution of this middle chain
and i guess a good example here would be like gravity bridge xlr and i think wormhole but would you put nomad in there because i i spoke to them about it and they they said i mean they don't have a validator set they have watchers they have these other agents that sort of check it but they're not exactly of like a full chain in and of themselves yeah it's kind of like a nuanced stake here i mean for the framework itself we put uh optimistic validation in a separate bucket but i would personally put the current nomad system in an external validator bucket mostly because the watcher set is kind of permissioned meaning no one who does not have
permission already so it's not like an optimistic roll-up where if the sequencer says hey uh hey theory no here's the latest uh state route these are the transactions and now anyone in the world can literally come and challenge the current nomad system is not like this the current nomad system only allows a subset or white listed actors to kind of pause the system right so it's kind of moving from the external validator set where validators approve of transactions to a model where validators pause pause i see so it's a good or a different kind of trade-off in the sense that things like ronin hacks where the private key got leaked
things like that cannot happen because the worst thing that you can do is like pause the system so it's like good in that sense going further are there even less secure types definitely so now that we've kind of introduced that okay we can have a chain in the middle that's like validating or that's providing security to everything crossing uh now we can just like talk about how secure this like middle chain is right the top level security i mean what we would call trustless in terms of like cross chain would be if you don't add any security then the two chains that you're trying to connect between right that's why like roll ups are the best right so here we've introduced a full new like
trust entity yeah yeah okay and it's not like what people wanted to opt in so now the security is like as secure as this third chain is right okay and now we are talking about how many validators does this third chain has who runs these validators is it the same entity uh what's the stake distribution things like that right things that we wouldn't be worried about if this was a l1 because again social consensus okay more insecure more more insecure i think uh it just now it's about different parameters i think broadly we've like covered all different techniques now it's about different parameters parameters like
yeah who's the validator how many are these um like a full like a five-person multi-sig as your is not good that's very dangerous would you actually consider these sort of multi-sigs as bridges like where it's purely like f like it's there's none of the there's no third party there's no like client it's just like yeah signers yeah these designers then become the third party right okay yeah so they are like yeah this is like exactly how like 60 70 of bridging is done right now by multisex for sure everything we've talked about here is security but there are other trade-offs were there other metrics that you were also
looking at in your evaluation of these bridges or was it just security because there's time there's like how long does it take how easy is it to build on top of maybe like can people build on like some of these might just be really complicated to actually build anything on absolutely so when we started building sockets liquidity layer we wanted to build like a system that allows people to send us dc from one chain to the next that's the that's the goal right then we started looking at all of these different systems and we found out we could black box asset bridges or like token bridges into three properties right one is security one is latency and the third one is cost so if we have these three things we can
transparently tell the user what the bridge is right give me a bridge and these three things and i know everything about that bridge right uh so depending on like how the bridge is constructed uh all these three things vary right so if it's a rollup and it's an optimistic roll-up the latency becomes seven days yeah right if it's cost you know kind of remains yeah me i would yeah i would i would probably call it medium okay uh but hi if it's a zkp you know yeah and uh the prices change right prices change in because we also have liquidity
networks which are like hob connects stargate and these are just like market makers offering you a rate to go crossing right so it started looking a lot more like the dex problem than the actual bridging problem we started seeing asset building as more like we have 150 different options and they all vary in like three dimensions security latency and cost and we want to offer the best one to the end user in your system do users actually get to choose how secure how expensive how fast exactly they have like interesting three options uh whatever they want to prioritize if you're trying to bridge larger amounts
you would want to use the native scene even uh native bridge even if it takes a little bit longer or it costs a little bit more uh because these liquidity networks might not have enough liquidity to even you know kind of process that so we started aggregating these these are the three properties we care about we are trying to build out this like framework to kind of assess how to think about security with these systems uh cost and latency those are like fairly objective and easier to think about latency you know we just like kind of see how much time has this provider taken over the last like two months and we kind of calculate a median uh
on the cost it's like easy to see because everything is happening on chain i think this sort of leads us to like what do you think is a good strategy for people who want to build on top of bridges or use them because we happen to be interviewed i know this episode's going to come out a little later but we're talking on the week that the nomad exploit happened um and we have a lot of friends i have a lot of friends there i think you might have friends there too and obviously we're feeling for the team and uh everything they're going through but i also know some people who've lost funds so what do you kind of recommend in terms of the yeah what strata like what do we do with this landscape because i don't think only relying on rollups actually works
right there's delay there's high cost there's like other drawbacks that are going to make it so not everyone's just going to go for the most secure so what what do we do yeah i mean we try to break this problem down into two things one is assemblaging and one is data bridging again right if you're trying to do asset bridging and you've and if you only do like native assets then you are fine trusting a not so secure solution uh the reason being the most damage that this bridge can do is not give you money on the other side right so let's say if you wanted to bridge ave from ethereum to polygon for example right you can swap that away to ustc bridge the usdc and then swap back from
ustc to our way that way you don't actually have to do like a wave bridging you can use ustc and as soon as you swap your usdc to like the native away you are done with the bridging risk right uh you are essentially out of the bridging system so when it comes to asset building i would like definitely suggest you know kind of sticking to native assets uh and trying to be away from like you know creating a new wrapped version of your assets and if you do uh try to add some kind of like gauges where you have things like one percent of my token supply can be maintained in 24 hours okay so that you have like you know some kind of
like some kind of like parameters or insurance that you can kind of play around with and over time kind of increase these parameters instead of trusting them from day one so i think a lot more of this infrastructure and a lot more of these techniques have to be adopted given where the landscape is right now but yeah i would just kind of suggest okay add more of these gauges think more about what could happen when things go wrong and try to add backstops for it try to you know kind of insure your users and things like that there's not much yeah do you think that we will find one bridge technique to win them all eventually or do you think we are going
to have even more bridge techniques or do you think maybe they just sort of cluster around some like winning strategies definitely cluster around right i personally think like roll-ups are the way to kind of scale its room it's like if your application is a roll-up and it's kind of like tied to the same data availability layer you have different by definition better bridging then if this application was a chain and not a roll up if it's a roll up you can precisely communicate from your roll up system to another roll up systems trustlessly but if you're an app chain it's trustful bridging to everything else right so my personal feeling is like people will
choose systems which offer some kind of shared security uh that ethereum ethereum provides this celestial plans to provide it polka dot provides it yeah cosmos is trying to provide it with interchange security yeah so these kind of systems uh kind of create this like cluster topology where communication within the cluster is very trust minimized but communication outside the cluster is not that gross whenever it's relying more on these bridge things and the on sort of the bridge protocols hmm yeah yeah i think that's i mean that's a world that i've sort of heard described a couple ways and times by different groups and i think it does seem like a
possible future it's not what it is right now though hey like right now it really does seem like interoperability solutions bridging projects come out and they do bridge to like all the evm chains or they're they're sort of like yeah that you see multiples of these they might have some sort of they're more featured in some networks versus others but yeah do you so you think there might be a move away from that model i mean theoretically it should but given like we are still pumping like so much money into like aptos suite solana things like that i mean yeah i mean there is a lot of incentive to go to aptos right 10 years down the lane maybe this happens but there's a lot of money
that's going around that is moving in the opposite direction so i don't know for sure but my bit is uh that we'll see some sort of clustering happen so i want to sort of round this out with a little bit more of a a look into socket the project you're working on and kind of i'm curious like where are you at what choices have you made after having done this analysis like where do you live where do you plan on expanding to yeah so at this point uh sockets liquid dealer it's it's been on mainnet for a while i think we started like last december and we also had this like philosophy of not adding more trust to the system and we've like built our socket with no
upgradable contracts with no proxies with full immutability we don't want to add any trust properties while aggregating these asset pages it should be like the user is trying to use this page directly because it wouldn't make no sense if we you know kind of add a multi-sig on truck and on top and the user is kind of choosing a trusted stage because then it becomes a multi-sig wage no matter how trustless it is so yeah like sockets been live i think it's doing like fairly well we have an application of ourselves on top called bungee exchange the goal of that application is to rethink bridging ux because like building ux is
fairly shitty right now to be honest like funds leave your wallet on one scene and you pray to the god that they appear on the other chain so it's us are like attempted you know trying to do what unisop did to swapping we want to try and do the same for pitching uh so this is like on the liquidity layer front i think a bunch of people really use it our only goal there is to kind of allow the user to make an informed decision about what route is it using a bunch of projects take a certain trade-off where they want to be more cheap more fast than secure and that's absolutely fine
but what's not fine is kind of hiding that behind marketing so our goal is to kind of inform the user about the particular trade-off and the user then may as well take it you know it's it's a perfectly fine trade-off for an asset bridge which ones do you live on already though we are on nine different chains right now mostly evm okay uh but we might try it like savannah we had plans for terra but that went away i cannot hope the same for solana so we'll definitely do it at some point but do you live on top of existing message protocol message bridges are you ex are you building your own uh so we are kind of building a data solution that allows people to
send assets via the liquidity layer and then perform some action with it via our messaging layer right so let's say if you want to bridge your assets deposit into huawei right the way you would do that is like send your assets via the liquid delay where the asset would be sent via let's say hop connects or like whoever the market maker is who's providing the best or the cheapest way to kind of send that asset across right and once we have that asset on the other side the data layer kind of in informs on what to do with the asset now okay is it you know does the user want it to be deposited into rb does the user kind of you know want to vote on governance things like that but you don't live across you're not using
ibc you don't live across nomad you're not on top of xlr you're not like using any of those existing ones okay i think our goal there is you know try to provide similar to like our liquidy layer try to provide all trade-offs to people and allow them to build systems that kind of go from external value to set to roll-ups by a simple change in a configuration that's it right and then we will obviously using our risk framework show that to the user in a very transparent manner but the users or like uh projects should be okay taking a certain trade-off
and users should be informed about it that's that's the only thing that we are going for here cool cool well thanks so much for coming on the show and sharing with us this sort of framework for thinking about bridges and also giving us kind of a sense for what you're doing over at socket of course thank you so much for having me this is definitely a fun conversation totally and i want to say a big thank you to the zk podcast production team tanya henrik and rachel and to our listeners thanks for listening