Secure Enclaves Incorporated
ETHCC 6 · July 2023 · 12:23
Nalin Bhardwaj examines combining cryptography with secure enclaves available in consumer devices. The speaker demonstrates a password manager and stablecoin wallet and considers the role of enclaves in Ethereum applications.
Speakers
Topics
From ETHCC 6, hosted by Ethereum France.
Transcript
[Music] [Applause] thank you hello everyone hello hello everyone I'm Nolan um and today I want to talk about secure enclaves and how we can use them to deliver excellent products using modern cryptography this is Joint work with DC Bosch who's here in the audience we're both building Dimo which is experimental payments app on ethereum so first before we dive too deep I want to first talk about why we care about consumer products we think the maximum
liberatory potential of cryptography is unlocked in this form factor of consumer products um and so this is not something new um you know over the last 30 years between things like pgp or uh keybase or password managers and apps of this sort we have seen a lot of value delivered to Consumers from cryptography but uh they have all been limited uh by some shared set of problems and the issues that sort of hinder their potential can be bucketed into two categories so first being the cryptography stack is perhaps non-mature enough to support them and the second being the consumer device hardware and software stack is just not
good enough to build real world security applications so for instance you could think of you know whatever bespoke cryptographic protocol you can come up with but then at the end of the day like your actual real world security is limited by the entropy that can be stored in a password that's in a human brain right so uh that's about sort of what has been going on in the past uh the main reason uh I want to talk about uh this this trend today is that I want to point out that at this very moment in time something very interesting is happening uh and between these two Circles of better cryptography and locks and better Hardware unlocks we have some uh interesting opportunities to build uh new and exciting products
uh and so what exactly are these trends that have been going on so in the hardware category the biggest unlock has been uh the ability to use a secure Enclave so how many of you have heard of a secure Enclave so a lot of people um and maybe even like I I think every device I can see in this room at least uh is one that does support the secure Enclave or some form of hardware-backed te um and so just to recap what a secure Enclave is at an API level is really very simple for an application Dev they have the ability to interact with the private key and all they can do is either encrypt decrypt messages or sign messages and obtain signatures under hood something very interesting is
happening with tigers in that they're completely disparate Hardware module and what this means is that there is essentially no way to break into this Hardware module to extract the private key itself and you get essentially the best practice security you can ever get in a consumer device and these are you know usually authenticated with some kind of biometric scan like your finger scan or your face ID that kind of thing so they're really The Cutting Edge of what security can be delivered and so on the other hand in this other Circle we have you know modern cryptography has given us a lot of unlocks so this includes things like blockchains with programmable accounts things like NPC ZK all of these kinds of things and in fact using uh these modern
cryptography tools paired with secure Enclave Keys we can really unlock the potential of what applications to Consumers can deliver and so if there is one point you should take away from this talk the main overarching point is that there's a lot of opportunity to build cool things at this intersection of cryptography and secure enclaves at this moment in time and we have been exploring this Forefront ourself and I want to talk about two of the applications we've explored using this exact sort of formula of building building consumer applications so the first is a password manager uh best pass so the status quo of password managers most of you probably already know kind of sucks there's like all these apps that use really old world cryptography
very unsatisfying security assumptions like Master passwords and whatnot and overall they just generally suck um yeah and of course in the real world this leads to like all sorts of problems you have like LastPass which depends on Master passwords and of course it got broken into six months ago the most popular open source password manager bit Warden has a cryptography design that's very questionable so what does it look like to build a password manager that's correct so bestpass is a fix to all of these problems so we use secure Enclave based Hardware locked keys combine them with secret sharing to split the secret across multiple devices and support Multi-Device in general for a user and you know we have the Best in Class
password manager so that's best pass it's a new kind of password manager that exists in a proof of concept State on my GitHub if you want to check it out the other application I want to talk about is dymo uh with daimo we are rethinking how individual users interact with blockchain apps and sort of what the personal experience of a crypto wallet today is um and uh to come back to this like two circles thing all crypto systems like pgp or whatnot you know they relied on sort of long-lived Secrets shared between many machines um and in fact you know that's how ethereum accounts work today but modern sort of security best practices have shown us that for one we want secrets to be ephemeral and then two we want them
to be machine generated never leave the device and definitely not interact with humans um and so uh for ethereum in particular the problem one of ephemerality is solved by account obstruction really well we're able to do key rotation and for instance if you lose a device we're able to Simply remove the device from Authority um and for two the problem of having human stored paper Keys is solved really well by secure Enclave based key pairs so together we can a wallet done right and we get a huge win for both security as well as ux uh and in practice daimo manifests itself as a pure payments app you can
send and receive usdc to your friends and family you get like the all the immutability security properties of the blockchain um you get like uh because the keys to the nearest security if you get like that your coin your key or your key your coin properties that you expect um and we support multiple devices uh key rotation secure backups all that kind of thing um and we want to do things right end to end uh dymo is open source GPO V3 you can send and receive payments to anyone on ethereum ens everything else we're going to use eib4 or VR using eip4237 account abstraction so the overall ecosystem of solvents and overall with dymo we really want to focus on building a secure simple and performant
experience for blockchain payments so we want to get something that feels like venmo but lives on ethereum um so we started pretty recently uh in last or late May and we have all of these proof of Concepts and we're going to launch a test slide soon you can sign up here to stay updated and so we hope this talk was helpful in sort of expanding your imagination of the unlock secure on place can deliver and there's a lot more that I sort of didn't even go into like with Device adaptations or ZK snarks and other cool capabilities they can unlock but overall I hope this was interesting and inspiring and we're happy to take questions foreign
very expensive you put their two bucks 50 or whatever uh how what would be the cost there to do that great question so we're actually based entirely on L2 and DC do you want to sure um all right and say a few bit to that uh but yeah so it's good it's going to be not certain of which roll up yet but like all on on on a roll up and so then our goal is for it to be like five cent transactions so why don't you use a multi-sig in this wallet so we actually get better properties than a multi-site so for one we have the ability to do key rotation so if you lose a device we are able to get um that device removed from account
Authority okay and last question uh and clubs can be if you get a subpoena uh you can they can they can they can get during club anyway because it's a manufacturer right so it's not that secure not necessarily um it's different from something like sgx where you have like you know attestation that's like rooted in you know some manufacturer key the way secure enclaves work is they generate a key that is Hardware locked and never leaves your device and uh yeah I don't I haven't seen evidence that that there that it's like backdoored or backdorable well I'm pretty sure that a subpoena can
get that key I mean if if you have 10 billion dollars stolen uh they can get the in club I'm pretty sure look at what I mean in the case Ledger even said that ledger said that they I mean if they subpoena Ledger um the manufacturer is the one that right yeah I don't think for I think I know what you're thinking of you're thinking of The Ledger like custodial backup thing that they released recently but we're not going to do that go for it so maybe two things to point out there one these secure entries the ones where you depending on are the ones built by Apple and they're built in at the time of manufacturing there's no
upgradability or firmware edits you can make so at the very least you need physical access to the device to be able to break in and so that's like sort of the minimum bar wait we should take there's one guy who's really we are we're really sorry but we don't have enough time for a lot of questions one last question and after uh you can ask speakers any questions because we need to go to another sounds great you want to do that go for it um this is okay okay for the secret Enclave part the thing is like the the curve that like doing the cryptography is not like the ethereum curve so the thing is that like when you use secret Enclave at the end of the day it just to authorize the the transaction that happening and
secure the you know the the private key but like it's not like signing with your with your face ID right because uh I'm working on working on that though so that's why yeah that's right it's basically you're signing with a key that lives in the secure Enclave on the phone and there's a secure Enclave separately in addition to that does things like enforcing pin attempts and and face ID for the phone so you just be like validating and after that you unlock the the logic to signing the transaction with the normal ethereum wallets that is on the phone yes no maybe one small addendum to make the key that signs the message is a p56 key and the key lives in the secure Enclave we never have it in memory or in the regular Ram or CPU
disk of the device we use account abstraction on ethereum to support p56 signatures okay I think he's just talking about the usability like the user experience of it which is like yeah you authenticate to the phone and then it signs a transaction that goes out and the blockchain to the account obstruction stuff too okay yeah yep okay thank you very much um oh QR code yeah um we don't have any more time for the questions thank you you can ask speakers in the private discussion and our next topic it's a role of the FI and the regenerative Finance in Africa we will start to prepare for this topic [Music]