Arbitrary Message Bridge

ETHCC 3 · March 2020 · 20:05

Igor Barinov introduces an arbitrary-message bridge for cross-chain communication.

Speakers

Topics

From ETHCC 3, hosted by Ethereum France.

Transcript

okay that's that so it's like two minutes before official schedule I'm good to see my new friends most people here I know for a long time today we're going to talk about our new bridge which is a arbitrary message bridge who knows what like arbitrary method message bridge stands for like what is it you have any ideas what what do you think yeah that's right that's kind of generalized solution for cross chain communications right like you know TCP

for Internet the the MB is a mode of operation of our bridge product which we call token bridge it's a successor of a project known as parity bridge in 2017 we worked it out and after completely rewrote it like all parts or across contracts and so forth so now it's independent project and we launched our first bridge in May 2000 18 almost two years ago it was a specialized bridge to solve one exact problem right how to bring a native tokens of a sidechain to my net right like and why do we need to do this it's because on when you're on

sidechain is quite hard to get liquidity from you know some tools which are available mainly for example indexes right so we built a bridge which allowed to lock tokens on a sidechain and get wrapped tokens wrapped ears it went against representation on mania right and after we listed this wrapped token on decentralized a changes like Bank or Union swap and so forth right so this bridge is still operating since May 2008 until now with kind of the same security settings without any incidents without downtime and so forth but when we think about this this bridge is very specific to one specific small network with for a specific use case for

a specific token and so forth right so people can use this infrastructure on this you know think only for for one purpose move one specific talking from chain to chain and when we started to build one more bridge for four-four tie it was a different use case so built a different type of bridge which allowed to lock down main that and convert it into X die which is a native token on a side chain and now this bridge supports die and sigh and a marginal chord is going to support China also so X I chain will be exchanging and this is also very specific bridge and

the third bridge we launched was a bridge between the Hume and and if you're in classic to grab if you're in classic native document of we're talking on the classic so the problem for for all these bridges is that we'll have to have a lot of infrastructure right so like for me most security settings is like three validators per bridge you know to have two or three signature to relay events it's some DevOps you know scripts ansible play books also some monitoring tools full notes in ideal security settings validators of the bridge of the bridge host both full notes on the same note where they have

this oracle write the query chain local and not trust and fewer and other services so just think about this you know how many servers how many operations also security of security model of token bridge is based on like multi-level groups and and decisions that these groups can make so for example to select for date of this one multi seek to change parameters of like limits it's another multi seek to upgrade it's another multi seek the small t6 can be like zero X zero right so we can make this bridge permissionless but in a normal operational mode it's a some group of people holding these keys just in case

some decisions should be made right for periods three validators 4x day for validators and it's all it's all about like management and management of updates you know all these G words that were tired of so when we when we started like to think about like other bridges and adoption of these bridges like each new site gene or projects they required again again the same interaction of bridges so that's how we started to think about generalized solution where we can have one pair of for one pair of networks one set of validators and bridge can be open to anyone so anyone can use the same bridge

without like asking us or asking permissions to do anything but we can use the same bridge to have kind of the same the same use cases as we have now and build new use cases and the idea was can we make a bridge which will support all previous token standards all current token standards and all future Zygon standards so that's how we come out with the idea came out with the idea of aim B so it's kind of bad practice to put a lot of information on the slide but you know the idea so like the as a gentleman said that the idea is to of aim B is to

relay any data between between two chains right so the there in this type of setting there are contracts on both sides and a contract which is like originating a call encoding the the method call which can include or exclude parameters of the call and after the the data's relate in here in this example I put from a theorem to a side chain by oracles and after the aim B contracts on another side executes this call by sending it to the receiver contract I would have a graphical representation of this in the few slide okay so the kv2 call the the imbiah bridge is a simplest

or to call the function and pass the address of the contract on the another side of the chain encode data with with the method and the parameters which will be called another network and also to specify the the gas limit which will be spent by this called another network so it requires some preparation for the method call but you know for for many for many use cases like you know token transfers this estimation so you know we can know them in advance and there is no need to like any new math for it so that's our main picture about the how

the bridge is working so Ellis when she is interacting with the contract contract encodes some method call for her and cause the MB contract proxy and cause required to pass message validators are listening to events originated from the mb contract and a link the event from the one from the mb contract to another MV contract on another chain so in this scenario we have a quorum of you know three validators and on two validators achieve this quorum so the message is relayed and the foreign my contract called the method on to receive a contract on the other side right so here's an example

for the like real world scenario so if we want to transfer ear sees six seven seven token which is a who knows what is e OC six seven seven kinda not many people are using it but this is a you see token you see two in token standard with a transparent call so we can have a function call a fat transfer which is convenient for interaction of token contracts with other contracts so here alice is doing transferring call of the state talking token and that's something that we call mediators so mediators smart contracts which is like you can think about them like libraries of smart contracts which can be which you can take for for some existing token

types for example we have a library for you see six seven seven or - one so this the cyber is already built but like if you need other token standard or some non-standardized interaction you can build mediators yourself so we call pair of mediators as an extension so we have NB bridge and you can put an extension on the bridge which can transfer tokens from chain to chain right and this extension consists of two meters so let's say if if this Alice is working with mediator off I don't know synthetics contract right and she wants to send a CVC from chain to

chain so most likely she shall be using mediators deployed by synthetic steam right but in big contracts deployed by no sub by the I'd say the owl right which is supporting the NB bridge but mediators can be deployed by anyone and anyone can interact with the in big contract so when a mediator is mediators passing the message to another side another mediator on the side chain side taking this call and and actually convert it into the mint operation on

the six seven seven token all the sides inside so for users it's almost you know they don't see all the things right they just called make one call and they get tokens on the other side so it's very convenient so the the call can be we can have it synchronous or asynchronous depends on the use cases we can have synchronous call across multiple chains it's also supportable so for example now we have any breach deployed between Pio and the main net and X domain net and some we're going to deploy it on on classic so we can have you know interactions like okay

send token from X domain net and from main lead to classic right it's a it's within the design and the scope of the of the protocol and there is no need to additional changes right when validators are watching for this event they have because you know all this change classic theorem and pure way they're not instantly final they're validators are watching for some number of blocks to finalize the chain for now we have eight blocks four four four minute I don't remember how many we have four classic more and and same for a Forex day right so the the the

meat-eaters can implement different token standards and for now we have four four most common for a year seat women for AC seven to one right so the the breeches is already audited and deployed between Peru and Maine net and X 10 minute and this bridge is I'd say in production and can be used by by anyone right so that's that's actually that's what's very exciting me about because I'm getting messages like okay we deployed mediators and we have some questions and people are actually starting to to use cross chain communications and I think that's something very important because it's something that cryptocurrencies have

started from right and also something that cryptocurrencies are should be right like all chain should be connected when we think about one of the first use cases of cryptocurrencies like trading foreign exchange what is trading on exchange you move token from decentralized storage to centralize this kind of bridging but with different trust assumptions right here trust assumptions are still if you watch the talk by impossibility of decentralized or trustless cross gene execution for for cross chain communications that is really the keys but when we think about how to like like what what are what are problems with

with this relaying of tokens and what is the problem what what problems can we have with a product like token bridge there are some there's some obvious like problems right okay so while data scan stopped serving their alright or you know contrast can be hacked and so forth right and there are some measurements in existing this aim be contractors quite come quite complex think right so when we when we think about this these things we we thought a lot about this but when we think like is it like decentralized for now now for now it's not right because fully decentralized requires like open participation of validators and for now

it's it's not it's not it's not it's not possible right but the legally wise like is this bridge constitutes my transmitting of tokens it's it's not because for like from legal standpoint AMD bridges decentralized and we have legal opinion for for this setting from the US law firm which is quite cool and I think that's the only bridge technology so when you receive a call you should you should check who are receiving this call from right so you should check that the sender is a address of the bridge so you have you have to check that you have we have some helpers to check hash of the transaction which invoked required to pass message

from the from the theorem side right and we have a helper to check the address of the important contract so before you do something let's say before you mint tokens on the sidechain side when you received a message from mediator you should check you know who are you seeing this message for from right because anyone can send a message from the from the bridge so the the MB components as I said like there are a lot of components and but you know for for users they only need to like use existing mediators or you know create their own mediators and all this you know system contracts or hose and DevOps site is supported by us and we are always open to you know

extent number of auditors for validating this arbitrary message bridge yeah there are some early adopters if you remember from my like history site where we have some existing pages and we move we migrate all the existing bridges for period and dc2 this amb model so instead of a zoo of bridges we're going to have one bridge per a pair of network and there are some some other projects with different token types for example Dow steak they have you know mute for us new token standard you see eight to seven first time I saw this but you know they adapted mediated from six seven seven

and they started to use this bridge right the it's open source free to use so anyone can take it and deploy any bridges by themselves or use our hosts at OMB which is quite quite easy to use so known the dockside will have a folder commutation how to like deploy NB bridge and how to deploy extensions and how to deploy tensions with four different action types and some token types like you see seven to one required to like more sophisticated integration because they can contain metadata and so forth so we have a use case based on cryptic

ETA example how to move cryptic eg from chain to chain without any additional interactions from from users just by you know sending keep each it'll to a mediator contract yeah let's I think my time is up right maybe for like one or two questions yeah thank you thanks for that gas cost difference between them let's have previous method in the new one the ghast cost difference how much do I spend in the gas for a simple if transfer using the new rich versus the

older but I guess it's more expensive so right you have also displaying more intermediaries so it might be interesting to like keep the old bridges for the most popular tokens well carick cares about the like price of the transfer they're more interested in like having the safe way from chain to chain right just to be sure that tokens are going to be transferred to eventually kind people on this bridge you know the

Ephrata but they're still using it any other questions thank you so what's the question no I don't have any you don't have any question maybe bop bop you always have questions is that Capilano Suspension Bridge in Vancouver the bridge there this bridge yeah just search for like dangerous bridges you know like people afraid of but because I think it might be my hometown bridge

just don't wobble it because it's really scary if you do okay thank you [Applause]