Provable Compliance on Polygon Miden and beyond

EthPrague 2024 · 1 Jun 2024 · 18:36

Anne-Grace Kleczewski, a lawyer at Swiss firm MME Legal and a DeFi co-founder, proposes provable compliance: hardcoding standards into protocols and using zero-knowledge proofs to show they were followed, so code prevents abuses such as front-running instead of regulators deterring them after the fact. She argues that clear standards on decentralization, disclosure and best practice could help DeFi earn trust, and shows how Polygon Miden's client-side proofs and transaction scripts can enforce rules such as sanctions-list checks.

Speakers

Topics

From EthPrague 2024, hosted by ETHPrague.

Transcript

[Music] all right welcome everyone uh so the next speaker we have is a lawyer also defi co-founder you're advising the blockchain dreamers right uh also building K protocol but I'd like to bring up to the stage honor Grace thank you let give a little Applause as well thank you thank you for the lovely introduction so as mentioned I'm both a loyer at mme legal in Switzerland and a defi co-founder so basically double

trouble because I have all the technical uh problems and then all the legal problems all combined together um hopefully my goal today is to make sure that you don't regret sitting here instead of drinking coffee while it's training or being at a different presentation um so provable compliance what the heck is St uh so I'm presenting to you something that I hope will become uh a new narrative that may gain some attaction so let's dive into what is provable compliance first of all I need to clarify what is meant by compliance so be reassured this is not another AML kyc oriented talk it's more broader than that it's much broader than that so the current situation let's

recap slightly when we hear about compliance we think about regulations that at stand standards um and there are some good ones I like to think about regulations as good tested recipes with some spices that are added there some of these spices are for example the fact that we should have some reserves that may be useful uh we should prevent Market manipulation it's kind of good for users you may want to have some insurance and those kind of things it's basically all spices put together and it's like a good recipe so it's not all bad and it's not all to be set aside over creates some burdens and then organization Mak that policy as well with which you may want to comply and how do you ensure people comply with them well you need someone to monitor violations and sanction them so it's

like a deterent system it's not because the policeman is around the corner that you will avoid doing mistakes and doing silly things you may still decide to do them so here it's more about deterrence you may think twice before doing a silly thing because you know that the policeman is just around the corner so what would be the future situation with this idea of provable compliance these standards would be hardcoded so not all can be hardcoded of course I mean some Logics cannot be really transposed into code even if we wish they could be um you would have zy proofs that actually um can be generated by everyone and confirm that it was complied with that so you know that the code ran as it was supposed to and basically you would have deps preventing not only detering some specific things

so instead of having a regulation telling you hey you're not supposed to front run someone is supposed to monitor whether it happens the code would simply prevent any front running and then you don't need centralize actors because the cut does it all so it's like the ultimate promise of defi instead of the regulator thinking about how can we have someone overseeing the market and ensuring this or that you would basically have the code taking over this responsibility so the regulator would finally be able to sleep calmly and have nice dreams so why should we even care about this like why would the developer even bother to think about how to transpose regulations into code why should we change the way we build Defi and potentially also CI well because we have

a lot hate relationship with regulations like now it changes a bit because we all know like the risk of potential Regulators from the US chasing down some protocol so we care about it but at the beginning most developers were just setting regulations aside it was like this meme of not think about it I don't hear the regulator I don't want to care we are decentralized it doesn't matter at all well regulator annoy defi but they can also actually help defi in some aspects because first of all there's a major problem of understanding what is defi so I may identify as defi but I may not be according to someone else like all these debates on what is the actual level decentralization you may end up with debates on Discord whether having a

kill switch is actually still maintaining you in the decentralized space or making you a centralized protocol and so on then also there's no disclosure requirements meaning everyone discloses whatever they want to like you need to basically put on your Sherlock Holmes hat on to understand things to medium Discord uh documentation Twitter and so on how specific protocols operate what is the governance and so on and each protocol discloses different data according to different uh standards so it's not that easy and when we analyze projects as lawyers we spend a lot of time simply trying to understand the case because the information is not digest and for users it's the same and having no standards imposed by anyone is

kind of a mess and there's also no standards in terms of Frameworks and best practices one protocol may have let's say some reserves another one will not how do you know what is better where Reserve sets correctly uh basically what we are used to is knowing that Protocols are developed correctly from a technical perspective there are some technical audits but it doesn't guarant quality it's not because my transaction went through and everything functioned correctly that you had best execution and those kind of things so having we could have industry standards for that right like all of these problems could be solved by the industry but from a external perspective it would actually help if the regulator just took those industry standards and set some

guidelines by saying hey defi is cool because this is the standard uh if you have this kind of uh level of the centralization it's defi if they disclose this kind of information we can actually kind of trust them because they know what they're doing and if they compli with this kind of basic standards transposing those good recipes we know in their own fashion it's good now why is this important all I said before uh well you don't want to end up like these cats being all stressed because if the regulator does not acknowledge Defi and simply say hey we're not regulating it we're not even tackling it it's like a bunch of deons just doing their stuff and building products from themselves well we will never grow because no financial

institution will start intera AC in with you CI is now let's say will probably boom because of regulations showing up like you can prove you have a license user can trust you and so on what about defi also it may lead to better reputation we've all heard about all the exploits that happen we can always pinpoint at they could have done things differently they could have done this and that well if we have some standards we can say hey at least we comply with the basic standards this still happen but it's not because we were bad actors in the first place so it may kind of um improve the reputation and finally currently we all hear about the SEC chasing down some projects every month or even every week well regulatory

enforcement is not actually the key uh to a sustainable environment if you build unicorns that potentially could be taken down by any regulator just because they don't like it anymore that's not the best way for the future so this is why we should care about proving that defi can be built in a more responsible way and different ly and this is what could be done thanks to provable compliance basically by showing hey we acknowledge what to do in trfi and CI but we kind of transpose it in our own way so instead of waiting for the regulator to tell us what to do we just do it in our fashion and try to convince them that it's the best thing now what is polygon miden which is potentially one of the ways of implementing this

provable compliance but it's just not not just noty key chain uh it's actually a non compatible chain that uses rust as a programable language for now you have a alpha test net that's live uh the public test net should be live quite soon by the end of summer um a zi virtual machine I mean I will not dive into that but I rather spend time on explaining a couple of features that could be interesting for the narrative I just explained so first of all you have accounts and notes polygon miden is a bit as if you had ethereum and Bitcoin having a baby together you have each account being a separate smart contract that holds all the funds and you have notes thanks to which these accounts communicate you

need to consume notes to uh have a transaction so what are accounts well as I mentioned each one is separate smart contract with code and storage so you have your assets in your account it's not just the issuance smart contract of the token these are actually associated with your account not with an is and smart contract when you interact on Maiden all assets are F stored locally and and you can have both funable and non-fungible assets what are notes it's the way of communicating and each note has a script uh inputs and serial numbers and we I'll come back to the noes but the way nodes are structured are actually the key to potential um provable

compliance all these uh noes communicate in a synchronous Manner and I mean lovely animation and transactions are State transitions of single account so when you have a transaction you basically update the state of the account sending the funds and the account receiving the funds so you need two transaction two notes like the note and two transactions um to update all of it and there is a proof for every transaction it's a stock proof now what are the use cases of this very general presentation this is where the keum part kicks in we are working on the first one how to prevent Market manipulation and it's actually a very trending topic just uh

quite recently a couple of days ago we've read across media and um NX how all of a sudden uh me could be a problem because you have those Market abuse rules it's actually not such a new thing because anything that's Market abuse with uh MAA the European regulation is something that was in the text like already last year it basically extends anything that's prevention of Market manipulation from traditional Finance to centralized actors providing uh crypto Asset Services so so it was already out there the only thing is now we have guidelines on what could potentially be uh Market manipulation and we have some also guidelines on how to detect them I mean those guidelines are quite broad basically a bunch of information you

collect which may help identify it so we still have the problem of how to concretely identify it and as I mentioned before it's you can't SAR it's spotted and it's just about deterrence someone is supposed to watch you and identify that you've done something that is not correct according to regulation so it's it's an important topic and if we think about Market manipulation and Order books we are working on an onchain order book you don't really have many attempts at it currently well if you have an onchain order book on paper well all this public so you actually help front running to a certain extent and still the matching script most of the time is run offchain so even if you decentralize the way it's run well it's

kind of Stu of a blackbox you don't see how exactly things happen and makes uh identifying manipulations kind of tough so be it Sexes or like decentralized onent order books they're kind of supposed to prevent Market manipulation but how do you make sure they did that you can't pinpoint and say hey you've missed that one if you don't actually see it coming um so on top of that all of this is only for centralized actors and nothing happens for decentralized actors so basically in defi you could end up having uh open Waters an ocean with plenty of sharks front running watch trading and doing whatever you want and nothing happens this doesn't seem like an appealing Market to trade on so the current state would be uh

billions are loss to front running liquidity is sometimes fickle you place a trade and actually you realize it's not there and prices are manipulated it's part of the fun but still it's not interesting to everyone so now choose your enemy do you want the amm with the known shortcomings or the Autobook manipulations and this is where the provable compliance narrative actually kicks in what could we do how can we unlock the future of trading with maiden or other Technical Solutions miden is just one of them well I've mentioned that notes carry assets but they also have those spend conditions you can insert a script there and those scripts could cover any topic you may imagine so spent conditions are ziki protected you

know it's there um transfers require not to be consumed so basically before it's consumed nothing happens and notes remain tin to the account so if the script is not complied with you still keep all these funds and everything is there with you um the assets remain under your control it's not like in other context where you send your assets to a centralized exchange and then you hope for the best um so you keep like the ultimate joystick in trading and what could you insert in the spend conditions to make it interesting well let's dive in a bit further into it well for a simple Note I I just pick one of you in the audience and I say hey I'm sending you these funds if on top of that you can prove that you have

received other funds from someone else so that together uh with these funds you can basically finance a new event like I'm only lending you money if you received enough funds from someone else on top then these notes this note will only be executed if this condition is met I've put it in the script um you could have a swap note where you also need to prove something in advance for example I don't want to swap with someone who interacted with that specific quallet I can put it in the script and then this is the interesting use case um you could have an entire order book where in the script you insert the matching script with all the conditions that are associated with it so basically you know that anyone who committed to the script in their note is

um interacting with that exchange so what would be the future order book as we're building it with keam on Maiden well you have ZK proofs basically acting as Gatekeepers so you implement best execution directly in The Code by inserting basically the reference to the matching script which is public audited it's not a black box anymore you know exactly based on which Logic the orders are matched you insert it in the note you don't need a centralized entity anymore to overlook how things happen because it's in descript it's ZK protected and basically if you try to temper anyhow there will be no consumption of notes because the scripts

don't match it's part of the conditions so if I say I only want to be matched with another order that inserted the matching script from the Kum order book well you need to comply with the conditions of that script if you try to add something else on top there will be no match no order and since your funds were still attached to your account and the note was attached to your account nothing happened we haven't touched your funds there was no tempering there is less risk um and this even works if the note is private which is potentially possible with miden because the script is there so even if you don't see it the script still needs to be complied with now another application and I said it's not just in that AML talk well

actually AML it would be interesting currently you have a lot of Z Solutions where you can generate certificates with proofs and like say hey I have complied with AML requirements in just jurisdiction I have not interacted with any tainted funds well with mid you could put it in the script as well you could basically have a list for example of sanctioned wallets and refer to that list in the script as well making sure that if you want to send funds to someone this transaction needs to be also verified based on whether the other address in is on the list of sanctioned countries so even on a peer-to-peer basis you can actually refer to that directly in the

transaction um I thought about initially maybe inserting a link to to this but in the polygon miden playground if which is available uh if you check on the probable compliance you see an example of code where um basically you realize that if the program doesn't stop in the context of this transaction it simply means that it can be executed because the address of the destination was not on the list of some sanctioned wallets it could be any list of course it raises questions in terms of who sets up the list who controls it and so on but the initial idea is is still interesting because it means you can really embed this logic in the script of the node me in a transaction directly instead of

relying on external um solutions to be implemented with your dab and so on and this is basically it but uh as a summary um the idea was just to present to you why compliance could matter to developers and if we think differently about how we develop products and build them so we always think about how to be more Innovative how to create new trending products but what if we thought about also building responsible products that don't scare the regulator off and are not only directed at people who are open to risk and having great investment opportunities but also are simply reliable for the masses and something that can be even recommended without saying hey you're using it at your own

risk because we have no clue how it's going to work out so I hope this is an open call for you to think about what polygon Maiden could allow to develop in the future because do I've mentioned two use cases but I bet there are other ones and also think about how other Technologies using ZK proofs uh could be utilized to prove to the regulator that all these standards that those guys in student trafi apply we can apply them even better thank you very much and if you have some questions um no questions well then I hope you can dream about provable comp clients now thank you all right thank you very much