Optimistic Schnorr Oracles 101: Unlock Verifiable Data | Robbie Kruszynski - Chronicle Labs
Ethereum Denver·Wed, Oct 9, 2024, 12:00 AM
While part of the Maker team, Chronicle invented the first Oracle on Ethereum for DAI. Many iterations later, Chronicle launched the 1st Optimistic Schnorr Oracle called Scribe, driving gas usage down 60%+ & enabling end-to-end verifiable data. This workshop will give you an overview of how to implement across chains, the crypto & RWA price feeds available, & how to pick up those lucrative bounties! APPLICATIONS FOR ETHDenver 2024: #YearOfTheSpork ARE OPEN APPLY NOW https://ethdenver.com/apply
Transcript
[Music] um number one thank you everyone for attending um this is fantastic uh ethen is just kicking off but already has great energy uh little introduction about myself my name is Robbie krusinski I'm part of the chronicle Labs team I'm the lead of dero there admittingly I joined about a month ago but it's been really fantastic and I'm going to give I mean in 15 minutes uh kind of a quick overview of what Chronicle is in terms of what we're providing uh why we're separate and why I think um we're really interesting for you to start exploring so why don't we start out with may I see a show of hands who is familiar with Chronicle okay fair so let's talk about the table of contents we're going to be talking about the introduction to Chronicle uh the current landscape of oracles why Chronicle uh deeper dive into what the chronicle architecture is and we'll ideally have some time for a remix demo so my next question is who here is familiar with maker ah yes so you might be thinking oh like you've never heard of Chronicle it must be some sort of new protocol Chronicle protocol is actually an oracle Sol uh Solution that's been exclusively securing the assets for makerd in its ecosystem since 2017 uh so actually um Chronicle was the first Oracle on ethereum and it was made for maker and so when it comes to us exclusively securing those assets since 2017 we've secured about 1010 billion right so Chronicle has been around for a very long time uh very very long time and only recently has it started to expand outside of maker in terms of what we're trying to do so I pulled this actually today if we look at defi Lama and we look at the uh the scope uh we can see that Chronicle is actually in the number two position uh when it comes to the uh the total value secured uh we're we're floating at I want to say uh 22% so yes um it is very real so let's talk about oracles today right uh as we could see on that left hand side we're just looking at Price feeds right so with current price feeds being provided a quick question I would ask all of you who are like developers or are curious in this how can you ensure the accuracy right number one how can you ensure it who are you trusting what Vision do you have when it comes to data availability what sort of data can you actually look at if you wanted to dive deeper with the asset pairings how would you go about doing this right that's a a question that I think a lot of us have maybe overlooked in terms of oh what's the data that I actually have you know available to me and if we go ahead and we look at that top right we've all seen those transaction fees we've seen the es and flows of how expensive that can be right oracles cost it's no there's no denying a considerable amount to operate gas cost to run oracles is certainly something that can can't be ignored gas prices as we've seen in the past can have massive fluctuations so what does this mean this means at a certain point it can be very difficult to uh maintain your project based on the the current gas prices so this boxes a lot of protocols out this boxes a lot of projects out unless you're able to eat those fees this becomes very difficult especially during you know tumultuous times in the space which we know will come and go as it normally does so why Chronicle right so our goal is to build infrastructure that allows the founding ethos of decentralization and transparency to actually flourish right we ensure the convenience but no longer at the cost of true decentralization or verification we are mission uh to develop frictionless decentralized and verifiable infrastructure for all onchain data Transmissions right so what do we focus on cost efficiency we we focus on scalability we focus on verifiable data we focus on the ability to Plug and Play because we know this is important for developers uh we focus on being decentralized and we focus on you know reputation and security this is something that we really take to heart this is our ethos and we we really uh have a lot of pride in terms of what we're trying to accomplish so let's go ahead and let's get under the hood again this is a 15minute talk so we're going to stay a little high level but I will be very available and happy to dig into this so when we talk about um our validators we have decentralized validators you'll hear me use the term validator and feeds these are um these are uh like we could transfer these terms so a validator is a feed when it comes to our nen claure right so Chronicle operates as a validator consensus model right Chronicle is powered by a decentralized group of validators known as feeds right so each validator is run by a renowned project and you might think oh who are your validators here are some examples so as you can see very reputable companies that most of us are using day-to-day what what's interesting about this o is because we are using these people uh or rather these companies the validators are also staking the reputation obviously we know in this space reputation is quite important and if you lose it it can be very difficult to regain this so it is in everyone's best interest to avoid acting you know maliciously and to ensure all of the data that is provided is as accurate as possible and Oracle has you know our oracles have you know a canical value which is obtained by a majority consensus of this Consortium of validators this essentially means that to trust the chronical Oracle it boils down to how much does one trust the ecosystem of the web 3 applications that we use every day and of course as the number of validators SL feeds grows the stronger this guarantee becomes so hopefully you can see this um the architecture at a very high level so the chronicle or Oracle protocol comprises of a distributed architecture spanning both onchain and offchain components right so the diagram highlights both of these components the offchain components depicted are going to be on the left side and those are going to be green and then the onchain components are going to be purple uh closer to my side so we're highlighting both the onchain and offchain components and so essentially what's happening is from the uh dashboard which we can see on the top left that's going to be feeding in and hopefully is this legible can can everyone read this fantastic great so what we're doing is you know we're pushing down to the archiver that's going to be going to the validator that's fetching information from the origin uh a quick note that the origins can be onchain or offchain such as a primary data source so they can exist on both sides um and so we're fetching that raw data that validator is taking that data and it's pushing it down to the relayer uh the relay is going to be collecting this data uh from the Val validators and creating a transaction that's going to occur on the evm we also have a challenger which is listening and verifying the optimistic uh updates to see if it needs to be challenged if there's a malicious um occurrence uh to ensure that all of the information is correct the relay and the Challenger are going to be then pushing onto the Oracle and then the validator uh is going to be giving a list of all of the allowed validators to the feed registry and then it's also going to be giving a list of the appropriate models for the Quorum uh and the validators into the watt registry so hopefully this makes sense again it is quite high level but I am trying to compress quite a bit in a short amount of time again I'm happy to continue this conversation uh but we are going to be discussing this workflow a little bit later on in the presentation so let's talk about scribe like what is scribe scribe is the name of a new type of Oracle architecture developed by the team at Chronicle Labs the design is built around five pillars it's built around scalability transparency access accessibility resilience and security scribe is an in an incredibly efficient our gas efficient Oracle based on aggregated schnor signatures right and so this is where it becomes really interesting is because we're using schnor when it comes to um you know our architecture so providing nearly constant or consistent gas costs on layer twos and layer ones scribe boast on fixed prices essentially leading to substantial savings over 60% l1s when it comes to uh competing oracles we are cheaper by 60% uh when it comes to layer twos about 68% cheaper when it comes to some of our biggest um competitors we are about 80% uh cheaper than some other oracles that may have uh dominance in the space so this approach to gas management significantly boosts the scalability of our Oracle so let's first take a look at the landscape prescribe for just a moment so prior describ architecturally all blockchain oracles use the Standalone implementation of an elliptic curve digital signature algorithm e ecdsa to the general public I'm sorry to generate public keys to cryptographically authenticate the identity of the signer or the validator and therefore the Integrity of the reported data the more signers or the validators that an or Oracle protocol has the more it would cost the Oracle Builder or the operator to update to the latest report data of that Oracle right makes sense um this is because every signer or validator must individually sign the message to attest its Integrity but this ultimately means that those looking to utilize oracles have to consider the pros and cons when it comes to the importance of cost speed and decentralization generally one of those things is going to fall back a bit if you focus on two other ones if you really care about decentralization and speed it will probably be more expensive if you really want it to be cheap and fast probably won't be that decentralized right so there's a bit of a conundrum one is always going to fall a little shorter if you are focusing on the two but now we can talk about scribe so scribe has kept accessibility in mind while being designed this was something that was very top of mind while our incredible Engineers were working on it right the I chronical interface is a plug andplay for protocols that are already using let's say chain link or oracles to Simply swap out the contract addresses and you're already Off to the Races right so we make it very easy for developers to start to experiment with uh what we're providing at Chronicle Chronicles endtoend verif uh verifiability ensures let's say defi I bring this up because defi of course is right now a big driver when it comes to adoption it's top of mind for everybody so this is why I bring this example up it enables defi daps with liquidation functionality to offer unrivaled transparency right this is really attractive for the Builder and for the user who doesn't want transparency right but there are many examples of poorly designed blockchain oracles reporting inaccurate prices or Price data rather which then has led to illegitimate liquidation of users in dii projects right and this is very difficult right this is really difficult to swallow but it is a reality um so there's never a question of whether the chronicle Oracle was operating as intended every aspect of any reported data is verifiable on our onchain dashboard and is legible to all blockchain users regardless of their expertise and we're going to see an example of this on the next slide and hopefully we'll have some time and we'll be able to uh see this in real time so what you're seeing is a a a gift that I've made but what we're doing is we're looking at our dashboard and we're looking at a collection of uh e USD that uh that data feed and we're looking at our validators and so what we've done is I've picked one of the validators and I'm looking at the the the ability to look at the Raw data so everyone has the ability to look at the raw data and you can verify that the data is accurate so you can see that data and verify it in browser literally with a click of a button you can see the clip that I've done I've changed the Tim stamp upon trying to verify at right here you can see on that second line and it errors out so this is accessibility for users being able to look at the raw data themselves it's something that we really pride ourselves on to ensure full transparency right so now let's talk about scalability with the help of schnor right so scalability is very important right it's it's really everything when it comes to our space not just with oracles but in general we really have to think about scalability so optimistic schnor signature aggregation unlocks 66% of gas improvements as I mentioned earlier this is tremendous right this can't be ignored this is a substantial amount of savings so what does that mean so now we're looking at our optimistic schnore right so a snore signature is an algorithmic scheme similar to let's say BLS right which snor you can verify on chain in more effective manner as opposed to BLS at least right now so schnor is actually quite attractive to to build with and that's why Chronicle has chosen this right so validators sign and create an aggregated signature you have one signature and one validator and the signing of the correct the correctiv of that signature then we have a relay which is a permissionless function right so you know you it pushes the Oracle update payload which includes the Snore signature ecdsa sign the validator performed as mentioned one click above the data which is going to be the payload I.E the price and the timestamp the Oracle smart contract verifies the relayer passing the signature that corresponds to the payload the ecdsa signature and the signer is the validator and the time stamp is recent so what's really interesting is what we've done here is you know we verify the Rel layers passing that signature that corresponds to the payload the signer of the signature is the validator and the time stamp is recent and then what happens is we now have a price and that price is going to be the optimistic price what's interesting is we don't verif we all we do is we verify one ecdsa signature we do not prove the Snore signature we don't do this because again we are trying to keep the gas prices low so what we do have is we have an optimistic model that has a challenge period which is a function that could be called to verify the schnor signature so if you run the challenge sucess successfully I.E you catch something that is being malicious that validator has proven to be faulty so they're immediately booted and they're no longer a validator so now what happens is we drop the optimistic price and the Challenger due to proving this negative act by the corrupt validator then claims the eth that was inside of the Oracle contract as a reward so this creates an incentive to help ensure the validity of all of the data that's happening so what does this do this ultimately um this architecture ultimately provides again on L1 gas Improvement by 60 plus perc on L2 Improvement by 68 plus per while while providing transparency decentralization accuracy and security so if anyone has a computer and they're curious we're going to try to run this it's a very simple example uh it's a remix example of essentially an oracle reader I'll give a second to for you guys to uh to scan it what it's going to do is it's going to take you to our docs you just go to the tutorial you go to remix and then you could see the contract there but what we're going to try to do is we're going to try to do this oh man this is all backwards bear with me I'm sorry okay so here's our contract and so it h i can't see it shoot uh we'll figure it out so here's our contract and so now what we're going to do is we are going to go ahead and we're going to compile our contract oh jeez I really can't see let me sorry one second we uh are going to compile our contract and uh now that we've compiled our contract we are going to go ahead and we are going to head over to uh deploy and what we have to do is we have to ensure that we're on the right Network this has been hardcoded to uh test sapoia and so now we are just going to wait for this uh account to pop up and so what we what we're doing is essentially we're going to be able to fetch uh the um current price of ethereum oh forgive me so uh what I know what I didn't do is I did not set the correct contract so we are going to go to our Oracle reader there we go and now we're going to go ahead and deploy it and so really uh as we could see there's not very much code in order to do this in fact there are more lines of comment events than there are codes but what we're doing is we have our kisser we have our eye Chronicle contract uh we have hardcoded this to the uh test net just for the sake of the example and we are going to be able to read once this deploys and it looks like it is working on deployment right now yeah we're pending so once this deploys we're going to be able to see a couple things we're going to see the chronicle contract pop up so we're going to we should be able to see this address and then we're going to see our kisser address which is going to be here and then we're going to be able to read so if we go down here there we go so we can go ahead and we can click on Chronicle and this of course is going to give us that address as we were expecting and we can go ahead and we can click on our kisser that's going to give us that address as expected there we go and so now we are doing a read and so we can see right here that we've already fetched the data and we can already see the time as well because if we look look at uh this function and forgive me I can't see so well I believe it's right here we can see we have an unsigned integer giving us the value and an unsigned integer giving us the age and the the the team at Chronicle has done an excellent job uh when it comes to documenting and creating really fantastic comments uh when it comes to all the functions to walk everybody through everything if there is any curiosity um so I do encourage you to look at our documentation and especially look at our so again this is a very simple contract but it does show you like how easily you could just start to spin up also when it comes to our tutorials uh we have kind of cooked in um something quite similar to this into scaffold e 2 so if you are curious to play around with this we've done a the env. example we've put a couple things in there and then we also have a contract cooked in under hard hat so all you have to do is switch networks and you should be able to deploy create the front and you're you know you're off to go you're Off to the Races so if if we head back to oh and here's an example of the dashboard so let's go ahead and let's just click on um oh I don't know um any well actually we could click on uh validators and so now if we look at our validators we can look at their last update and we can essentially look at any information we want to and so we can look at the pairings in which anyone is you know uh verifying any information but if we wanted to like look at um let's say uh eth to USD so we can go ahead and we can see uh that we have the ability to verify let's go ahead and let's verify with infura and so if we go ahead and click this we can see that it's taking the medium price uh across all of our validators and it's showing us the raw data right here and so now if we go ahead and we just verify we can go ahead and we could see that that's correct if we make any adjustments to this which you can in browser In The Raw then it would error out as was demonstrated earlier but I think that's um really powerful that you could do that in browser and very quickly um see and experiment with yourself um so I do want to be mindful of time because I think I'm just about done if you want to get in touch with me specifically uh there is um a QR to my Twitter otherwise it's just Robbie K but more importantly uh get in touch with us the team uh the team's going to be coming later this week uh there are going to be two codes down here on the left hand side uh you are going to see our hackathon details so if you're curious about this I suggest you give that a scan uh we've got some you know we're looking for Innovation uh we're looking for really interesting projects and we've got a lot of things documented there and then on the right hand side it's just going to be leading to our website which very easily you can go into the documentation or you can go to the community element of it and I would suggest everyone join our Discord we're very active in there and uh we you know obviously want to uh nurture curiosity so we want to continue to you know develop the the product that we're building and with the assistance of everyone that's curious obviously we want to ensure that we're listening to the people that are using our product and we're you know implementing that into our future development so uh I just want to say thank you everyone for attending thank you everyone at eth Denver for putting this together I know it's a huge Endeavor especially with the amount of people and specifically thank you so much for chronicle for giving me the opportunity to represent the team and for giving me a try and with that thank you everybody
Automatic transcript — names and jargon may be misspelled.