Witnet a multichain oracle for a multichain future Adán Sánchez; Tomás Ruiz
Ethereum Denver·Sun, Oct 9, 2022, 12:00 AM
Transcript
uh hello everyone uh basically uh we are adam and antomas and we today we will be talking about the general problem of the oracle what's the oracle problem is uh what is witnessed and how is trying to solve this problem uh how you can use witness especially for those who are participating in the hackathon and then an overview of what are we currently doing in witness and what are the next steps for the projects uh well it's 2010 almost everyone here has already know what already knows what's the oracle problem um you if you don't know and most probably will be here something because there's a lot of marketing around this problem and around this topic but there is no unique solution for the oracle problem problem there are different approaches and there are different protocols that are trying to solve it and there are also different use cases for it uh but we can sum up the what the oracle program problem is because the smart contracts are deterministic as all of us know but the internet is not so if a smart contracts need to retrieve information from the common web from any data that is in your favorite search engine uh you can not put it on your smart contract because you will be breaking the damper and the sourcing resistance nature of the smart contracts so the key here is that we have to build determinism without fault in this in centralization and what is a decentralized oracle network when we talk about decentralized oracle networks we say that they are decentralized because they provide the damper and censorship resistance uh there's an oracle which is an entity that can relay the information and provides the determination of the of the data and then there is a network because there are a bunch of nodes that can be randomly selected to resolve data requests and they will act as a committee as an oracle committee so the decentralized oracle networks are all about splitting the power as to mitigate the trust and avoid fall in a single point of failure and now then can explain what's the what's with net and the over in the overview of whitnet we even have this this is awesome i can feel like a preacher so when we when we talk oracles uh it's all about data integrity at the end of the day it boils down to data integrity how i can fit data into my smart contract with full guarantee that it's not being tampered with so essentially the solution that we are trying to give with uh witness is it's powered by crowd witnessing crowd witnessing is the idea of having multiple actors witness are attest uh some some fact and then uh using some mechanism uh have that proof that they all agreed uh that the facts were what they were so essentially with not what it tries to do is to choose committees based on cryptographic sortation so that means that they will be selected secretly and totally randomly and we uh with with this mechanism and this construct which is very similar to a shelling point uh scheme which means that uh you are incentivizing people to give or to agree on a common response because that's the more the most profitable uh thing that they can do we call that integrity by consensus we are essentially saying hey uh if you report the same as the rest of the notes are reporting you you will get a reward and if you report something that is different you will get slashed you are familiar with that concept it's very similar uh to how proof of of a stake uh builds consensus around the the chain so um to prevent free loading on that we have a commitment and reveal scheme in place essentially uh when the witnesses the nodes in the network are selected to to resolve the oracle queries they essentially will be fetching the data and reporting that data secretly and then after the fact they will be revealing what the data was and their own identity and everything and that it's what actually enables that uh slashing otherwise they could be copying each other or there could be issues with a less revealer issue you know in which uh the one the last one to reveal will copy the results from the from the rest of the of the witnesses and they will not perform the actual retrieval job uh so um when you are trying to do this crowd at the station this crowd witnessing obviously you are having multiple notes uh performing the same task the same job at the same time of going to this api this other api i'm fetching that and so on and then you need to aggregate or to reduce that down to a single data point in some in some way uh so that's that's another thing that widnet tries to solve and another issue there is about node indistinguishability uh when we uh look at an oracle like uh witness that is let's say a leecher oracle because he's trying to read from existing apis and to free write from from from those um you you have the issue that the data sources that the api providers themselves could be feeding different information to each of the of the nodes that's then the determination that uh thomas explained before and you need to make sure that um when when these notes that are acting as oracles and the witnesses um when they fetch the information from the apis they need to make sure that they are not fed uh something different that they are not being targeted essentially so that's that's also uh one thing that whitnet solves so when designing with net we started in 2017 we published the white paper in november that year and we started building it next in the next year um we had very clear three clearly three goals in mind like three important design decisions one was uh let's say includes inclusivity uh you have very low barriers to entry so it was important for that mechanism of credit station that um there was a very low uh barrier entry to start operating notes and to become part of this network that attest information in behalf of smart contracts uh so the low there are very low hardware requirements to to run in notes on on with that i mean because it's a totally uh permissionless network and anyone can join and act as an as an oracle and then uh there's this thing uh in place called the reputation system that actually guarantees uh that uh essentially no one can come and bring a lot of notes and perform a civil attack essentially uh that's also income in combination with with stakes and so on uh then another principle for designing this oracle was parametrization so making sure that we could accommodate very different use cases um when you're looking at maybe people that need random number generation or they need to perform um like retrieval of price points for an automated market maker or whatever they really have very different trade-offs and they will uh they have different needs in terms of security latency whatever uh so we really needed to make sure that everything can be customized so you can customize the size of the committee like how many numbers how many witnesses how many nodes in the network will be performing this retrieval of data uh then you can also choose like the quorum um what's the minimum percentage of consensus between those witnesses also you can decide the rewards and the fees that will be uh used as the rewards for the for their witnesses also you have this uh collateral thing that essentially is the amount of uh of tokens that uh the witnesses will be losing if they misbehave or they misreport or they fail to reveal and so on um and then this this is the most interesting part is that the data requests in weednet the oracle queries themselves are explicit on how to retrieve aggregates and come to consensus about the data that essentially means that it's not like i want to know the price of by of bitcoin it's it's it's it's it's actually and explicitly saying go to disappear to the coinbase api and fetch the price of bitcoin right there and you will uh take this exact data point from within the json response and then go to this to this other api and take their results and fetch this and multiply that by 10 000 because we don't have floats on solidity just yet and so on and then it's explicit on how to aggregate from the multiple data sources and one that you get that reported with the commit and reveal thing uh from multiple nodes it's also explicit on how to aggregate from multiple nodes which normally if you're talking about prices uh you you what you do is like removing outliers so that you have a function that says uh you need to remove anything that is 1.5 times the standard deviation far off from the average and then i wanted the average but you can customize that as well you can use the mode the median whatever static statistic function that makes sense for your for your use case because if you are retrieving for example the weather you cannot do average but rather a medium between cloudy sorry not a medium but the mode between cloudy sunny whatever so all of that definition of of the of these functions is done with a javascript based uh dsl called radon and essentially it's uh it's it works inside truffles it's a truffle box a truffle plugin and which you can very easily write the data requests using javascript so it really feels natural when fetching data from json apis for example and then uh this this plugin actually incorporates a little compiler that turns that into witness bad code and wraps that into a solidity contract so that from the perspective of ethereum developer you only have to import that contract instantiate it and just call a function every time that you want to get that data reported uh so the life cycle of a request goes exactly like that you uh you have the bike of their request that's sent to to witness uh that then there will be uh the witnesses elected by a verified random faction which is what uh witness uses for these random certification for selecting the witnesses randomly and secretly and then uh you have the reputation proof of eligibility in place for that so as to weights more than notes that are more reliable um so so that you can have some guarantees there as well and then they will be committing and and revealing sorry for that it's serious thing i know it's not very popular popular around but we come from europe sorry uh you have the last step which is the tally which is uh essentially applying the final reduction uh function that will get you uh the the final result that gets reported on on ethereum or whatever chain you are on so um as you have multiple witnesses performing this computation at the same time you essentially can have multiple data sources retrieved by by multiple nodes and then they do the commit and reveal thing you get the tally and that's pretty much all normally that happens in four minutes around four minutes in with the current network parameters and now it's how to use it yeah basically we have three different ways to use a witness basically where the witness foundation is sponsoring some data feeds that some projects has asked for and there are leave on different chains as we are a layer one solution we need a bridge for those platforms and currently we are building more integrations every week every month so we are building more or less two integrations per month and currently we have live on ethereum confluence boba harmony and we are expecting to have more integrations for example on arbitron avalanche and next next month and all of these data feeds are compatible with the erc 2362 which means that are compatible with the standard proposed by the alliance of the centralized oracles and anyone can start using it just consuming the the contract and the second one uh if you don't want to trust the witness foundation which it will be the ideal case you can create your data requests by your own and you can directly create it with different javascript libraries that we have created and you can just compose a data request with the with that dsl we have or you can even create a data request using a seca editor the second data request editor where you can easily create a data request just as clicking uh some boxes and choosing or the parameters that you have all the filters that you want to apply all the different parameters to configure a data request and the third way you can consume witness is through the random number generator this is a capability that we include in the in the network a few months ago and they have exactly the same abstractor than regular data requests and they are solved by the same witnesses so you can specify the same amount for any data request and it will work and this is um a need for different nfts and gaming projects that approach us and we have as a showcase we have been using this random number generator for the witty creatures at liscon or for wikipedi in in this conference and what's what's next for for whitnet basically uh we want to continue expanding with net and using the different uh well and continue working with other projects and for that we want to we need to be known and for and we are running an ambassadors program so anyone can start joining and we will be rewarded then we also have a grant program so anyone can apply for it and we will help them and sponsor the work if they need to use the witness the witness network and we are trying to focus on foster adoption as i have said before there are different oracles uh there's much of a lot of marketing around and we want to be also known and be unexplained clearly what with that is and the main goal that we have a that we have to approach are to build to other chains currently we are only focused on evm compatible chains because we built a a bridge to ethereum and the easiest thing right now is build other bridges to other vm compatible but we have in the pipeline to start building two to other non-vm compatibles in a near future and we are also improving the protocol we have some proposals some with net improvement proposals to the network that we have in we have received and we are implementing and deliver and then the network accept them and finally we are not completely comfortable with the bridge that we currently have we want to work in a much less expensive bridge and we want to start working on optimistic bridge and for this conference we also have bounties we have 2000 for the most impressive uh project that implements a witness also a 1500 to the most creative use of witness and also prices for anyone who use the data feeds that we could only have or even the randomness usage and if you create a project that doesn't fit in any of these categories you can also apply for the witness for the witness bounties and we will be happy to have you implement with net for your for your project and finally and we have created a game for for at this conference it's with the buffalo where there will be six different branches and it's a social game to generate the incentives for people to talk during the conference and if we come to the booth that we have in the fourth floor in the first floor we will be so happy to help you and to show you the game and start playing so i think i don't know if we have some time for some questions
Automatic transcript — names and jargon may be misspelled.