J3 PAIN 08 Thomas Bertani Scalability and inter blockchain connection via Oraclize
Ethereum Paris·Tue, Oct 9, 2018, 12:00 AM
Speaker
Transcript
hello to everyone thank you for having me here today I'm Thomas Burton ezo fertilized during this presentation I will talk about the possibility of using oracle eyes as it is today to provide some you know a skel scalability solution maybe or you know some options to communicate across chains so this is basically an open discussion it strictly depends on how the community of our people we choose to use the tools we have made available so I will show you some examples during the presentation and then we'll you know draw some conclusions so first of all I want to introduce quickly our eyes in five minutes for those who have not heard of the project yet so our class has been around on the theorem minute for two years and Al's now and it tries to solve the wallet garden the walled garden limitation so the fact that when you have a smart contract in the blockchain you are like in a sandbox so you cannot really reach out to any external context and it's impossible to get data from say web api is from a different block chain or for from anything like this so the way Oracle eyes does it is quite new because it separates like the Oracle from the data source so previous attempts like before 2015 will provide you know blocking Oracle's was all about trying to integrate existing providers of data with blotching like let's go to Yahoo Finance or to Bloomberg and let's provide that money theorem note yeah for sure and this doesn't really work in practice I mean in the real world so water flies tries to do is separating those two concepts and saying that the data transport layer so whoever connects the external world like the internet with the blockchain doesn't need to be the data source itself so the data source is like the external provider of the data while the Oracle is just you know an actor in the network that needs to deliver data that is integrated with the block and that is capable of connecting the two different contexts is the application in our case Andy theorem it will be a smart contrast the most likely or adapt in general so here it's important to note that the Oracle is like a crucial point of the architecture so if the Oracle tampers with the data the blockchain application we will just receive tamper data and we'll have no way to understand that the data is wrong so this is why we need the Oracle to provide some kind of guarantees some guarantees around the fact that you know is behaving honestly and that everything is alright and the data is authentic as reported by the external data source with no modifications so this is what we call the authenticity proof so the authenticity proof is a piece of data some evidence that Oracle eyes will always attach with the data when it is sent to a smart contract so that you can verify that Oracle eyes is behaving as expected and there is and that there is no malicious attempt to tamper with the data so authorize is first of all you know a technology that is blocking agnostic so it's not designed around you know a theorem only but it's really it enables a communication with like a theorem Bitcoin in a different way with Eris marks rootstock Korda and other things so it's really agnostic and the core of the service is the providing degeneration of those authenticity proof so the key is how do we get data from an external web api and send it around why proving it's authentic so this can be done in different ways there are today several projects that try to do it for example one is Town Crier which uses technology listed in the middle here which is the Intel SGX one there are other techniques traditionally your allies has been using TLS notary which is really actually if you're interested in diving into this look for TLS notary or page signer and those projects for the way they work they rely on a trans line with Amazon so it means that you need to trust Amazon in order to consider TLS Nottoli prove valuable and this is used by oculus basically to shift the trust and to move it away from ourselves to a different party in that case Amazon however even if you use technologies like Intel SGX you are always trusting our D provided autistic of the technology so in the case of IntelliJ X what it provides is some kind of hardware isolation for the execution of a process so you can define a piece of code and say I will execute it on a safe Intel CPU via Intel SGX I can get a signature from Intel saying that the execution was safe was done in a safe environment but still you are trusting Intel because basically you have no way to verify that you know the context is really as safe as the claim is to be similar guarantees you get also with different providers so for example Samsung get something called Samsung Knox that they use in smart phones to secure the key store then you have like on Qualcomm devices on most recent smart phones you have a trusted execution environment from Qualcomm and Android has also some software installation techniques like safety net itself the ledger I think there is a presentation right now done by Nicolas the city of ledger in a different room and the legend unless of course by default by design works as a wallet but really the way it works is it provides in a safe Hardware environment the execution of any application like it's an operative system and you can use a technique called the legend analyst attestation to get a signature from ledger saying there's a claim coming from the device is really coming from there and saying that it's safe so you can actually use the legend an OS to execute any application and to prove that you know according to legend this is safe so as you see there are always some so we might decide to trust ledger we might decide to trust Google for Android Qualcomm Amazon Intel Samsung and so on so why is this even interesting well if we had to trust a single party like Amazon where we wouldn't be here we will just go to Amazon and ask them to run the blockchain this will be much more efficient and realistic what we are trying to do here is really providing some stronger guarantees by by creating a structure which is similar to the one you see here so it's basically different layers of protection it's saying we don't want to trust a single provider but these relation techniques used here audison boxing and securing of processes which is trust code trusted computing in general is something which is variable and which can be used to extend the blockchain in a way which is flexible and which works today so let's just use something like oracle eyes in that case to generalize the problem and generate the authenticity proof based on the different techniques so what happens is that you choose what claim you want to secure let's say the claim is the data fetching from a Web API like you wants to verify that WolframAlpha is really reporting a gimmie result for the temperature in Paris what you do is executing the data fetching within a trusted computing solution and you generate an authenticity proof to back it then what you do is doing the same in different with a different technology and you keep doing it for all the technologies available what you end up with is a sequence of proofs that together provide a stronger claim because you will verify that you will be able to verify independently that the same claim is backed by all those parties at the same time like Google Amazon Intel Qualcomm and so on so if the data is wrong it means that basically they have if the date is wrong but the proofs pass it means that you know they are all compromising the data at the same time in the same way in a synchronized fashion and they also compromised the Oracle IT infrastructure which is quite unlikely especially when you compare it with the trust models we have today on the and even on the blockchain so this is an example code that shows like the typical way in solidity you would interact with our eyes so as you see you just write oracle eyes query and you specify the API call you wants to make what happens is that Oracle is sends back a transaction claiming what the result is unfortunately this is not very easy to read but here there is the result of the transaction in the callback transaction and the what you see here is not just the result but also the proof the authenticity proof backing the claim so dueting this the proof traditionally can be verified or of change so it means that you can monitor the network and see for the alpha million public queries backed by authenticity proofs we have and there is any one that doesn't pass and you will see that there is none but of course you can verify it independently and this is the Asscher point of it however like two months ago we released the proof shield which is a new functionality which enables the verification of authenticity proofs on chain so it basically converts the complexity of authenticity proofs to something simpler without changing the trust model so I don't want to dive too much into this right now because it's not the focus of the presentation but the idea is that you can have a smart contract receiving the authenticity proofs and verifying them at a cost which is around 60,000 gasps so not much and basically you just enable it by specifying that you want to proceed so it's very easy and then in your callback method here you see somehow does you have a proof verification function you can call and it will say like the proof is passing the proof is not passing and so on so you can avoid like Oracle eyes pushing drunk data even if you think we will be doing it once because of course if you check it for the past we have never done it so and you can verify it checking at the blockchain so if you don't trust this claim and you think it might happen in the future that is still the risk that realize we do it once and then like waste his reputation still with the proof verification unchanged there is not a risk of it happening even once so you can secure stronger higher amounts and with a proof sheet you can actually secure basically a different type of process mostly ultros so um in a nutshell what we just said is that our class can be used to you know fetch it from web api's and so you can get any data you like from a different context than a theorem itself like the web the internet or you can you know like get data from my PFS or use it to you know opener locks and emails all this kind of stuff that you can do with APs you something worth noting is that even if ap eyes are a central point of failure data is always inherently owned by somebody so if you want to check something like the temperature in Paris you might say that a single provider is not trusted so what you can do is something like alkalis is just choosing like ten different data sources and verify you know what is the average or what is the data according to different players so you can distribute the risk and as much as you like of course the way you aggregate the data depends strictly on the type of data you want so for the temperature is relatively easy if you want a random number things get much more complicated because you will never find the consensus on this but it's not just web data because this approach we just introduced with you know trusted computing backing the execution of the process can be used for different processes not just for the data fetching so something we released last year is this document let's call it a PDF not a white paper we explain like a new approach to distribute untrusted the delivery of entropy basically so on demand entrust delivery of entropy and this is based on the ledger on us specifically as the first implementation so it basically generates a random number we within a custom application on the ledge Anonymous that you can verify yourself this mark on that can do it in the same way and what happens is that you can verify that a single execution of the random number generator on a safe none has produced a given result according to ledger for example this is something that can be even more generic so it can be used for any arbitrary option computation we like like we define a piece of code and we say can we get that authenticity proof for this process for like our 3d function or for our Python code or for the you know engine of derivative or something like this so it can be used by the computation data source and this has been around for one year and a half and there are in the Y the several projects using it for different reasons so it can be used as we see in the next few slides also for providing interconnections between different block chains and also to scale up the block chain by basically reducing the complexity that you keep on chain in the optimal case so the mutant is a profound execution are exactly the same proofs wet before but instead of securing the process of data fetching which would be like one line of code saying fetch data from the web api what we do is enabling the user to specify what the code is so what should be executed the way you do it is by defining a computation archive so the archive is just you know a zip container where you have to specify the execution context so we use docker to describe the execution context not for the installation itself so docker in the past has proven itself to be quite weak for isolation in general so here we just use docker because it's the de facto standard so people just know how to write aquifers and it's a good way to describe the execution context then what you do is distributing is to alkalize or to some places where it can be verified for example on ipfs and you communicate to realize what is the ipfs of the code you want to execute so the AP FS referencing D archive with the dockerfile and the dependencies so how does this compare with something like true--but for example I just wanted to put this light here even if I explained also that country the same concept because this is asked a lot and I think true--but is really an interesting project but it's really not the same thing so it's very different so basically the main differences between like a computation data source executed in trusted execution environments and through bit is that true--but needs the computation to be deterministic so it means the in the decodes to be written in a very specific way so that the verifiers can do it again and they can maybe challenge it on chain if something goes wrong and if there is a waster blower that notices so here the difference is that basically true--but is safer but it has like so it's a different trust model I would say but it's not as generic so it cannot be used for the same things for example if you want to execute like the generation of our random number on true bit there is really no way to do it while on something like this it's it's very easy to implement like with the random data source so the idea is that the off chain computation data source provides do dentista proof so that you can verify that the context was safe the execution was safe without executing it again so it's a verification but it doesn't require a new execution so if you have a very complex piece of code it there is a huge difference because verifying the proof takes like a constant amount of time while executing the complex code is something very complicated so if you have many nodes it can be very computationally expensive also there is no need to use like dedicated virtual machines languages or anything like this as you can just define a piece of code in the way you like I want to dive into gambling because like it or not on the main that 80% of smart contrasts are probably doing gambling so what is the reason behind looking for external randomness well it's really complicated on chain to find reliable sources of randomness that miners will not be able to compromise or to somehow orchestrate so typically smart contrast trying to secure huge amounts on lotteries and things like this look for external sources of randomness so one way to do it is like moving the random number generator outside and trying to get some kind of guarantees on the fact that the random number generator has been executed correctly so let's check how it looks like with the old approach like with the data fetching from traditional URL like random.org which provides random numbers by an API versus like the computation like the efficient computation the difference is that in the first case you will just specify the URL of the random.org endpoint and you will need to trust the provider of the service while in this case what happens is that you have much more transparency because you know exactly what's going to be executed and what's going to be executed is displayed here so you specify you want a computation and this is like DB is 58 encoded mu th of ipfs where anybody can really fetch their drive and check what the archive is supposed to do then you tonicity proof with reference this on dis archive and will claim that the result comes from the recording from two deities like to Amazon for example so a minute is mostly gambling smart contracts that are leveraging external data but on test nets there is a huge diversity of projects asking for external data so why well one reason is the cost of gas for example so many use cases turns out they are not as valuable on the blockchain when the fees are so high so one obvious solution is the of following a similar approach than this one and trying to keep on chain just the critical logic while moving off chain as much as we can so this is just a random list of some projects that are using our eyes right now and some of those are using like the efficient computation to do some post-processing for example of the data they get on the web api so they get the data from the web api then it may be to aggregate something or to do some calculations and then they just sent back to the contract the final result so the contract is basically just in charge of releasing the funds of changing the ownership or something or doing really a very small you know amount of gas of computation so the gas consumption is relatively low this means that once you move to an option context like the execution of a piece of this Marc contract what you have is that the smart contract on chain has to handle the payments change of ownership the administration the upgrading logic which is already a lot and it also is able to handle the challenge of the proof so if the option code which has been secured with a different trust model within a different environment and so on turns out to be compromised what happens is that online on chain you can have the verification of the proof the proof will not pass and there might be some collateral being wasted for example so I will show a couple of examples so this one is not implemented but really anybody could implement it we will likely create an example a public example to show this but I think that if somebody is committed to try in like alpha an hour is doable so the idea is that you can create a generic computational kyv that can be used to delegate one option context the execution of a solidity function so why would you want to do that well let's say that you have a huge contract like many we have today and you have some functions of the character hit this one which has some complex logic or which is expensive because maybe it needs to read a lot or write in storage or it needs to do I don't know different steps it needs to iterate over things something like that so in that case what you can do is you define the count decode in solidity you call Oracle eyes with a computational kyv which will try to execute in memory from a node the solidity function that you had defined on chain then you send back the result you send back do you think is the proof very fine using this tree proof cause a fixed amount of gas which is likely lower than the gas us to spend for the function itself so it's 60,000 gas compared to whatever you had in the function if it is wrong you can fall back to the on chain execution if it's correct you would have like spended much less so this is an example 3d code of how it will look like you just define an expensive function well this is not very expensive but you can put whatever you like here then you just call oracle eyes this is like cheap execution of expensive function oracle eyes will somehow receive the instructions that you know what you want to execute is this computation archive this computation archive knows that the argument is the name of the function that we need to be executed and then oracle eyes we send you back like the cool back and you will be able to verify it if it passes then you're fine and maybe you have like executed a very expensive function that would have cost three million girls or something in with 60,000 if not you just fall back and do it on train the same thing can be done also with a Bitcoin like node or any other node really so you can define in the computation archive whatever you like so it can be like something we have tested is an SPV node like multi-bit or it could be electrum or whatever Bitcoin node you like and you can use it from to reference from a theorem like some Bitcoin content so you can for exam or say what is D I wish share the slides so don't worry if you cannot read it so you can for example say like this is a Bitcoin address I want to check via this computation archive via the SPP node if the given Bitcoin address has some bitcoins or not and if it does I will received using this is the proof I will verify it and I will use it to read ISA payment on a theorem so this can be used ready to connect anything with anything else so if we are interested in a theorem we can use it to connect any existing chain following the same approach in a very easy fashion and with the guarantee of two authenticity bras so since the previous presentation what about was about writing I just wanted to mention that we are studying very closely like payment channels and why state channels are quite far away in diffusion the something like a smart payment channel which I will explain in a second is definitely viable and with relize it will be easy to implement so a smart TV channel is just a payment channel where there are some conditions which are relatively simple so it's not a generic abstraction of the state but it's just a verification of a condition like I want the payment to succeed just if the temperature in Paris right now is greater than 10 degrees or something so this is something definitely possible I don't have time unfortunately now to dive into this but feel free to come talk to me or to ask your question there are something we are doing to make the computation data source more agnostic you can see it here on get up you'll find several examples working with this same generic competition technique so this is the current status so as you see there are more than 400 public github repositories that are using alkalis so these are just the public ones and we have handled on minute 450 thousand plus API requests in the last two years an alpha so thank you for your attention that's pretty much it for the presentation if you have questions so maybe we have time for one maybe not that's dry with one thank you so he said in order not to rely on a single party for the proof you can rely on multiple what's the trade-off on that is there trade-off in terms of verifying the proof or is it all in one proof well for example by using the option data source what happens is that you can write a computation archive which gets data from as many API external API data sources as you like and the aggregation can be done on your code so what happens is that you get back the already aggregated result with a single proof so you can actually reduce everything always to a single proof as long as you keep your process your custom process whatever it is to the option in the efficient context if you want to do the aggregation on chain it might make sense or not but in that case you need to verify more than one proof so it becomes more more expensive okay thanks thank you [Applause]
Automatic transcript — names and jargon may be misspelled.