Economic analysis of private defi
ETHCC 5 · July 2022 · 25:55
Anish Mohammed examines the economics of private DeFi. The speaker discusses protecting trading information, reducing exposure to MEV and the marginal costs of identity and transaction privacy across different layers.
Speakers
Topics
From ETHCC 5, hosted by Ethereum France.
Transcript
this is going to be like a halfway talk between the talks that were previous to this and the next ones so uh everybody knows what d5 is uh the objective of the talk is to look at privacy and what really means in terms of economic implications to d5 as such so if you were to look at d5 stack there have been a bunch of people who have been classifying things and if you look carefully you could see typically it gets over here i don't know if you could hear me it's over there and i don't think that's the only place where you can actually have the privacy for d5 and i don't think that probably might not be the optimal place for that to exist
so the talk i'm going to describe like you know at least in my head how i see privacy and how that you know how you could actually see two words one with privacy and what we thought privacy and if you were to run two sets of uh machine learning algorithms to actually run arbitrage how would that you know compete against each other and where would be the arbitrage being captured and i kind of look at the techniques that's available for us in the so-called d5 well mostly i'm talking about zero not through systems and things of that sort just comparing all of them and giving you a notion of like how much it does it loosely speak cost for us both in terms of computation uh capital efficiency and other things price discovery so you understand like you
know what does really privacy mean in terms of if you're running an application uh you know you have a version of the application imagine a lending application it doesn't have privacy say you need you know take a random defect protocol that gives you a lending or even decks right say you need scrap you need to have uh you know 30 pips right 30 bips you can operate at that level because you don't have privacy assuming he had privacy i don't think you could achieve the kind of you know efficiency with 30 whips because it's going to be more expensive than that right okay so i'm just going to talk about automatic marker makers again most of the people in the room probably know what market makers are and how it works
essentially what i wanted to say was if you were to look carefully at automated market makers they have certain functions and there are certain ways in this in which they work so okay ignore the bits like let's assume very simple uh you know amm i assume uni is wrap right you need to have b2 not even v3 so it's a constant function marker making so x and y is a constant and everybody knows what that means and uh so this is what we are trying to avoid okay and this is very important you need to recognize why this is important so in a normal world we always see who is actually putting in all the bits and
who is actually other ask right everybody knows this so you know you know who got what for what price very very important thing right and this results in this paper right so literally this was like a kind of a note published by the three guys taran everybody knows uh alex and uh guillermo i believe galermo is here and he's supposed to give another talk so uh you know what they recognize is like if you were just to think of this like as a normal equation and do a divide divided x differentiation what you end up doing is like you get one side of the one set of this thing right once you know the one side of it you can actually go back and trace back look at the wallets and know who it is right so any mechanism that you provide
to provide the privacy is kind of in a difficult spot that's what this says i'll walk you through the rights right so three things we are kind of proposed one is creating randomness and price second is batching and third is like the trade-off i'll kind of describe each of them in a bit of detail okay uh would you lie all right okay fine so batching right what do you mean by batching batching we already have some of the mechanisms in a blockchain space to do batching so if you look at rollups more or less they are doing batching right so if you do batching with zk then by default you achieve two things but now you ask the question what is actually happening in there now you're
getting an average so one of the things that you recognize is when you have a curve and when you extrapolate the curve the point at which you touch the curve is a price discovery when you get an average you are instead of a curve you have a straight line okay you're straightening it it's like think of like a circle and you're looking at circle under a microscope you have pixels and the pixels are on a line so this is essentially what batching would mean so essentially what that means is there's an inefficiency that's happening so in theory in a really macroscopic sense you could have a perfect circle that fits inside the circle that's been created so does the inefficiency gain or inefficiency lose loss whichever way you think about it depends on which side of the game you're playing right so if you
are inside you're losing if you're outside you're gaining right so this is literally what i'm saying right and there's also this other problem right imagine you have this challenge of having to run a strategy which is time critical right now you have batching because you are in batching you are not instantaneous in that sense so you have a problem right imagine you have a situation where you have a possibility of being front run okay now you are in batching your risk is much higher i hope everybody understands what i mean right so you know i was just was describing it's you know if you think about secret techniques by default they have some amount of batching and also they all they have some amount of ability to provide you
with privacy right so you can actually get a lot of this by one shot and i will talk a bit about gk towards the end right okay randomness all right randomness again uh think of this as a noise generation function right so i i don't know if you recognize this thing called dolby written on the side of you know various speakers so what does what had happened is like a long while ago uh 50 60 70 years ago we were trying to record on magnetic tapes audio signals right and one something that i noticed was that if you record it there's a kind of a loss so you need to put in a lot of white noise to fill it in right so you could almost do the similar kind of thing not to the degree what you need
to have a very precise bound right the larger the boundaries i was saying like you can have a circle which is very jagged or a circle that's almost smooth if you look at it it looks almost smooth right we want to get to the almost smooth thing then there's this question you know how much privacy do you want right how much of inefficiency are you willing to tolerate so if you have like healthcare data indirectly implied healthcare data what i mean by that is in d5 imagine somebody uses some protocol to get some pharmaceuticals right or run some tests right by just looking at the test you might be able to uh in infer the state of their healthcare right to me that is of high value so in that condition my
circle would be like a circle with a bunch of spikes right i hope you understand what i mean so that is what i'm kind of saying like you have like a perfect circle internally and there's a worst case out and somewhere in between you have various average cases so this is the other mitigation strategy that this guy proposed and then they actually proposed this yes they said you know what we could do we could use differential privacy so let me give a shot at different supervision i kind of explain to you what really this means i mean uh just a bit of warning i'm kind of proposing that you know if you could actually solve one problem the difficulty of solving the problem is
equivalent of solving something else okay so probably this is kind of controversial and uh you probably understand why i say that uh shortly okay this is different privacy in general it's very simple right like remember i was talking about batching if you take batching and if you actually make minor changes in there and the overall statistical properties of that batch remains the same that's the differential privacy right and there are different ways to get different privacy okay that's effectively this these are things that are there so so you change the inputs change the outputs you do some randomness all the kind of things that you normally would expect to do but within a very tight bound so that it doesn't really change the overall properties of the sample right so
i also want to say something before i go into any more detail so one of the most important things that anybody who thinks about efficiency you need to recognize in a very reductionist sense right in a complex theory in a very reductionist sense if you think about a decentralized consistent protocol especially a leader election protocol one thing you need to note is you can actually think of this as a two-step process the first step process is a decentralized protocol running a lead election protocol right the second step is whatever function you need to do in a normal centralized sense in a logical sense right so imagine like you have a decentralized oracle let's assume that right what's the first half of the the protocol is going to be i
mean assuming a leader election protocol there will be a puzzle that's being solved and set up for validate as one validator gets a chance right and the next step is going to be the real thing right so there is a delta this is the key thing there's a delta of inefficiency in doing anything decentralized versus centralized so we need to be really wary of what are we trying to do so if you are trying to get privacy and you're going to try to decentralize you are two steps at disadvantage compared to a centralized thing i'm just putting it out there so everybody understands right so okay right yes i'm kind of saying this engine right so and uh there is also some other cost
involved but i'm kind of making it very simple so communication cost is not trivial right so when i say communication cost is non-trivial is like we always assume under all conditions that communication is almost zero i mean the cost of communication is almost zero but at lots of times the cost of communication ends up being expensive because temporarily there's a value of time so imagine you have going back to the conversation which i was saying like imagine there was a transaction that needed to happen really fast and literally you have got this process now for you to go through to get to the result you have a bunch of communication forwards and backwards that need to happen so essentially what that means is you you know if you were to
find an insurance against the front running that's a cost let's think of it that way right that's your insurance cost if you're hedging it that's a cost right right okay uh this is uh the crazy construct that i've been thinking about i mean a lot of people have been thinking and i've been thinking so i i actually have a team and i build a protocol for providing privacy for d5 so one of the constructs you want to understand is like you can think of privacy in some sense you know that could go into the generalized mining bucket right so if you look at live pier they're doing transcoding uh look at other people golem if you think about it they were doing a distributed compute this is how do you actually provide
uh you know privacy right so generally speaking imagine this room right like imagine you had a boolean detector over there detecting everybody who goes through this door right you know the privacy of the set of all people attending this talk is very much a function of how many people are in this room right that's pretty much straightforward right one by end in that sense so you want to you know incentivize people to come into this room right so how do you do that so somehow one of the ways you do is you actually give incentives to people to participate just participate and you need to recognize there's a trade-off here you can actually do a lot more compute versus insert device people to be in the room right
i hope you understand so i can actually add randomness to the whole thing right adding randomness cost has a cost plus an error margin so instead of that i could just go the other way around and i'm trying to find an economic solution where behavior has been altered by incentivizing people to provide privacy this is kind of general construct of generalized money okay so now i'm kind of trying to describe uh privacy for in a slightly different sense because most of previously what we see now is kind of a second order effect of things that have already happened what i mean by that is like we have google providing search services facebook providing us with messages ads uh you name it amazon supply chain
optimization essentially what is it that's happening there's an arbitrage happening or an adversarial game in loose sensor speaking between an average user and an entity with a large amount of compute i mean i'm going to describe it in a bit more detail but you know the assumption here is like you know what is the real gain they have right the real gain is situation number one google with no indexes of my historical searches trying to serve me with ad and the revenue of ad from that versus google with access to all my cookies and all my searches and providing ad content to me right this is the arbitrage between the two of them and if imagine this to be two curves the gap
between the two curves is the curve that we are really fighting for right and what we are literally fighting is like okay you as a human have an economic value and this economic value is being kind of used by entities who have large access to machine learning hardware and models right data data models and hardware that's essentially what this means right so the argument here is like what is the cost on the other side okay so i'm kind of saying that we win as people who are interested in privacy if you could provide privacy for a cost less than this am i making sense okay right there you go i call it the privacy disadvantage right
ah so okay so assuming two algorithms completing each other one once privacy one without a difference between brewmen it's a privacy disadvantage right so this is what i was describing when i was talking about google with cookies and without cookies or you know not having my data having my data the difference between the two is a disadvantage right and the real question here is how do you actually price this right how do you actually price this disadvantage so this is uh you know the google guys and the cmu guys talking about ml and how if effectiveness of data and all those kind of things so i want to add something more to this so what i mean but my more to this is like there
is an inherent cost for these guys to do what they do okay uh so i'm going to walk you through so you understand this better so imagine you have a deep learning pipeline you actually have a bunch of constraints firstly you have a cost function you can only at any point in time run so many machine learning models number one there's an opportunity cost right number two you have cost for running hardware so energy cost plus depreciation cost is that it's an asset that you are sweating okay number three if you want to randomly create models you want to hire people who could build models for you and build and maintain models for you okay that's our cost involved so assuming this this is a very important construct to have in
your head so you understand what this means in a larger construct so if you were to do a model and you were to run an arbitrage in a machine learning sense you also need to understand there are other competitors who are competing with you to doing almost the same thing if there are two competitors at almost the same level then the incentive for them to do a lot of these things as almost zero they don't have an advantage okay all right okay so i was kind of thinking it from a data perspective but it really doesn't matter so i'll explain what this means so
if you do this you could actually find the price of data right so you can think of price of data being as inverse function of privacy what i mean by that is like if privacy exists the security margin for any attacker on data is a function of the price of data does that make sense yeah so right so yeah i'm just kind of describing other things but but in general in summary this is what it means right so there are ways in which you can think of privacy in a slightly different construct other than just providing zk's and other things which is essentially being advisorial what i mean by that is like you can have a gan and produce synthetic data
and at times uh if you look at you know tor and other you know algorithms they actually have synthetic data in loose sensor speaking that actually provides this kind of stuff right okay ignore all the species so this is kind of uh you know thing that normally happens if you think about privacy and utility we don't have a real curve like this we really don't have and it's very subjective and like it's kind of instantaneous so given a data given a data given any data set it might be anywhere at any point in time and it might vary as well uh okay right so this is kind of what i was kind of saying like this is if you really have the ability to differentiate price the data exactly
right you kind of get a bound of differential privacy does that make sense so the cost of actually providing differential privacy pretty much is equivalent of actually finding exact price of this thing yeah i mean i'm going to i had a slightly described adversaries and things like that under those real models uh i will kind of touch on the renault's proof systems and kind of stop there so yep in general okay let me walk ah who in the room doesn't know zero knowledge is there anybody who doesn't know okay good for the people oh not here so in general it's a construct where imagine this room has one doe and i make a claim that have the
ability to escape from this room without using the dirt and then i am the prover anybody who verifies me is a verifier so this kind of a proof where i try to prove something to you which my claim is true uh irrespective of the fact that i try to do that as many times as you as you ask me to but your knowledge of how i escaped uh remains the same is called zero knowledge right so yeah so i'm just going to skip the rest of it generally speaking we are more or less staying in the computational space but you can have other ones as well all right so this is where i kind of uh come in and kind of talk about like what what's the cost of doing this such things right i mean i can compare like different flavors of it and i can also
look at how it looks compared to other ones so uh forgive me for saying this i'm more staying in the ethereum space so i was previously involved in the ethereum swamp orange swamp team so kind of have a bias towards ethereum so and i have my protocol deployed in ethereum so fully advised uh acknowledging by bias so the thing is like if you look at the cost you can see the gas cost right it's quite high right so if you really want to do privacy it's high the cost is high the size of the proofs are going to be bigger and the computational cost is also going to be big right so there is this cost that you have and then sometimes you could actually use this to your advantage okay this is just comparison between all the three major
brands of it snark stocks and bulletproofs i mean there's been some uh you know kind of merge between the snarks and the stocks so what i mean by that is like you know if you look at halo 2 some of the things that are there that the fry is being used to achieve some of the property so essentially in a very simple sense knox requires a setup so whenever you want to do something you need to run a setup and uh the previous speaker was talking about zcash that was pretty much a problem with the setup and uh you know its security is derived from elliptical this law problem uh stock doesn't require a setup security is from a random function so it's kind of cool bulletproofs are like is it
kind of a zero knowledge for range proof kind of thing where you could say oh i'm a set member i'm a member of this group and uh it's it's used in certain circumstances certain protocols not the ideal ones in that sense so mostly i am kind of involved in snacks not i've been done a lot on stocks so this is my conclusion that i drew right yeah first and foremost as like as i described competing for price first enterprise system is going to be a challenge so this applies to all the tech as well right so it is very possible that tomorrow we have ffts and other things that actually significantly reduce
overhead reduce the size of the proof we might have all the all the things that we want straight up so and the next thing is something i i thought was interesting so the reason why machine learning became so prevalent and able to compete against privacy was a mapreduce so like i call it optimistic uh in a computer paradigm so optimistic computer paradigm is like you send a computer load out you wait for somebody to complete and you trust them for being there to give you the result back right so this allowed so hadoop essentially allowed very large scale computations to happen and price discovery for machine learning in that
sense if that wasn't there the bigger privacy challenges won't be there right so i probably might put my hand up and say yeah did some work over there did some standards but there's very little one could do on the other side you know it is obvious what's going to happen you can only watch and try guide it but nothing much could be done so i think this is going to be a race between the two sets of uh you know parties in that sense one where there is a bunch of people who are really trying to write on an arbitrage against society so you could think of like a you know i used to live in the uk so we have a free health care system so the classic case is cherry picking right so if you have any disease you go to the hospital the
hospital looks after you right imagine you had a you know not so private situation where private entities actually look after sets of things and the rest is getting left to the government cherry picking would be easy because now you have very clear idea of you know and there are some entities based out of uk who have been accused of accessing data i'm not naming them you can google them and find them and you know who they are so this is really scary especially in a healthcare situation looking at where the demographic is going i'm just not just talking about d5 this is like all the way to healthcare and normal data right and obvious statement there's like there is no such thing as freelance which is blindingly obvious that's it folks
[Applause] um so basically uh one of the ideas you conveyed is that the price of privacy is something that is not determined yet and you're calling for protocols to have some kind of a differential value of it do you think this will enable more participation so this is me thinking out loud right so what we need to understand is like if the arbitrage is between privacy privacy and privacy less we lose the first place right
we as protocol builders have to understand what is it that as a premium we are willing to pay this could be dynamic right it could be that at certain certain situations certain set of transactions have to have a higher privacy and you have to do price discovery for privacy at that point in time and then provide privacy because providing privacy across a lot across the whole thing might not be the most efficient thing to do because it will increase the overall price of the protocol significantly and we won't be able to survive yeah right um and also you had a point about uh incentivizing people to participate as mining in helping those and
i understand how it can help with having more privacy but does the flip side is also right like if not enough people want to consume it maybe there is some place to incentivize more participation as the consumers of privacy could you be the last bit i didn't hear the last bit like you said that it such a protocol should incentivize people to be minors but is the opposite also true like if not enough people want to consume it that's oh yeah collapse literally will collapse right so it's like imagine you have a toe node just one node end the story right he shouldn't be browsing if
so that's literally what is happening here thank you very much there's no more questions