DAPPCON 2024: Confidential EVM: Next-Generation Contracts - Harry Roberts
DappCon 2024 · May 2024 · 19:11
Harry Roberts introduces a confidential EVM designed to bring privacy to next-generation smart contracts, at DappCon 2024. The talk examines how confidential computing techniques can be layered onto the EVM so contract state and execution stay private, extending Ethereum's programmability into privacy-preserving territory.
Speakers
Topics
From DappCon 2024, hosted by Dappcon Berlin.
Transcript
hi everyone I'm Harry I'm from Oasis uh and we do a confidential evm so what that is well I think it's best to start with what a transparent evm is uh so you could call them transparent chains so it's like ethereum polygon arbitrum and so on and I guess like instead of confidentiality you could call it's private or a shielded evm or like an encrypted evm but it's a small but sort of important distinction between the two and uh but with a transparent evm the call data is not encrypted so everyone can see what transaction uh parameters you're you're putting on chain and uh even if you had encrypted call data you
couldn't decrypt it without everyone knowing the key and then because it's verifiable and uh uh uh uh replic ated so everyone can see the internal state of the contract uh and you can add privacy to this uh but you'd have to use something like a fully home moric encryption or uh like a a little bubble of ZK privacy on top of that at the moment that these are quite slow so FH is quite slow with ZK SNS you got the uh the proving overhead there and uh but the good thing here is that that uh if you wanted any of these these these properties on on ethereum on a
transparent chain you end up with the the small bubbles of privacy that you can go in and out of them but as a whole uh without everything being private encrypted by default you're losing a lot of the the benefit of privacy there uh so yeah we we made a confidential evm uh it's cheap it's fast simple and you can program it using normal solidity so just like with the evm and ethereum you deploy your contracts on there and it's all encrypted by default you've uh run the same computations as you normally do and uh none of the data leaks everywhere uh so I I think I'll very
briefly go through uh how do we do this so um it's been in production for about a year or so and uh we we're quite happy that it's getting some real world use here uh but to briefly go through how it works um if you're an expert in sgx maybe I'm just fuzzing some of the details to uh for brevity but uh the contracts are running inside a secure Enclave so that's a trusted execution environment uh and The Enclave has like an encryption key which rotates about once an hour uh where the the current secret for the the key PA is only shared with the nodes who can prove like VI an attestation that they're they're running
the most up-to-date software W and this means that we have forward secrecy so if a node drops out their attestation stops being valid they can't see what's going on in the future and uh this attestation can only come from upto-date Intel Hardware where there's a like a cryptographically verifiable chain of of signatures that ultimately come down to a unique certificate and a tamperproof key pair that's embedded in the processor and uh one of the things that we do is we have a a compartmentalized key manager on the side there where it's a different set of servers with a much limited uh more limited footprint and uh they very carefully uh delegate subsets
of the keys to the compute nodes so that only the compute nodes get access to the data that they need to compute on uh that means that there's no master key that's on the the sapphi compute nodes and um yeah and so so essentially as a a node operator I can't see the runtime State um I can't see the the call data that's being passed to the contract and um I can see IO uh on the dis um so yeah I I think the the next point though is uh we have a confidential evm that
that's great but what can you do what's the Next Generation so we're going from the the current set of ideas that we have for smart contracts what can we do with this and why do we need privacy so I think it'd be be interesting to to think about well if you think about privacy initially think Monero zcash uh but I think that's a pretty small part of it and if you think about like protecting your Healthcare data that is pretty essential so we're getting closer to why we need privacy but privacy and confidentiality is it's a part of everything we do every day on every device and um it is pervasive so the other problem is is
like data is a bit like nuclear waste or microplastics or sort of asbestos where you can't really recycle or dispose of data very easily and it it collects everywhere in places that you don't necessarily expect uh and once it's out there you can't really put it back uh so it took like 10 15 years for SSL to become a standard and a handful more years for like Drive encryption to become you know the norm so everyone's phones the laptops are encryp encrypted by default but just as we started to encrypt all the devices and the servers uh everything moves over to the cloud and on the cloud it's sitting basically unencrypted so while the drives may be encrypted uh you know the CIS admins can
still see the data the hackers can still see the data and we have no idea you know if the software that that's accessing and modifying this data has been changed or even you know has it been deleted when we press the delete button so now we're putting all this like unencrypted on the the problem is now we're putting a lot of unencrypted data on the blockchain forever and I like to think of this as being uh like the the elephant's foot uh in the Chernobyl reactor where it's like a disaster that's waiting to happen and we haven't really had the marketeers take advantage of this but I can imagine a slightly dystopian future where we're getting personalized recommendations based on my spending
history and then I'm being exploited and manipulated or or something like that and uh essentially I'd like to live in a future where everything's private by default rather than having to try very very very hard to to make things private um but if we look at uh use cases so privacy is one side of things but there are there are situations where you really do need uh to hide information from other people so one of those is like the uh the bidding process and auction so you can think of like a dark pool as being a continuous Perpetual auction and uh to
give you a good example of without some degree of privacy or or uh without a blind auction if you have like all of the stock at the same time released onto the market uh and there's a huge rush you get lots of bots and scalpers uh that creates pressure on on gas prices so the gas price increase increases and this uh you know the RPC servers may have problems and uh other applications suffer on the Chain uh and all all of that's because we have like a an inefficient process of first come first serve uh you could I'm using blind auctions as an example because it's one of the examples in the solidity documentation so whenever we see this problem happening on chain there's a solution to this already uh but you can
do it on ethereum and you can use a commit scheme or you could do it on uh Sapphire on a confidential evm and you essentially get blind auctions for free so instead of having to design a scheme uh you just write your auction contract as you normally would and interact with it in private and it does what it's supposed to do uh there we go so the other quick problem is that with uh privacy coins I I think it gets quite a bad rap and I I really want to say that uh 2025 is going to be like the year of privacy coins so if we stop thinking of them as as being like some kind of criminal element or uh you
know uh they've got a bad reputation what about just my spending with my card can we have a like a serious pragmatic conversation with Regulators to end up with the system system that we already have in the real world but on chain and I I think it is the only problem there is that we don't want The Regulators to take the benefits of defi out of this but I do think we do need privacy uh on chain for as many things as possible um the other question is confidential nfts so uh you can't really sell data if everyone can just access it and scrape the the the nft database so one thing we're doing with with
confidential nfts is to be able to have information that only the current holder can see so this allows you to have a uh content gating or like the high resolution versions of uh it or it can generate access URLs for uh so you can download it off of Amazon S3 and the other question is about uh like the fog of war and or on onchain gaming and uh you can't really upload all of the the game data to the blockchain it's just far too much so a lot of people look at procedural generation of content and if you have a procedural generation a lot of people uh you want the content to be new and to be exciting and but if you can see the seed that generates the
content especially if there's money at stake or if it's a play to win game uh you can exploit the system by predicting what's going to happen take one route or the other and uh I think uh yeah so uh I I think the key Point here is that uh when you have a confidential evm that has like a built-in random number generator you can uh keep the story secret you can let things unfold you can have like PVP battles where there is a a bit of unpredictability so you can do a Faceoff battle with somebody else and you legitimately don't know what's going to happen um and the contract because everything's running in
private uh it can play this out for you and likewise with loot boxes because it's onchain it's provably fair uh rather than just being on on some server somewhere now to come to like the encryption and uh into an encryption an AI which is like a fairly Hot Topic at the moment I we do have one example of of like a real dap that's running on a chain that is using uh Sapphire for confidentiality and if you're making predictions the value of your prediction is the the track record of how many how frequently have You' been correct and if somebody else is able to see your prediction uh and copy you because they know you've got a
good track record the value of your prediction goes down because lots of other people are essentially just you know devaluing your your your effort uh so this means that uh we an app called U predictor by uh ocean that uh you make your predictions you can you can purchase the prediction feed and um it's it's all attestable it's all onchain and so on so forth uh so we do have a a Sandbox and a playground where uh you can Fork a bunch of different applications uh lot of the front end setup uh it's a really really good point to get started and uh to sort of accelerate uh the
development so the the next to of get back on track um yeah so we're doing confidential smart contracts I do think this is like the next generation of things and we do want to solve some bigger problems I I I want to think abstractly about well what is the current ecosystem what gives value to uh the smart contract ecosystem and how can this differ when you add privacy into the mix of it so uh yeah it's very important to have composability so that's contracts that interact with each other and they're programmable and uh functionality can be added on later by anybody uh so that means you can make it do things that it wasn't initially meant
to do and if you have a like a pluggable architecture if you have to design everything up front and do it Al you know design algorithms for this or be uh create a multipar computation system then that means that you have to think of everything everyone could possibly do up front but with a uh confidential smart contracts this means that you can let it evolve over time and especially when it's basically as fast as as uh ethereum is normally but withed privacy uh that means that uh you don't really get any uh you're not weighted down by uh you know having to make proofs or
having to set up lots of uh uh nodes for the multiply computation and it means that uh you can watch it evolve over time uh but there are some sort of disadvantages in comparison to regular evm so one of those is that well now you're running in private uh you could have a side channel so the the amount of gas that your contract takes can reveal the internal state of you know what code path it's taking uh and also we don't allow impersonation so on ethereum you can simulate a transaction uh from anybody and and see what it does but uh if you're in a private context you don't want people to do that so if I my password manager on chain I don't want
someone to pretend to be me so we do have to think about uh how do we create new authentication mechanisms and one of those is like the login with ethereum so you have your uh login cookie that you pass to the smart contract uh to allow you to see your own data uh and also we can start thinking differently about how we can tackle problems uh one of those is well in a private context uh you can generate key pairs with the random number generator you can sign with a variety of different algorithms uh you can do encryption and decryption and you can do hashing with uh algorithms that are used in the real world and if we think of what could we really do differently if both sides of
uh two chains were both running trust execution you could keep cut the bridge out entirely and just pass signed messages back and forth from each other so I'd like to uh uh invite somebody on stage who is uh thinking differently in building on Sapphire to uh give us a couple of minutes this time thank you Harry um yeah so I think we have four minutes remaining so I'll just quickly show what we're building why we're using o saire my name is Maas I'm the CEO a co-founder appon and what we building at appon is basically abstracting all the blockchain logic and creating simple apis for web 2 developers to enter the space of web three um by us doing the
heavy lifting uh creating let's say the complete abstraction on different chains at the back end and then creating sdks like for JavaScript typescript flutter and so on so we can start onboarding the next wave of users into the space and talking about users this is still the biggest issue how we want to get the next million users who are not let's say weet natives but actually users who are using Instagrams Netflix and Etc today this is the biggest hurdle for web to develop developers to start onboarding them without exposing them to the let's say fiddling around with preed with the seeds storing the seed phrases somewhere storing them securely so oh oops so what we've done here with Oasis
is basically um we're today launching the account abstraction SDK together with Oasis so as a developer entering the appon platform um you're able to basically just call SDK we will call Oasis and Oasis trusted execu environment will create a wallet on the behalf of the user and store the private key for the user so the users never get actually exposed to managing or having to manage the private key themselves it's everything is done in a trusted executional environment the keys are never exposed but for the user perspective and for a developer perspective they can normally onboard their user like email and password Google sign in Facebook sign whatsoever but the user is equipped with a true web
three wallet the user once they get more familiar with and once they're more in expert mode they can start exporting their own private key from the wallet and take control out of it but it's least the first step to kind of start onboarding users giving them the benefits of nfts loyalties proof of attendance uh incentives and so on what basically web developers are seeking for and how nft technology basically should be used when we come to web 3 um thanks to ASIS and having really this cross chain compability uh as an example once a developer starts building an app and flutter uh they can say I just want the second the user signs on I want the user to have an evm address on ethereum on poot on tesos on whatever chain you can just basically tick the boxes and the
users will get equipped with all those wallets and they can start integrating those wallets into the web to application um From appon perspective so I encourage everyone to basically join our broad community of developers so we've launched our platform back in February last year we're now over 200 20,000 developers SL users already on the platform basically living the life or living the way in a very familiar fashion uh like they use from web web 2 world so they're exposed with services like storage Computing identity smart contracts um but they never get actually in touch or they don't see any web three terminology right so we do all we do all the heav lifting so that web to developers coming into the space don't
have to so that would be from my side um quick demo or let explanation how leverage a trusted executable environments uh if there are any questions for me or Harry um happy to take any questions thank you [Applause]