ZK Hack Istanbul: Ola - Bringing Compliant Privacy to ZKVM Rollups

24 Nov 2023 · 25:08

Recorded at ZK Hack Istanbul, a November 2023 hackathon bringing together zero knowledge builders, this talk from the Ola team introduces their approach to bringing compliant privacy to zkVM rollups. It covers how Ola's design balances privacy for users with the compliance requirements rollup operators face, part of the event's broader focus on real-world zero knowledge applications.

Topics

Transcript

[Music] so hi everyone my name is Phillip and I am the COO of Ola um if you haven't heard about us before now you have we're a very small team uh and we've kind of been under the radar uh but essentially we're looking to build a ckvm um that Bridges the gap between private and public daps I actually have a few slides in this presentation uh that we won't be looking at so we might skip a few here because we only have 30 minutes um but we're going to walk you through the entire architecture of Ola and at the end I'll give a quick demo um we're not going to

Deep dive too much because uh running the Ola infrastructure is actually part of one of our bounties uh so I don't want to give it all away uh before we even get going so yeah skipping a few slides there we have have been looking to solve some of the issues uh in web 3 I think I mean this is a CK event but I think a lot of the teams have its origin coming from the web 3 world looking to to scale public blockchains and looking to bring uh privacy to public blockchains and these is essentially or these these problems here on the screen is essentially what we're looking to do we want to empower the users um currently on Shain everything is transparent and anybody even though you're so anonymous

can get a hold of your data we at the same time when dealing with privacy uh enabling schemes we don't want this to yes completely pivot away and not work with current regulators and government bodies so we want to be able to provide a compliant text act which doesn't compromise end user privacy this has also been one of the core goals we've had at Ola to give a platform to the sovereign individual but still be able to work with current governments so when doing this and when looking specifically into the web three stack if you worked with ethereum you know that an example given kesak is used

quite frequently as a hash algorithm you also have the secure hash algorithm family and these are just two examples now they aren't very CK friendly um so we're using Alternatives in posidon 2 and in Blake three hashes Etc just to make everything efficient now this is also at the core of what we're doing so in the designed choices we are making with our virtual machine we are opting for efficiency if a system is ever to be used in in production then it needs to be fast and efficient uh we do have some benchmarks on this as well and some of the stuff we're doing uh we also have some other tips and tricks off our sleeves in terms of getting more efficient um C proof generation uh if you've ever worked with with starkware and their ecosystem you

might be familiar with the concept of hints um it's basically just about taking some computation out of the trace uh and then you can with fewer op codes you can verify that uh in the trace of the VM um so different tips and tricks here yes to make it more convenient and more fast and efficient uh I do have an example of this as well uh I'm not going to Deep dive into it but we're going to look at some numbers on it um aside of that um rvm is based on risk very similar to uh the risk C te moves here uh we run what's known as algebraic risk uh taking inspiration from the starware team so there are some slight differences in how this works uh we're also utilizing Concepts such as the built-ins um this is example given how

you would call uh a pre-compiled contract in ethereum uh kesek would be an example given I think they have about 10 of them in ethereum um so we're reusing that concept to also have further uh efficiency uh one big change in Ola um I'm not sure if this is visible I hope it is um but it's basically that in ola we don't support eoas So externally owned accounts uh this is what's used in ethereum today um instead and and forgive me if this is wrong now but I think it is ERC 4337 which looks to do account abstraction for ethereum and we have that um in Ola as well that's the only type of account we support uh this is a

much better design and it gives freedom to the end user you can pay your gas and different tokens uh there are more benefits than that but this is the only account we have in Ola and it's the the base hype uh so that's a difference this is also very small um I hope you can see um but basically this is how the Privacy scheme and the entire architecture Works in Ola so as you can see on the screen here to the left uh in red we have representing the client side so that would be your end user device your laptop or whatever that may be and then we have the node side here which is the blue side and um this would be actors participating in the Ola Network and helping out to do proof

generation and these nodes could then supplyer proof to any layer one uh or Layer Two for that matter it should be noted that Ola and the VM itself it's to put it shortly an encrypted execution environment uh if we wanted to we could deploy Ola on top of a CK sync as a layer three we could deploy it on Celestia we could deploy it on ethereum so you have some kind of layer where you want to send your proofs and they they can be verified so to the red here how this works is basically under the hood we have utxos but we also have the traditional account-based model of ethereum but if you're dealing with a

private dep how it works is that you would on the client side you would generate a proof relating to the private parts so you maybe have some utxo Alice wants to send Bob some money let's say $100 then then that gtxo would need to be consumed that end user device would at the same time also be creating a sub proof relating to the private parts so we are not giving that data to the blue side here the node operator so you sign that message and you send your signature with it the node can then verify that this has been done correctly and continue with the rest of the public functions so basically what the client side would do in this

scenario is you would calculate a proof relating to your private transactions and together with the rest of the public functions you would send that through then as you can see on the blue side here it's very small but uh over here we have some proof generation and a lot of this is happening in parallel so it's kind of a divide and conquer approach where we can divide the proofs into smaller uh chunks we can prove them in parallel separately and then using recursion uh we can prove them all the way back up to the top uh the proving stack by the way is Stark based proving stack We Run plony 2 uh we have made some additions to it so it's not really the exact plony 2 and then starky uh for Block generation we use planky 2 for recursion uh we have also looked into uh

it's very small here but it says aggregation and folding at the end we looked into the some of the schemes with IVC incrementally verifiable computation uh with the different flavors of Nova and so on and then we also locked looked into using a snark to make it more succinct with the bite size that's sent up to the um the layer layer one or Layer Two or whatever layer that is um so we did look into using f flong for that as well which is applicable um but it's not in the current uh design another view here uh of the public and private logic so um I think we covered most of this but as you can see what I'll just repeat it real quick uh user side if you're dealing with

anything in private it's red here again um this is basically the example I gave you before so use side the local VM would execute that and as you can see here in the transaction it actually says that the proof here that's set in black um is sent together with the encrypted commitments the commitments is the utxo objects and the remaining public data to be executed so that's how we deal with keeping and maintaining that end user privacy so they have that partial ckp and then the the node side would take care of getting the full ckp that's uh sent through I think Thor in the intro speech mentioned that oang or Ola Lang the Ola language that we use for developing

contracts on top of Ola has taken inspiration from solidity and that's basically what we're looking at here um so we have the uh the function types very similar to solidity if you ever used that otherwise I'd say that Ola is almost a rust Fork so if you're familiar with rust and solidity you are good to get going it's very simple to get going I I'll show you an example of this as well for for a short demo so uh to the bread and butter of our solution um this is just a comparative slide uh on the example here I have Astic and miden so a big difference between our teams here is we are going down a route where we're looking

to maintain and protect the end user but we still want to be able to trace encrypted data in the network because think that this brings a lot of value when working with regulators and if Bad actors would ever hop onto your system so as you can see here by the slide uh with the example of mid and us uh we both have a sparse teared Merkle tree as the the public tree but then the difference is on the private side of things so instead of managing two different trees here and why you would want to do that is because you want to decouple the spending of utxos because if you have that coupling between them then you can derive who spent what now

this is a little bit more overhead in terms of the computation that needs to be done if you manage one more tree obviously that will be be um more uh resource intensive so we just have one tree uh that's updatable and why we have that we'll be looking at in the the following slide here this is again very small so I'm sorry if you can't see anything but in the system as you saw on the previous slide we have two trees we have one public Merkel tree and we have one private now to the far left here uh it says the root of the public tree so that's the public tree and then just going to the right here we have the private trees so once again if we would have Alice and Bob hop onto the system and Alice would be the one furthest left

and she wants to send $100 to Bob and with utxos as some of you may be familiar uh if you don't sent the exact amount that's in the utxo itself there will be change uh but for this Simplicity of this scenario uh we always send $100 so if Alice then wants to send Bob $100 um what would be seen in the first transaction here is that Alice has been deducted $100 from her public account and a utxo has been created and that's been sent somewhere but we have no clue of where that went but we know that Alice who came into the ol ecosystem was the one to send these this this utxo of $100 somewhere and that would then be represent Ed by the darker green blob

here where where it says CM CM by the way stands for commitment and that's just the encrypted data in the old system so imagine then that Bob wants to send this to Charlie and Charlie here is commitment number two in this transaction we can see anything but what we can see is that commitment zero has been consumed so it's not a member of the Merle tree anymore and commitment 2 has been created but looking from the end user perspective the end user data is completely protected now would Charlie here then wish to exit the system uh now it says nothing here because the the the image just continues in the private Tre but

should he want to exit the old ecosystem and move his funds elsewhere he'd have to go back to the public tree and in such a transaction the only thing that you would see is that maybe that's me philli I have received money but we don't know from whom I've received this and the entire utxo back chain is still hidden uh and why this is important is Imagine illicit activity or fraudulent illegal activity happens on the Shain um there is mechanisms that could be implemented here but comparing this to other systems which is fully private we can provide the option to work with regulators and government bodies and show them well if maybe you know it

turns out that Alice wasn't Alice that was was North Korea or somebody that governments don't want working there because they're they're Wasing money well then we can showcase well this is actually where the money went and this is when it exited um otherwise it would be a complete blackbox as we've seen with example given tornado cash and the the sanctions that went against that so we're looking to build this scheme where end user privacy is at the core but we can still provide means to be compliant and work with the regulators so um there are other ways and to share your data in such a system so when everything's private you um you don't see anything in the system if you just

see encrypted data well what if you want to uh do your taxes or what if thirdparty teams like Shane analysis who base their entire business model around Scavenging data on Shane no longer can do that um we have a key system for this um this is very similar to most of the teams working in the space of privacy uh but basically we'd be looking at a u key here called the viewing key so you have the functionality an option as an end user to decide of well whom you'd like to share your data with so if I want to showcase all my transactions I will just share my full viewing key and I can even set dates for this uh and I can revoke that so I can give access where access is needed to share data

with a third party essentially so there there's many ways here to this fully private scheme to to share your data with Outsiders and we mentioned some of the uh principles of olang it's a rust like language with solidity inspiration one thing that I think is important for developers to know and this was covered in the uh the insection by Thor is that we are not a DSL we we are looking to abstract away all the the complexities that come with building CK circuits so the level of abstraction in NOA is very high you don't need to have that Niche CK

knowledge to start building we take care of that so to compare to other teams uh some of them you need to work with field elements in the language we abstract that away the Ola VM itself it's Che in complete well with the limit limitation of gas of course so instead of being limited by computational resources to whatever program you're running you may be limited by gas um because that's how you counter DS attacks on on decentralized systems and we can run any code it doesn't need to be deterministic some of these dsls because of the step when the actual circuit is generated then everything by that point before well the circuit is generated and it turns into

bite code and deploys then everything needs to be deterministic uh and that's not the case in Ola because we put constraints on the VM itself so you could run any program uh as it is true and complete with than the exception of gas of course and a quick example here um of the profit module that I spoke about brief briefly before and this is the concept of of hints from starkware I will not deep dive into this but we have a quick example here with the calculation of a square root now to the left here you have the native implementation you have these 17 lines of code and to the right here we have the profit and we're not actually seeing the profit Cod code itself we're seeing

in the first five lines of code that the profit implementation is being called and then you can see on line 10 and on line 13 we just assert that we are getting the result we expected so that means if we're looking at the actual trace for the cqp generation part we've now done this with two op codes instead of all the op codes required uh to the left here uh with doing this natively and we have run some benchmarks on this as well uh so we ran the the calculation of a square root a thousand times and you can see that the the execution time vastly uh is lowered um and the same thing goes for for the proving time so utilizing means uh like

this and having this for more things that are CK unfriendly um can speed up the the throughput in such a system code and documentation uh everything we do is open source you you can scan this QR code and I believe that contains all our socials and maybe also a live telegram group we have for the hacking Happening Here in Istanbul so I'll leave this on for a few more seconds then I don't have a timer so I'm not sure how are we doing on time 10 minutes okay and then we we have a road map uh actually this this is an outdated road map slide um I can maybe pull up another

road map and I can showcase that or actually we we we'll skip that we we're going to talk later as well so I'll show the road map then but that's it for the U the presentation here I will quickly um also show you guys an example let's see if this one works as well it does um so here we have a basic uh example of a Fibonacci program what I'm going to do is I'm basically just going to show you how um to get started uh in the Ola ecosystem and we have docs on this that

I will pull up and show you guys now I won't be generating a proof um we actually for our bounties that we have for this event uh it's basically doing what I'll be doing um but with a different contract so I don't want to give it all away so uh what we've got up here is yes Visual Studio code we have a actually the contract here doesn't matter uh but we have the feach uh contract up here and then I have my terminal here to the left so what I'll be doing here uh is writing cargo clean if you're familiar with rust you know what cargo is as a tool so I'm just cleaning the environment and then we'll go ahead and build so we're just compiling now uh and

I have by the way downloaded a lot of prerequisites such as C the Ola compiler uh we have rust installed and if you're an M1 Mac User like me actually rust has some bugs on their end with the latest uh nightly build I will just highlight that that uh it's a current bug on the the rust uh issue section on their GitHub so if you're using uh an M1 Mac and and rust then you need to lower your nightly to 1.72 or 1.74 uh 1.75 being the latest but we can talk more about that offline if anybody should bump into any issues so what we've done now is basically we have just uh compiled the program and I think I need to change

some directors here because as you can see here to the right our contract file is actually not in the directory that I'm standing in right now so it's in the examples directory so we'll just go ahead and swap over to the source code directory of that and what we can do then is we can yes right let's see compile and we will compile this this Fibonacci Sequence so when you get this output you know that you've successfully compiled the program the the next steps which I will not be showing you guys but what you would be doing now is that now now that we have everything compiled is we need to interact with the uh the program

right and U there's many ways of doing this uh but for the example here uh today or what we're doing for the Bounty is that you're going to be using a shell script to call the actual functions uh on the deployed program and generate the proof for this set program so I think we have a few minutes left but I'm going to end it there uh what we've gone through is the the overall architecture we've seen some simple examples so um if there's any questions I'm happy to to answer them now uh and if not I'll be be outside as well uh and happy to help out with any problems you guys face uh we're super excited to as a small team of roughly 10 people to be able to to pull something

off and something that you guys can actually use um so we're super looking forward to you guys just trying this out and trying to build on top of our stack and submit any any bugs you may find thank you round of applause thanks Philip yeah as we said in the intro it's also I mean getting feedback is also why we're here that's part of the game are there any question for Phillip we have like five more minutes no yeah one here uh would you like to give some hint for the Bon or hexon sorry can you repeat that uh would you like to give some hint about the

haxon yeah so so uh for for the the bounces and the the hacks actually I mean if you're look so there's two parts and we will be covering this um I think in like an hour from now we like an hour hour and a half where we represent or sorry where we're going to present all the the bounties uh but basically it's on our GitHub already and that's open source everything is open source what we do uh so I mean if you're sneaking into the GitHub you'll find everything you need to get started and actually a few people have already um but the hack uh which is already open source is about running uh the Ola Tech sack which we're looking to get feedback from so I mean if you find anything that sucks let us know or you know anything that's good or we can improve um and it's basically

about running another another smart contract and interacting with it and in the end if you do it correctly you'll get a prompt um and then you can come and show our team uh that you've done the The Challenge and then we have a second challenge which which is about basically coming up with ideas and looking well building anything um pretty much in the ecosystem yeah you're getting the sneak peek into the presentation that would be at 6:30 with basically all the bounties that we have at Zak this year um any other questions yeah like there uh I can see that all has taking advantage of rust performance efficiency so uh this example is pretty simple but

like do the developer need to pay attention to memory management in Rust while doing rust l so I I I think as a best practice uh yes I would was like advis for that um so developers can always make make improvements right right to to how they write their code and and I think this has been seen seen in solidity as well right where if you write something straight in solidity um historically doing that part of the contract and assembly could be more efficient and I think that that's like a general rule that applies to a lot of things right to think about these things and also for for the Fibonacci example is their way to test directly or just it's like testing normal with rust so I would love to give an honest

answer here and say that I have not been involved in these specific Parts um we can Loop them offline um if that's okay yes yes thank you yes and also I think it's a good time to mention that uh tomorrow at 10:00 a.m. we will have a Q&A session with Ola your team uh here on the main stage so yeah if you have any question that pops up until then you're also uh welcome to ask them tomorrow morning at 10: we have time maybe for one last question there is any okay well thanks again Philip thank you so much for having us