New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Boba Network 🛠 Realizing the Full Potential of Web3

ETHGlobalSun, Oct 9, 2022, 12:00 AM

Join Alan Chiu of Boba Network for a workshop titled "Realizing the Full Potential of Web3." Hybrid compute helps developers interact with the outside world from within solidity smart contracts. All data returned from external APIs, such as random numbers and real-time financial data, are deposited into a public data-storage contract on Ethereum Mainnet. This extra data allows replicas, verifiers, and fraud-detectors to reproduce and validate the Boba L2 blockchain, block by block. In this workshop, we'll show that using Turing is as easy as calling specific functions from inside your smart contract. This workshop is part of ETHAmsterdam, the first in-person hackathon for ETHGlobal since ETHLondon in 2019. Join over 800 likeminded engineers, designers, and creators to build and learn over one full weekend at the Beurs Van Berlage in Amsterdam. ETHAmsterdam is taking place as part of Devconnect, the week-long in-person gathering in Amsterdam. We're back to build, we hope you'll join us. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] [Applause] all right good morning uh thanks for coming to this workshop about realizing the full potential of web three it's uh it's really about how why would be ebola mobile network and what touring hybrid compute which is only available in bulba would help developers build more engaging more interesting or compelling web free applications so let's let's go back in time a little bit right to the original creation of ethereum and the fundamental premise of ethereum is that while bitcoin which is a ledger is good if you can actually program it it's even better computer is very competitive and our hypothesis is that let's take it one step further a more connected computer will lead to a more creative and powerful decentralized system just to give you an analogy right um we all have a phone and imagine creating mobile apps without the cloud right you're limited to what you can do on the device itself and that's it is you can still build apps that run on the phone but it's not nearly as interesting right and that's what we do here so you know we started with bitcoin bitcoin script minimal stack-based programming language is really designed it's very transaction oriented it's not touring complete and then ethereum came along breakthrough innovation right however it is slow as we all know and there's a good reason for that the theorem was designed to maximize to optimize for raw compute performance it's designed to be a decentralized system right with with thousands of uncoordinated nodes that can somehow come to come to agreement on something and and that's really hard and in order to achieve that there has to be a lot of limitations imposed on the kinds of computations that you can do that we can do and for example you can only do integer operations reason is if you allow floating point operations what if two computers are running on like different cpus and they come back right has slightly different answers it won't be they won't be able to come to consensus and and so so that's why ethereum is is slow and and and the computational complexity is very limited right we can only do pretty basic computations you can even take the square root of a number and get a reasonably precise answer but then l2 layer 2s came along and well the original motivation for creating layer 2s is to address the most obvious challenges of ethereum which is speed and throughput and cost right there's actually an additional major advantage and that's enabling more complex complications and that might seem a little bit counter-intuitive people don't think of layer twos as they look like that kind of benefit right let's using the layers a little faster or cheaper all this awesome let's just look at transactions to layer twos well the key difference what what is the layers relation really is is is we're decomposing this monolithic layer called ethereum that combines execution sentiment and data availability all into one layer we're taking the execution layer separating that into into its own layer and we're calling w2 and the key difference between layer 2 and layer 1 is that layer 2 doesn't run its own consensus protocol right the whole point is that we rely on layer one for consensus so we don't need to do our separating these two now certainly because of that we don't need to worry about what it takes to ensure thousands or ten thousands of computers will arrive at the same answer because laters are only responsible for execution and what does that mean right it means we don't need to impose the same kinds of constraints on the kinds of computations you can do as you would need to on the layer one and that changes everything right so on layer twos there's only a single sequencer that produces a blocks it executes the transactions and therefore we thought well maybe we could use use this to advantage to develop this advantage to interact with the outside world to call external apis and after a year's worth of work we're able to overcome evm's restrictions by modifying gas so we we have a customized version of gas running on mobile network it's called l2t for touring ltt geth with atomic support for generating random numbers and making any external api quality that you specify that you trust and it's super simple to use very easy these are one line calls what you see on the screen is the pseudo code but like look at the first example to re-get random that's all you need to do to get a random number or the second second example you specify the rpc end point that you want to call to let's say get the current call for btc usd pair boom like one column when you're done now how does it work all right so let's look behind the scenes a little bit so our l2t gap is the one that that actually makes the external api call on behalf of your smart contract right so it will intercept certain calls that have tutoring calls embedded in them and then call the option api or rent to generate a random number and when the results come back our guest would replace the original call data with modified call data that includes the responses that come back from the off chain call and this is important because we need to ensure that these transactions can be verified afterwards by the front provers we need to make sure that whatever we've done is fully compatible with the rest of the of the optimistic role of architecture and so we'll write both the original transaction and the modified call data that includes the option api responses into ethereum layer one and from that point on everything is treated just as if it were a normal guest transaction and the key is only the sequencer would call the api no one else because if you let other independent nodes call the same api you might not get the same results back right so it's important that only the sequencer makes the calls and then once the layer 2 block is written back on layer 1 and verifiers and the replicas will use the stored responses from the api call from the blog to do their job so here's a diagram that outlines how how that works all right so step one l2t gap will intercept the rpgs uh would well you would bring an rpc call to the gas and and our guests would be like okay this is a touring car it is because the the endpoint that you have specified wait for the response to come back uh if the responses come back it's going to timeout we've set the timeout currently at 1200 milliseconds right so when you're when you're writing around this you want to have a graceful fallback default value in case the external api doesn't come back or takes too long all right so the response comes back our guest would replace the original call data with uh updated input that includes the response that comes back from the option called creates a new block and and and submits that to layer one and then new block is indexed uh represents this word to verify this work everything else just works it's taking us a while to to roll this up on on our main net because there's a lot of work that needed to happen under the hood these are some of the changes that we need to make and so we modify evm goal and modify the ethereum block format to include the responses from the blockchain apis and all of the data from blockchain apis are written back to ethereum layer 1. so as a result we put a limit on the size of the response string that comes back because otherwise these calls could become really expensive and then we also added the ability for gaff to replay these compute requests based on the data that's written to ethereum we also modify metric internal data types and finalize an example and other parts of how to get minor work goal we also needed to modify all the services that pass data right from layer 2 to layer 1 and that's layer 1 how you inject layer 1 data into the layer 2 gap and then we test and tested and tested finally rolled out touring on rinkerby during east denver and then a month later we made it live on mainland and by now developers have started building on mobile using touring and i'll give you some example use cases for example you can build d5 protocols based on opting assets right such as real estate uh or some sort of bonds denominated world you can now start pulling these fiat world real world assets into into defense there's a team on building on bulba creating an nft lending protocol that uses an off-chain machine learning based valuation model to place you know to back to put evaluation on these entities so that they can figure out how much to land against these collaterals right imagine doing trying to do that all on chain it's just impossible if you're too expensive too slow but now you can you get the best goal for us you might also want to really decide to incentivize your community members to uh to do certain things on social media for example right to retweet or and you can use touring to make to call twitter to verify that to see if someone has actually tweeted something and after that verification you can then automatically release or airdrop some rewards to these community members right and since it's all happening on layer two these transactions are much cheaper much more affordable than able to do it on layer one there are also down memberships right there that would thousands that want to connect their members identity with the off-chain real-world identities now to to some of the web 3 natives this might seem like a little weird but if you think about how web 3 is drawing and looping in more and more mainstream organizations into the movement you start realizing there will be actually more demand to integrate what's happening on chain with what's happening with what already exists in blockchain for example there are college alumni associations out there thinking about how do we create entities that represent memberships in our alumni association and identify them as verified members is a metaverse that they created so in that case they're not really trying to create nfts that can be flipped or traded try to to use entities to represent an identity that exists in the real world that needs to be verified but you don't want someone to to fake themselves you know as your as your uh you know as a hardware and it really does so touring also enables that you can create entities that could be connected to the school's official alumni directory and verify the real world identity of that metaverse character you can also create twitter activity based token fountain we've created this we created a boba fountain on a ring breaking b and you can also use our atomic random number generator for your teeth and bottom line is if we're able to to connect this decentralized computer with the rest of the world with other network computers you can now create a lot more interesting applications right and this here the list here is we're just scratching the services some of these ideas actually came from developers that started trying out touring so we've got a detailed write-up at this link bitly slash get touring the capital t it's really easy to use it's just a one-line call and what really sets us apart at boba here is we're enabling developers to build smarter applications on ethereum we're not just scaling it in a traditional sense of making it faster and cheaper we are augmenting ethereum by enabling you to build applications that can include a algorithms that have that are much more complex than what you can execute on ethereum all right so that that's a hybrid confused story uh it's live on mainnet i really encourage you to uh try it and see what you can build with it a lot of developers are finding that this completely changes how they think about what they can build it really expands the design space available to you and yeah i can't wait to see what comes out of this weekend's hackathon thank you [Applause] questions yes yeah uh just got a quick question about swords i've got a quick question about i don't know if it's working but um security um so you said that there was a time limit on requests coming back and having a bad response as well do you think it's possible that someone might want to overload the network with requests that might take too long and that might slow down block times or transactions because of that is that something that's possible um it is possible which is why we put a time limit on it of course we have no control over how quickly the external api comes back and um yeah so it's a 12 uh 1200 millisecond timeout um fortunately i mean you get to control which ap as you call and our hypothesis here is that the developers are only going to call but you know apis that you trust so these are either going to be your own rpc endpoints if you're let's say that energy lending model right you're running your own option evaluation model is your own rpc endpoint but you if it doesn't come back but it's too slow you have full control over how you want to fix that and in the case of calling twitter or whatever that that is a more uh much more established and trusted api so that's less of an issue now it is possible for a let's say a various developer that really intentionally wanted to to uh deploy one contract that caused some random impact it just never comes back that that is possible and and um but fortunately we control we do control gas in this case right with the trusted part it operates the single single sequencer so if that's the case we can filter that out that sounds good yeah um what other sort of functions do you see potentially being created in the future as well obviously you've got random number and api do you see stuff like um maybe zero knowledge proofs as well um possibly ways of having arbitrary sort of code get run separately and then having it proved later down the line that this has been run and it's valid as well is that something you think about because you frame that passion again sure um so so are you thinking about other sort of like arbitrary sort of functions that maybe developers want to create as well and having those arbitrary functions run on the network and then maybe have like a proof function something like you know zkp um where you can prove that those functions have been run correctly uh the output is correct as well is that something that is you think about with like both as well potentially yeah definitely that's something that we're looking into great question uh quick question as you've said because of the api turing feature right there can only be one sequencer the problem that i see is if the sequencer gets attacked goes rogue goes offline right this would destroy the whole rollout correct yeah so that's a more general challenge with today's rollouts in general right not specific to mobile touring um so we are we've already begun our work on distributing the sequencer to address this availability issue right and in terms of rogue sequencers um all of the rollers are going to have to deal with this challenge as soon as we start letting other parties run these sequencers now we are not of course going to operate at a real seamless ourselves because that will be shooting ourselves in the foot we have enough skin in the game to not do that so the idea would be to extend the same to ensure that other sequencer operators will have enough skin in the game through staking other mechanisms that if they do go wrong there will be severe punishments okay but this uh this api feature makes it harder right so if you're evm equivalent like optimism orbiter for example to decentralize the sequencer is easier without the api feature right um because how would you come to consensus yeah so we will we won't be running our own consensus protocol amounts of sequesters we'll be uh rotating the role of making touring calls so at another really quick question um you pointed out the example of the twitter api right so i imagine you have a smart contract you do the actual api call inside the smart contract right you have to put the twitter api key somewhere right and if it's in the smart contract anyone can see that how do you handle this stuff we do handle it because we have already implemented our faucets that uh on rankingb that requires a user to go through captcha um and how do we handle the api key i'll need to get back to you on that yeah thanks yeah you more questions [Music] will you manage through the hackathon so you get enough sleep you're okay you're excited for the rest of the hackathon super excited thank you that's the spirit thank you all right well thank you for coming to this workshop please go to bitly slash cat touring check out desktop really look forward to seeing you build amazing things on touring and bola thank you [Applause] [Music] [Applause] [Music] you

Automatic transcript — names and jargon may be misspelled.