DappCon 2023: Oracles: The Next Generation - Pawel Zaremba
DappCon 2023 · September 2023 · 25:35
At DappCon 2023, Pawel Zaremba presents a talk titled 'Oracles: The Next Generation,' part of the event's developer track. Blockchain oracles are services that supply smart contracts with external, off-chain data such as asset prices or real-world events.
Speakers
Topics
From DappCon 2023, hosted by Dappcon Berlin.
Transcript
hello hello dcon Vates I don't speak German don't worry uh I was wondering how you guys are because it's an early hour and uh I had trouble waking up have you already scanned this code because like Everyone likes scanning QR codes so I I do I hope you already scanned it uh if you didn't I'll tell you later what that is if you did uh have fun with it anyway my name is pav I will be talking about oracles uh Chronicle oracles to be more precise because I work for chronicle uh and we are building oracles uh this is going to be a very nerdy look at what we are doing uh I like walking
on the stage so I'm sorry to the camera you need to catch me uh anyway so what are oracles and my definition of oracles is that they are turning gossip what what everyone says what someone says what's the weather how many people came to dcon and uh whatever else you can think of they turn the gossip into fact and uh it is very important to make sure that the fact that you uh use is correct for you uh what we have in our system is we have a set of feeds that
uh see the information offchain and by offchain I mean of the exact chain that you are on and that your project is on because everything outside this blockchain has different assumptions different security and everything that is on a different chain than your project is actually offchain so feeds see that and then oracles remember and how do we choose people how do we choose the feeds that give us this information it is reputation reputation this trustless world is a meme we need to trust someone you can
either trust uh a centralized Bank you can you you need to trust the developers that they did everything okay and then when you have someone putting the data on chain you also need to trust them uh but there are ways to uh lower the bar or or raise the bar on on this trust so there are ways to mitigate this problem of trust uh and we are using most of them so there are many reputable projects that serve as feeds for chronical oracles and as you can see uh there there's maker there's nosis
there's all of all of those are very reputable they have great reputation until something bad happens uh we are very glad to work with them and we do not trust any single one of them that's the thing never trust a single entity and uh you'll be better off so what do oracles do actually under the hood the feed takes the data from offchain from the world from exchanges from I don't know where like weather reports they collect this data they process it somehow and
they sign it that's the best way uh to verify that the only the allowed feed has signed the the message and the data and then they need to store it on chain without storing it on chain chain it is really harder to to use this uh data because chains are blind we are using multiple data models for different things uh of course most of them are uh prices and as you can see we have SIMPLE data models for the Legacy coin as you can see here and we have more complex uh data models that
use many level s of uh of data data points together with that there's Origins we Define Origins as the actual place the feeds are taking the data from so you have for example binance but you can also have onchain uh sources for uh for the prices or whatever else is already stored so we are utilizing in both offchain and onchain data but still that all of that gets collected offchain processed on chain signed by verified parties and
then sent to a peer-to-peer Network it's not even to us we are not running the the the the end part of this process it's just they are sending uh it publicly to a peer-to-peer Network and uh anyone can permissionless use it this is the first version of oracles uh that we created it was every feed was collecting signing and putting data on uh on chain that thing is that it was good when gas was cheap right now no not so much so we had we developed a version two uh of this feeds collect the data
they sign it separately they send it to a peer-to-peer Network and someone else collects it permissionless and stores it on chain it's really very simple and uh you can easily listen to this network this all of this traffic and do it yourself and we have been doing that since uh 2017 for maker Dow because we are we were part of maker Dow and we are spinning out so we do know what we are doing and there's another thing do not trust verify uh we have prepared a dashboard where you can look at any
message through all of the time that uh this these oracles were operational and you can take and actually uh verify this message yourself so when uh even you if you can see here uh when you change something and uh press the verify button the the screen goes red because it's not all not anymore the same data that was signed and this is the QR code for the chronicle dashboard I should have put the address here uh like written in normal text it's uh Chronicle protocol.
org dasboard I hope and as I am a nerd you now know that my reputation is not from Gossip my reputation is fact it's solid this is from a firly TV show that got cancelled way too early uh and this is one of the bad guys but he is right a reputation doesn't like shouldn't come from Gossip the next generation of course live long and prosper uh what we are doing right now is we are we have developed a new version of the oracles uh better faster
cheaper and our goals were to implement the same code on all of the chains it needs to be the same because it's verified uh it's uh got audited and it's going uh it's easier to manage and then when Every Chain has the same code it's more or less works the same except for some particular properties of a specific chain but apart from that we managed to uh have a single implementation for all of the chains the second goal that we had was we wanted to decouple the Oracle updates from the number of feeds that are uh in this message right now what we
have we have a bar of 13 feeds that are 13 signed messages that that are required to make an update to an oracle out of 22 we take the majority uh so it's a more than half consensus and they anyone can permissionless take that and put it on chain the contract verifies the signatures the contract verifies everything but the more feeds we have the more signatures we have in the normal operation we would have uh the C the the gas cost go up we don't want that and there's a third goal we
wanted to minimize the Oracle gas cost like even independently of keeping it separate from uh the number of feeds and of course the more feeds and the more signatures we can verify in a transaction that is not too expensive the more secure the data is because theoretically more people would need to collude to make this uh a fake message so enter Chronicles scribe we have developed a new version of the oracles V3 sometimes it's sometimes called and it uses schnore signatures schnore signatures are the ones being used in Bitcoin for quite a while and it's working quite quite well and our
development team went through all of the science and all of the documents that are describing different uh signatur uh and different signature schemes to to find something that will work for us and will be a and that we will be able to implement uh on chain in solidity uh using the existing precompiled the existing code that is already there so there's snor signatures there are optimistic updates and there's a challenge Bounty for uh for a time where Uh something's wrong with the optimistic update and now how does that work so normally
as I said we have multiple signatures we we have three feeds you needed three signatures and then that goes into the contract you need to verify every sign signature separately that's costly easy recover is expensive and then the signature aggregation that we have is that uh there's some magical math happening okay not magical there's math happening in it sums uh the signatures and then has a single signatures at the end that the contract can verify uh which is way cheaper and then this approach is best for where uh a chain has cheap compute and expensive call data because with
schnor uh signatures as we have done it the call data with the number of feeds uh being more and more in a in a transaction the C data only grows slightly so we can we can scale it uh really really well uh so l2s will be and are using uh this schnore aggregation and then we have a optimistic update what's it about you ask so we calculate the schnore signature as before on chain offchain uh but we are not executing the transaction that verifies that immediately we have one of the feeds
uh verify that okay everything's fine and vouch for it so that's the blue signature here and the contract verifies only one signature why only one signature I explain later so it's cheap and it's really fine because uh when you have expensive compute and data on a chain it is really really driving the gas cost uh lower yeah what happen happens when someone's lies so there's a malicious actor and they have an improper uh signature and send it but they vouch that it is proper what will happen well someone can come and challenge this and
someone says no no no no no wait you're not going to be doing that what they do they provide uh uh another check so they execute a transaction on the contract it checks for the validity of this uh of the signature it's not valid what happens the data provider gets banned that's one penalty for them but also the wonderful person uh or people that uh did this um save get some money and here comes the best part we have experienced a gas cost Improvement of
66% which is enormous for example the the cheapest transactions that we had was uh 60 over a little bit over 60,000 gas the theoretical minimum of a transaction for E transfer is 21k and 66 is just like three times more so it's really really cheap why is it important that it needs to be cheap so if you're paying for it you need it to be cheap both your users if they are paying for it uh it will be cheaper for them and you your project it will be cheaper for
you so the great announcement we are launching exactly today our teams are working around the clock and around the world to be spinning up new schnore signature uh schemes and new servers with schnor with which are doing the schnor uh signature ceremony uh because it's a cool ceremony if I have time I can explain it to you uh and today is exactly the day for our lunch like I wasn't expecting to be presenting uh the very this very day but yeah I am really glad so we are lunching and what you can do you can actually get in touch with us uh and see what's going on so this these
are all our addresses there's no QR code for that but uh uh you are very welcome to to get in touch and uh of course uh I needed to do that it's oracles the next Generations and we are on I see have I have some time so I would like to use this time for to express enormous gratitude to the organizers of this conference I know firsthand how hard it is to organize a conference so what I am proposing is that we uh bring our hands together to thank the organizers so thank the organizers with me thank you thank you to the MC thank
you to the uh to the organizers to the venue I love the stage as you can see uh and I remember uh I can talk whatever I want right uh so I remember at it wor so we had a problem with the projector we needed to switch the projector in between presentations which is very hard so I really really know how painful it is to organize such a conference and I fortunately I had the time to do a uh standup freestyle standup which helped me actually prepare for the presentations which was next then next presentation was mine anyway what I would like to tell you uh when I have this time is about how the schnore works
underneath like how the ceremony works so let's go back to uh to the uh where is it this is it so the the ceremony for creating aor signature uh has at least two parts the first round is every feed every data provider needs to commit to a nons to a to a random number that everyone agrees on uh and when they all uh send their uh sign signature of this random number then uh we can start the second phase the actual signing the math underneath
is interesting that uh both the commitments and the signatures uh are get summed uh to to create the signature and these are the mathematical properties of the signatures that the sum can be actually quite easily verified uh so this is quite a lot of work and we have a peer-to-peer Network we are using lip P2P which is used by ethereum uh and many other uh reputable projects Li P2P is a a spin out of ipfs which I hope you know and uh we have great plans for Oracles in general because everyone will
need oracles if you have a bridge a bridge needs an oracle or is an oracle in itself uh if you like there are many many names for oracles uh but if you spot a pattern where something happens offchain or on a different chain than yours and someone puts this data uh on your chain for you to use then it's an Oracle and that's it I love how uh developers software developers in particular they we have you've seen the meeme probably we have 14 standards and then okay let's do a single single standard for all and we now we have 15 standards of whatever anyone can think
of so uh those names for oracles then those new names are still uh oracles underneath and yeah uh I think what I uh would really like you guys to do is go no where is the dashboard go to the dashboard that I showed you the QR code for because that's the best place to see what we are doing this is the best place to verify uh that the values and the the parameters that we have said are correct and we are planning for much more I will not be divulging everything right now but uh I do hope uh to see uh a lot of
more a lot of more of a Chronicle in the verse So yeah thank you very much thank you to the organizers thank you to the audience thank you to the internet uh and uh yeah I hope to hear from you and to see how you like our oracles thank you P great presentation also thanks for the insights about itasa um we do have some time for questions uh if there are any questions in the audience if there are no questions I will be talking for the next five minutes is that is it okay it's totally
fine maybe one question uh since you obviously an oracle veteran what are some of the um underexplored use cases for oracles which you're personally excited or which perhaps are now enabled also by the Next Generation I would like to see oracles used for normal things for normal people it's like defi is fine okay we probably it it defi will probably the uh underlying layer and the underlying infrastructure of uh of like everyday banking but still we need something more we need this to be interesting and valuable for uh for more people wherever important data is uh uh like verifiable data is important these
are the places where uh this could be used I do hope governments will be using that I do hope that private companies and like sending uh verified information yes news news is terrible this these days like if you have uh a a newspaper or whatever P portal that is funded by advertising then there is no way that you can trust it to not be pushing someone's agenda and then when you have reputable projects reputable websites uh they don't have a way to prove to you that uh this information came from them and then this is a whole
mess I would really really love to see every HTTP request and response be signed this is expensive on the compute right now but if we for example implemented an engins or whatever Apache server that had the signature of the content uh inside the heads this would be really really great then everyone would be a ble to be a feed a ver verifiable feed uh that is really hard because as I said the compute is expensive but I do hope we'll see that in the future in terms of fake news definitely relevant yeah um any there's a
question hi uh thanks does chronicle make sense when there's only a single data source so in your presentations there were multiple data feeds does it make sense if there's just one uh kind of source source of truth and the second uh question is maybe could you go go into a bit more detail about how you use Li P2P um that was interesting as well or Chronicle makes sense always that's the thing even if there is only one data source it is actually not our place to say that this is bad it is on the users the people that are the projects that are using this data that have to take that into account okay this model we are making those models public we can you
can verify it uh manually so uh it does make sense if it makes sense for uh a customer uh there are some cases that we need to have that because there are no other uh sources of data but if your projects take take that into account that's fine and the second one for Li P2P so every node that we build and and we give that to the feeds to run we are not running that ourselves uh that's another story how hard it is to deploy it to those 22 feets so every every node and every application actually creates a p a li
P2P server and This Server uh is communic communicating gossiping messages around gossiping yeah I know I said gossip is bad but it's gossiping signed messages so there are for ing relaying doing whatever we want so the beauty of lip P2P is that the bigger the network the more uh participants of the network the stronger it gets uh and I really love this this uh property of lip P2P so we are using it on a very low level and we are still tweaking uh things quite a lot to make it faster better and more reliable that's very important for us it needs to
be reliable it needs to be secure and we have a way of actually separating the lip2p code from the private Keys uh you could use a ledger but that would be a nightmare to uh to operate but if you have something a hardware wallet you can actually use that uh separately on a separate machine there are some ideas to to to I know separate even more but that's another story thank you thank you P um once again thank you very much