UMA 🛠️ Decentralize Your DAO with oSnap - John Shutt, Alex Gaines
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join John Shutt and Alex Gaines from UMA for a workshop titled "Decentralize Your DAO with oSnap". Welcome to back to ETHGlobal Waterloo, where it all began! Returning to Canada's tech hub, we're thrilled to bring together international enthusiasts and local talent for an unforgettable hackathon experience. This year we had 650+ attendees from 29 different countries and 47% were new to Web3! We concluded the weekend with 168 projects submitted and gave away $250,000+ in prizes ----------------- Follow us: https://twitter.com/ETHGlobal Check us out: https://ethglobal.com Email us at: hello@ethglobal.com
Transcript
foreign [Music] I know I'm competing with dinner right now so thank you all for being here um so I'm going to talk a little bit about Uma I know some of you have already heard the Spiel uh both at the booth and maybe at side parties so thanks for coming back again to hear a little bit more I'm going to talk about how Uma is a decentralized truth machine and what that means is you can bring any true fact about the world that's provable on Shane and then your smart contracts can use that to either allow or disallow transactions to use the data in whatever way that you need and I'll talk about a couple of different applications as well as what you could build at the hackathon so a lot of people have a misconception about oracles people just think like oh okay data feeds or Price feeds price data how do we set up a network of nodes that can deliver the data that we need with Uma you don't need a network of nodes you just need one person that's willing to say here is a true fact about the world and also here's a bunch of money if I'm wrong take my money that's the basic flow and that means that you have a really flexible architecture so you can ask questions that are really basic data things like what's the price of Bitcoin a typical Oracle question or you could ask natural language things like who won this election or did this deposit happen on this other blockchain or what's the result of this off-chain calculation that could be super complicated this like ZK circuit that you're calculating or did this governance proposal pass which is actually a use case that we're diving into right now around Dow governance which I'll spoil right now a little bit but get into later so yeah optimistic oracles the pattern is you enforce correctness after a dispute somebody's making this assertion they're putting a bunch of money at stake everybody's watching the Oracle for assertions coming through and if nobody challenges them within the challenge window the data is safe to use everybody had this big Financial incentive you had a long enough challenge window and 99 of the time proposals are correct for that reason disputes are actually rare and when we see disputes it is usually because either the proposer did make a mistake or the disputer made a mistake or there is some dispute about the wording of a question and I can talk about some examples or you could actually go to oracle.uma.xyz right now because we have some disputes that are in Flight that voting opens up later today we do refund gas for voting so if you get some Uma tokens you know five bucks worth you can go and become an Uma voter and you can spend that gas to vote and know that you're going to get it back as long as you vote correctly and that's probably the best way to learn how we resolve these things things that are around natural language wording human readable questions so here's what goes into it uh you could have somebody that's requesting some piece of data or a smart contract that's set up in advance to expect some piece of data you have somebody couldn't be anybody who's making a proposal and posts a bond that's required and then you could have anybody else that's a disputer posts a matching Bond if a dispute comes up you need a dispute resolution process so that's where Uma comes in you basically have this shelling point game where all the Uma stakers are committing a secret vote on chains you can't copy people's answers uh secret vote on chain can't just be lazy and copy people's answers you have to actually analyze the evidence and think what is the truth here because that's most likely to be the result then everybody reveals and you have your result it's also good to have a documented methodology of Truth so if you have some complicated question like you're running this whole protocol and you have to get a whole bunch of cross-chain data and run calculations in a specific way it's really important to let people know how to run those calculations make it predictable because without that proposers aren't going to risk money on making a proposal that might actually be disputed where there is some ambiguity of what the answer will be and then you need these economic guarantees that one disputers will show up and they're incentivized to show up and two that voters will show up and they'll resolve disputes and they'll actually vote and that it would cost way too much money to try to bribe the voters than to just arrive at the right answer this is kind of the flow I think that you can probably find these slides on our website or in previous things I'll figure out how to share it but it's a pretty simple workflow so asking a question post a bond along with an answer to the question if no one disputes great you know you have your answer after the challenge window maybe that's two hours maybe that's two days it depends on your use case if somebody does dispute that goes to the voting mechanism and it's kind of a Choose Your Own Adventure thing at that point some things like poly Market which uses us for prediction markets they wait until we get a final answer from our voting system and that's what they use other things like across which uses us for cross-chain bridging they actually throw away the disputed answer because they don't want to wait until it's all resolved it opens it up to new proposals then that somebody else proposes the correct answer so that their relayers get refunded faster so these are examples of real questions real use cases I talked about poly market and prediction markets were also really good for insurance so Sherlock and cozy both use us it's great because you can ask these natural language things where there's no clear data source of whether a smart contract was hacked or if some severe weather thing happened that you would have an insurance payout but you can ask the Oracle and we can provide that answer and some other things that are worth talking about we also have these interesting on-chain derivatives that you can do like shapeshift Dao used us for on-chain VC fundraising in a decent in a defined native way where instead of the VC is getting a discount on a token that they could then sell and make a profit even if the token price goes down what they bought was an on-chain instrument that has a boosted payout only if the token price goes up over the long term so it's kind of like an embedded call option uma's going to verify the fox token price and then based on that token price you're going to get a greater or lesser payout as the VC who bought this option so it's much more incentive aligned you're not going to have VCS dumping on you but the VCS get an increased upside if they get the good outcome that they're looking for and then something really cool if you're using Uma you can actually trigger events after you get a a result so you can say here's some question about something that's going to happen in the future and you can think about how polymarket uses this they're setting up betting markets around a basketball game or something the game hasn't happened obviously no one's going to actually trigger this with a proposal until the game is over but you can start using it to bet on it for days or weeks in advance and then once it's time somebody can come in and make a proposal and then when that happens that can flow to other contracts you can define a callback function that automatically some stuff happens after the value is settled and the function is called price settled don't get distracted by that it doesn't have to be a price it could be any kind of data so it's kind of like if this then that thing so you're waiting for some event in the future you get a proposal about that event that proposal is accepted as soon as that's settled you can just have all this other stuff that happens in this callback function that maybe automatically sends some tokens to somebody or it makes some change to a Smart contract whatever your workflow is and it actually makes your smart contract interactions much more autonomous because uma's system already incentivizes people to raise disputes and to settle things when uh you know it's actually settleable and then you don't actually have to do anything you're not like oh let's go and get this price you can Define this callback function atomically with the settlement it'll trigger the Callback and do some stuff in the rest of your smart contract system so definitely use this callback methodology if you're using Uma for your hack so yeah I mean this allows the real world to actually reach out and touch your smart contracts like some hurricane hit and you need to trigger some insurance payouts that contract could automatically send the funds to the people that are owed insurance they don't have to come back later and you know because it's it's happened and it's confirmed then they can claim it it can literally just send it to it as part of a callback function it makes it much more efficient so the way that you would try to attack Uma uh you can't actually buy or borrow enough tokens to influence voting yourself so this is the attack Factor you would try you would deploy a smart contract that's a bribe smart contract that says hey we're securing this contract that has five billion dollars in it we're gonna go steal the five billion dollars with some faulty Oracle data it's going to send the money to the smart contract and automatically divide it up between the co-conspirators and so the way we deal with that I you know I think anything up to like 50 60 million dollars that could be stolen like it's not like economically worth it to attempt a bribe attack given uma's Economic Security if it's a couple billion dollars it's worth trying but what you can do is you can have alternate resolution path where you're using Uma in all of its earlier game theory around proposals and disputes to make sure disputers show up but then once a dispute happens instead of waiting for the Uma vote and then using that Uma vote to move money maybe you jump to your protocols on chain governance system or some other kind of dispute resolution system or you just throw it away entirely and then all that umek is settling is the bonds and that's extremely economically secure like you could set a 50 weft Bond and it wouldn't make any difference nobody's going to be able to set up a bribe attack for 50 what so in that case like you know either you go to some alternate governance system or you just keep letting people propose and maybe it locks things up for a little bit and depending on what your contract system is doing you might make different trade-offs and across is a good example across is securing 40 million dollars and I think that a cross actually would be happy with using Uma for final settlement like that's within the range that it's safe but a cross doesn't want to lock things up for the entire Uma voting period they want their relayers to get refunded faster they don't want to get dosed through this thing so if a dispute comes through on a cross the disputed bundle of relayer refunds is just thrown away and somebody can propose a new one immediately and that gets things done a lot faster and then over the next few days uma's going to cycle through and you know settle bonds so it's a really good question um and then uh yeah talk to me later about Sovereign security which is kind of that alternate path which no one's used yet we baked it in for exactly that use case so this is how you make an assertion uh you can see all of the components here where you're kind of requesting data and providing data simultaneously but what's nice about this is you don't need to go find some third party to deliver your data for you you probably already know what the answer is in a lot of cases but you don't want people to have to trust you so this keeps it decentralized while also being efficient you're like I know that Oiler got hacked for instance so I can go to the insurance protocol and I say Oiler got hacked because you know I want to get paid out on my insurance but you don't have to trust me and the people that provided the insurance don't have to trust me it's up for the liveness window if I'm wrong take my money and so it still keeps it decentralized while letting you do all kinds of automated workflows that are cool uh so yeah I mean just running back all kinds of stuff um I think it's important to remember that this optimistic Oracle it's not just for delivering data because you have these callbacks you can use it to automate things that you want to have happen in response to something that happens somewhere else on chain or on a different chain or in the real world you know you're triggering Things based on almost anything as long as it's publicly verifiable and you can actually uh one interesting use case is build a collection of Undisputed facts on chain that you can use to build other things and we've had previous hackathon projects that were exploring that all this stuff this exists it's not hypothetical these are real things I'm going to focus a little bit on number three right now with optimistic governance because we're trying to solve a real problem for Dao's to keep them decentralized and autonomous so they can focus on just getting organized so this is a normal Dow governance flow you have a forum discussion and then people vote on Snapshot and then it kind of stops being a Dao and a multi-sig just decides whether or not to do it and so we're trying to solve that like you just like drop off and there's you know there's good reasons to use Snapshot though they're a trade-offs for on-chain voting I think the gas cost for uniswap voting which has delegated voting it's over three million dollars uh since they opened up governance even if you only had like and that's in the best case scenario where you do have delegated voting and you have like a large treasury that you're securing let's say that your treasury is one million dollars are you gonna spend three million dollars on gas to manage this one million dollar treasury you need to have gasless voting for the vast majority of things that human beings might want to organize around so uh we're trying to kill multi-cigs for Dows for the most part like multi-cigs are not the right tool for Dao vote execution your Dao is the multi-sig uh you can use our Oracle to verify basically this thing passed on Snapshot therefore I can execute it anyone can execute it and um in the future we'll probably set up Bots that just automatically propose and execute just watch snapshot and it's like hey this pass okay propose you know make it fully autonomous like that and the truth is economically incentivized and it's super easy to set up a huge number of these dials have this pattern where you have snapshot you have a safe with a bunch of your money in it and a multi-cig and you just don't want to use the multi-sig you can attach the Uma module which is audited by open Zeppelin and live in production with a bunch of people right now and then configure that with your snapshot space it'll take an afternoon maybe if you're doing it by yourself and taking your time with it or you could come talk to me at the booth and we'll do it in like five minutes um it's really really easy and this is the flow uh you know so you deploy your module you're setting the parameters and then it's kind of like normal you just go through snapshot you're creating your snapshot proposal the only difference is you can attach a specific transaction bundle and you're saying execute these transactions once this is done and then if it passes you're going to see a button in snapshot so like it makes it easy for anyone to just click the button to propose on chain after the challenge window if nobody disputed it click the button again and execute it and that's open for anybody to do you don't even have to be a down member you know it's just something that has been proven now through uma's system and you can also set your challenge Windows to be pretty long we've had dials that have implemented this to set the challenge window to like five days because they're not in any rush they don't need to move quickly the way that a cross is a protocol needs to do the Dow is like hey I'm gonna move five million dollars but really make sure that it's correct and they're okay with it happening days later and they have plenty of eyes on it so we're getting a lot of adoption early on in D5 which has been interesting to see I think part of that is because a bunch of these D5 protocols know us from back in the day when we were doing these more on-chain derivatives and exotic option type things so they know us and used us already see shape shift pop up again you know if they already did their VC fundraising round on chain using us it was kind of easy to sell but I think a big part of it too is D5 protocols really want to be decentralized and that's on principle you know like why did you get into this space because you want the centralization and you know that using this multi-sig is bad it's also a practical thing it feels very precarious to be a multi-sig signer especially in the United States and there's a lot of legal and Regulatory surface area there where it doesn't look good to be a multi-sig signer and even if that wasn't the case it's really inefficient and annoying and you don't feel like you're doing your job because if you want to get things done quickly people are just bugging you like hey John can you sign this transaction I'm not necessarily going to look through and analyz every transaction myself I'll be like okay yeah Hart said to sign the transaction the transaction is probably fine but that's not how it should be this way it's all being rigorously checked both through the voting process and afterwards by a lot of third-party people not just you as the signers and you don't need to chase down signers across time zones anyone can propose and execute I'm like the snapshot vote is done I've done this four dials I'm just like hey like you know excited for them like you're able to propose this now and then I'm like but I can too and so I just go and propose then on their behalf because anyone can um lossless is kind of interesting because that's a protection protocol where they had a tool where you're able to essentially reverse hacks where if you have tokens that were using earlier their special token contract it includes a freeze and transfer function and they were able to rescue a bunch of tokens that were stolen I think in the Ronin hack and they were looking to do that for things like wet where their old token model wouldn't really work and they were able to use osnap to bridge the results of their lossless token holders on whether to unfreeze or whether to transfer funds to a particular address based on some public evidence so that was kind of cool to see this integrated not just for your typical treasury management thing but for actual core protocol governance which is how they're using it for this new product they're rolling out and then plus company is neat because it's a very small Dow they don't have a lot of money and they're safe it's basically a network of creative agencies and they wanted to set up internal Dow for the 3000 something members of their agencies and they want all these people to vote but it's not about a lot of money if you're actually going to do this on on chain the style instantly becomes totally unviable like there's no point to do this you're going to spend so much on gas no one's going to vote this I think that they're using nft based voting and that's another neat thing about snapshot voting you could have voting power that's calculated all kinds of different ways you could consider three different tokens like the across Dow does they have their basic across token they also have staked across LP tokens and then they have the across success tokens and all of those things have voting power and snapshot which is easy to set up that would be a nightmare to set up on chain and if they wanted to give like nfts their community members and add some governance rights to those how are you going to do that in a smart contract it'd be absolutely terrible and if you only have a thousand dollars worth of ACX why are you even gonna vote at all this lets your Dow be more decentralized in the sense that your voters can actually vote you don't have to delegate everything you can actually be engaged as a small token holder which people want to do so this is you know this beautiful future of dial coordination yeah uh we got like a lot of tutorials um if you go to uh uma.xyz or docs.uma.
xyz you'll see some tutorials you can deploy a prediction Market or an insurance protocol or a bunch of other stuff uh within a pretty short time frame and even if you're not doing prediction markets or Insurance it'll walk you through all the steps of how Uma stuff works so your specific use case can be modified I know this was billed as a workshop but I'm mostly just like talking a lot with words but the thing about Uma is it's kind of a a cheat code where you can use words to govern what happens like write out a couple of sentences here's what I want to have happen here are the rules of this smart contract and so all you need to do to modify the tutorial is just change what the words say um so it's not as technical it's not a lot of smart contract work you can use the audited smart contracts as is just change your wording to your use case prizes uh so we have a really weirdly big first place of five thousand and then second place it drops down to two thousand but there's also a pool prize of three thousand that gets split between everybody that does some Uma or across stuff you can also do across stuff uh across as kind of a sister protocol that um a lot of the like Uma team members were working on initially and we split into two separate things but still kind of related so you know come talk to us about that too like cross chain bridging if any of your stuff is related to that there's a lot of cool things you can do especially around passing messages which some protocols have started to do it's a new feature added to a cross where you're not just sending tokens to some other chain you can also add a message that goes along with those tokens that could then trigger some stuff that happens on the other chain which has been under explored so far and reach out to us um you know we're always hiring we have a bunch of open positions if you don't see a position that looks right but you're really interested in this stuff please reach out we're also starting a community ambassador program too where I think we're going to start sending people to hackathons and things like this I think especially with osnap our optimistic governance thing that's much more um I don't know like it's more like a wide audience thing than the Oracle as Dev infrastructure so we want to reach out to a lot more people and we want to grow that community so uh come talk to us about that as well oh and our referral program is kind of interesting if you refer somebody to us you get paid with an on-chain option and our Oracle will verify how long this person stayed at the company so your option will pay out more based on how long they're staying so it's kind of similar to the success token thing you get like this boosted on-chain payout if this is a good candidate they make it to the interview stage okay boosted payout they get hired boosted pay out six months boosted payout and I think that we actually have time for Q a or if you all are diving into your hacks I know that the hackathon has just started this is the last talk right your last Workshop today okay any uh any other questions or thoughts on this ideas yeah probably yeah I mean depends where you are I guess um I mean we're not going to like tell you what your taxes are but it's like any other token thing but yeah you'll get some tokens I think it'd be like some Uma tokens at the end of the day and uh this is not tax advice but you wouldn't actually have anything until the expiry date of the options and so whatever Uma is worth at the time that you exercise it is probably the relevant thing but I'm really only familiar with the American context so it depends on where you're at yeah I'm just so I think there's a couple of aspects to it there's um there's a lot of conflict of interest of the insurance company that sold you the insurance also deciding whether or not you collect the insurance everybody kind of understands the game is you pay the insurance company money and then they try not to pay you and they'll find any way not to pay you and this takes it out of their hands and so there's a couple of ways to think about that one is you need to make it a lot simpler it needs to be publicly verifiable it's not based on specific things it's not like oh my sink leaked or something like there's no way for our Oracle to go and verify that this was like from your sink leaking you could have higher level stuff like oh the smart contract system was hacked that's like the active insurance thing that people use you could also do something like a custodial Risk insurance it's like I have a bunch of money in binance is binance going to walk withdrawals like I want insurance against withdrawals being frozen on finance that seems like that'd be really practical and you're not buying that insurance from binance obviously which is kind of like the way Insurance currently works like it's the person who wants to pay you the lease and it's not up to the person that deposited funds and the insurance pool either they're not voting on it this is going to a neutral third party Oracle whose whole incentive mechanism is built around finding the truth to whatever question it is and is receiving all kinds of questions um I mean potentially I guess like it's all happening Unchained with uma's stuff so if you add some funds that are off chain you'd probably convert it to usdc or something and then uh you know there are custodian like I'm imagining this whole like Enterprise stack of like normal insurance companies they probably go to like coinbase custody or someone to like hold it for them and then like put it into the smart contract that's controlled by Gooma and pay Consultants like some ludicrous amount of fees but yeah you should be able to do that like to the extent that companies can interact with the chain at all you know it's permissionless so then after you do that you could probably leave it open too for just random people to be like here's 20 more bucks for the insurance pool yeah okay yeah no that's perfect yeah I mean uh yeah let it if you check out our insurance um tutorial let me know if it like looks good yeah okay awesome cool nice
Automatic transcript — names and jargon may be misspelled.