ETH DENVER Episode 2: Interoperability and Rainbow Bridge with Chad Ostrowski

1613135007

NEAR’s second feature at ETH – Denver was with Chad O, who went into detail about the ETH – NEAR rainbow bridge. While the talk is directed towards a more technical audience, it provided a number of important insights with regards to the development status, and long term vision of the bridge. For a full transcript of the talk see the link to PDF Transcript. 

Starting with the Basics, How Does The Bridge Work?

Using the Rainbow bridge can be somewhat confusing at first, because of its permissionless and somewhat complicated structure. As Chad explains, there are four directions users can send assets: A token from ETH to (1) NEAR and (2) back to ETH. Or a token from NEAR to (1) ETH and (2) back to NEAR: 

“Note here, that we have two chains and four directions that you can send assets in. You can have Ethereum as an origin, where you have a fungible token on Ethereum bridged to a fungible token on NEAR, and then you send that bridged token back, where it becomes a natural fungible token on Ethereum again.

And the same thing in reverse: functional token on NEAR, to bridge fungible on Ethereum, bridged on Ethereum back to natural token on NEAR. The naming of this starts to be a problem pretty quickly, right?”

The process of moving an asset over the bridge is a multistep process that revolves around lockers and provers. Simply put, assets going from ETH to NEAR need to be locked before being sent across the bridge. Once the asset has been locked and sent across, a new one is minted on the opposite chain. Provers then exist to track that asset on the opposite blockchain so as to prove that an event happened to it. As Chad explains:  

“This is a multi-step process for an asset to go across the bridge. First you block it in Ethereum. You can see that this transaction was approved already, or the transaction was mined already, the approval transaction was mined and now we need to lock it, so let’s go ahead and do that.”

“Next step, one level out from that, you’ve got provers and the provers: you submit a proof to them.  You say this happened, this event was emitted in Ethereum and it will say yes, confirmed, it was, and it’ll use the information in the client in order to prove it.  Or no, that didn’t happen, so you can’t mint because the user would have double spend abilities. So right now the provers that we’ve implemented, that we maintain is the Eth-on-NEAR event prover you can prove that an event was emitted in Ethereum and on the Ethereum side you can prove that a NEAR transaction execution outcome was what you expect”

To summarize the entire process as a whole: 

I allowed the token locker to transfer my TST or my DAI. The token locker then transfers ownership of that TST or DAI to itself. You wait for sufficient confirmations on the Eth-on-NEAR client, that’s the ten blocks, and then you mint it in NEAR. And when you mint it, you submit proof of the event to the mintable fungible token. NEAR is an asynchronous blockchain, so it’s that contract. On the next it’s going to take a few blocks for this transit transaction to complete, but you’re going to submit a proof of that event and then it’s going to make a cross-contract call to the prover, which is going to make a cross-contract call to the client, and then it’s all going to come back and finish up and mint a token for you.”

The Goal of the Rainbow Bridge: Cross-Chain Applications

While the bridge can be technical and boring, it remains one of the most exciting developments in all of crypto because of the functionalities it will enable between NEAR and ETH: 

“Alright, so if it were easy to add cross-chain functionality to your own app, what sort of things would you do with it? The ones I can think of that we’ve talked about that we’re excited to see people build are using ERC-20 tokens in NEAR where block times are fast and transaction fees are cheap.”

Such cross-chain functionality gives rise to a number of new opportunities on both blockchains: 

“So anyway, other ideas: you could let users make NFTs in NEAR, again where transaction fees are cheap and we have a great account name system that Matt L. is going to be talking about tomorrow at the same time, where you can make it really transparent to users that they’re even using blockchain. So it’s easy to get users set up making NFTs, and then if they make awesome artwork that they want to send across to Ethereum where they can list it in larger marketplaces, that’s totally doable. You could let users balance liquidity and arbitrage across markets in both chains and more!”

From NFT’s, to liquidity, to arbitrage, to entire applications, the rainbow bridge will inaugurate a paradigm shift in crypto in which transaction fees will become affordable for everyone. 

What Comes Next?

Chad concluded the talk by discussing what comes next: 

So what’s next? What’s missing from this library? You might have noticed that there’s no authentication or like web 3js initialization. Unfortunately, for all you Ethers fans, this right now, the proof logic, has deep dependencies on web3.js. Might be able to use Ethers in your own app, just understand that we will be importing web3.js as well. Not sure if you care about bloating your Javascript in that way, but anyway, some more consideration needs to be given to how this app is, how this library is going to handle that. If people have good ideas or libraries or they love the way that it handles things like integration with metamask or whatever, I would love your links.