Building a privacy-preserving oracle in less than 5 minutes
ETHCC 4 · July 2021 · 18:40
Gilles Fedak introduces iExec’s Oracle Factory, a creation tool and open-source library for building oracles without writing code. He describes presets, shared user-created oracles and support for confidential information such as API credentials and private keys.
Speakers
Topics
From ETHCC 4, hosted by Ethereum France.
Transcript
hi everyone so warning this talk is going to be way more pragmatic than the vitaliks one would just have uh my name is zil fedak and today i'm going to present you how can we build a trusted and decentralized and privacy preserving oracle in less than five minutes so that sounds a little bit like magic but actually it's that this is a new product we are launching um that with some launch it's called the oracle factory and you will i will introduce you during this tour the main features and how it will look like so first um recap about
what is ixat you may know about the project maybe you you don't so at exec we are building a decentralized marketplace for computing resources so this is a marketplace where one can in turn monetize their servers their applications or their data sets and here the the keyword is really decentralized so you can fix it as a sort of airbnb for servers but of course without airbnb these are the the actors in the marketplace that directly interact in a peer-to-peer way without any central authority so a couple of words about the company we are located in lyon we did our ico
in april so we released the rrc token at that time we are at the moment about 25 people and we are growing a lot so if you are interested in the project i really encourage you to to come and visit our booth to come and visit our website and see if there are positions open that where your your talent and skills could be a good fit so now let's talk about uh oracle so oracle it's really a central piece of software and decentralization um the rule is very simple it basically connects
the blockchain which is a closed world to the rest of the world wide web and so the role of the oracle is very simple basically it takes one information on the website and put that information in a smart contract deployed on the blockchain and so there are many use cases for that of course the most well-known oracle are price feed so typically in a price feed you will find the price of bitcoin in dollars and such kind of information when it's odd chain can be used by many other defy applications uh of course there are other use cases such as for instance random generator for
gaming and why is that just because as the blockchain is deterministic having pure uh really actual random numbers on blockchain is considered a different difficult challenge and so the question now is what makes a good oracle so the first challenge is really about trust okay have the price of bitcoin in my smart contract but i need an extra mechanism or extra information available on chain that tells me that this price is the correct price and it's not you know a random price that goes against my policy of security or my policy of trust the second challenge is that we don't
want to be an oracle only for public information we also want to access private information or information that requires uh credentials to be accessed and its case the question is how do i provide those critical information for instance an api key to the oracle infrastructure and while keeping this information secret from the oracle infrastructure and finally the last challenge is about this how independent can i be with respect to the oracle infrastructures for for instance can i be able to use several data sources uh can i be able to update the information by myself or should i rely on the on
the oracle infrastructure so at i exec we used to um already address this issue of oracle so in the past we work with kaiko so keiko is a french company doing market data they basically connect many exchanges and scan their order books and decide of what is a kind of average bitcoin price over several exchanges and so in the past we have delivered a price field oracle with kaiko so kaiko here is considered as a trusted data source and this particular oracle iaco plus ixec you are basically certain that what you have on chain
is the actual keiko data another example that we did was sort of a tutorial or a demo about how do we build a decentralized and trusted oracle so if some of the concepts during this tour are a little bit obscure to you i really do encourage you to try this uh this demo and probably it will make things really clear for everyone so now the or oracle um the exec oracle factory so based on those examples what we did is that we we had the intuition that there was a different way to build oracle using the isa stack and what we did a sort of
survey amongst um you know ethereum developers to really understand what were what were their requirements when they have to deal with oracle okay when developing functionality application and so based on that survey uh we um we launched this concept of oracle factory which we think satisfies most of their needs so first thing we wanted to have is really an easy way to develop and deploy oracle and something and that's actually the case i will show you that later but basically you have a graphical user interface you just have to provide very few information uh you don't doesn't require any strong developer skill it's an oracle that is
trusted and for that rely on several technology one being the proof of contribution consortius protocol which is a consortium protocol for doing option computing plus trusted execution environments it's decentralized and so that you can provide many trusted data sources and anyone can update the data the update the oracle at any time and one of the key features i think is about confidentiality it means that you can provide some confidential information some foreign secret api keys and the oracle infrastructure will never know about that i will show you that later using for that matter something called end-to-end encryption so the oracle factory it looks like this
uh when entering the system you have uh first a view of your oracle that if you did not create them that's not a problem you have a view of some other oracles that were there before we called there we call those oracle preset oracles so they are already predefined and somehow you can customize them and make them work after for instance you have a price field and you would go on that price feeder oracle select a specific pair you are interested in and then you can trigger the update and you can then verify in the blockchain that this this oracle is working but that's not probably what developers want what they want is to actually
build their own oracles and so here is the interface to build your own oracle so you would give it a name for instance one key feature here or outline in red is the fact that it can provide secrets okay so if you decide to provide secret those will be treated as data set in exec and data set ensure that everything is end-to-end encrypted and plus additionally it will be a provider your oracle will be export as an nft so configuring the the actual or is pretty simple and basically you have to define the the api uh endpoint so that's basically giving the url to access the
information you have to inform about your what tutorial api keys and some other information then you have to usually the result of the api call is a json so you can browse this json to explicitly say i'm interested in that information and then everything else you know will convey this information you basically select it to the blockchain so that's very simple as you see it doesn't even require any specific code and here's an example so it's the bitcoin price and you have the the configuration here and additionally of course we also give the solidity code as a tutorial so that you can access
that information that was provided by the oracle so how does it work actually your core factory is based upon the the ixx stack so the centroids marketplace so i'm going to briefly describe describe this so i exec it's a decentralized marketplace for a computing resource it works this way we have providers so providers can be data providers can be application providers can be cloud providers and when they want to sell the usage of their resources finally they create some orders another says okay i own this data i know i'm willing to rent this data somehow and this is the price and these are the
applications that are allowed to use those data and and so forth okay so we call that market orders and conversely you have requesters and those requests are going to buy the usage of the of those resources so data machines or applications and the ixx stack basically manage everything the you know everything so transferring secrets provisioning computing resources moving data around etc etc so one central thing here is the proof of contribution so this is a consortium algorithm that verifies unchain that an offshoring task was performed
correctly so how does it work basically once everybody uh wants we have the the four orders that match it means that everybody is okay to work together we call that a deal the deal is sealed unchained by a smart contract that verifies that everybody was the correct owner of the you know specific resources once a deal is sealed unchained then the consensus can start it also means that the workers what we call the workers are the machines that are going to to compute we start compute once everybody agrees to to work together it also means that we can deliver the secrets to the enclave
of course we verify that enclaves are correctly working together and at the end of the computation we have a result the result goes back to the proof of contribution protocol i mean not the result the hash of the signature of the result of course obviously and so here the proof of construction protocol does a lot of verification can i say that it was executed with an enclave it manages reputation it also manages take proceed with the payment etc etc so that's a really an important piece of a software in the sense that because this is very this is working on chain it's also how do you eventually verify the trust that you assume from from your
computation so as i mentioned we are heavily relying on trusted execution environment so this is a feature that is proposed by the process actually it's something that is included in the processor so very briefly how it works it's a segment of memory which is encrypted which is and which is only decrypted within the processor so it has several very important properties for us one is that thanks to this feature the application we can make sure that the application that was supposed to be executed is the actual one that has been
exactly executed that's first second we also have a proof that the execution happened happened correctly and no one has been able to tamper with the execution and finally very one very important feature is that all the secrets that will be conveyed to this uh uh enclave will remain confidential remain secret even to the owner of the of the machine so i exec is also this oracle factories are also implemented on top of a new version of ixec that we call ixec v6 it has very important feature in particular the fact
that we are running the enclaves in what we call production mode so this production mode is actually an intel feature we also have several upgrade of the middle one that are very important for making the system more scalable and more reliable so what's next about this oracle factory at the end of the year probably or beginning of next year there will be a the second version of the oracle factory we're already uh thinking about some updates or considering that we are considering super important uh further will be monetization of oracle so that means that people building oracles thanks to this oracle factory
will be able to run their oracles so there will be a dashboard so they can see how much money did they make renting their oracle we are also working on what we call cross-chain oracles so what is that is basically you had your oracle working on the exact sidechain and thanks to that you will be able to send the result not only to if your mainnet but also to sight change such as violence marching or polygon or whatever and probably something that was really asked by the community is that we will offer people a chance to to participate to the computation induced by the oracle factory
it means that anyone with a computer provided the fact that it has the sjx feature will be able to connect to a public worker pool and execute those stats and be rewarded for for the execution of the task as you can imagine there is a there are a couple of research issues around the oracles we are starting a new new collaboration with a new academic collaboration with a joint lab called the red chain lab it's a joint line between lyrics which is a computer science lab in lyon under you know university of lyon insa and cnrs and i exec of course it's led
by uh sonya ben mukhtar with research director at cnrs and we we are going to have four phds starting in this joint lab so two of them starting probably fall 2001 that are directly related to some research topic around the oracle topics one is about interoperability and scalability in blockchain so that's typically cross chain oracle and the second one about decentralized secret management service so it's basically all these secrets you are providing to the oracle factory how are we going to store them in a decentralized secure way and reliable way okay so to conclude this um this talk
the oracle factory scheduled to be launched in september we already have many many parts working there will be several marketing campaign that will promote this oracle factory in particular we'll organize contests we will organize developer rewards if you are interested in the project i really do encourage you to join the developer program there is a 1 million usd grant for you so it's all well framed basically you have bounties or grants for more ambitious projects so i really encourage you to have a look at that i also do encourage you to learn more about
ixec and to visit this website that is called the iid academy so the academy is a sort of content aggregator and you will find here tutorials use cases developer documentation etc so thank you very much [Laughter] no question thank you you take care of the ones up there
you