vetKeys: How to keep many secrets on a Blockchain - Aisling Connolly (DFINITY Foundation)
ETHMilan 2023 · 12 Dec 2023 · 21:43
Aisling Connolly of the DFINITY Foundation introduces vetKeys, a verifiably encrypted threshold key derivation service on the Internet Computer. The keynote explains how a master key shared across nodes derives keys that reach users encrypted under a transport key, so smart contracts can support encryption, decryption and signing without ever seeing a secret. It also touches on cross-chain signing with Ethereum and Bitcoin and on community bounty projects such as encrypted forms, medical prescriptions and time capsules, closing with an invitation to build privacy tools.
Speakers
Topics
From ETHMilan 2023, hosted by ETH Milan.
Transcript
thank you very much and uh yeah very happy to be here I think it has been super nicely organized so far so well done to the team here um yeah so I would like to talk to you about vet Keys uh there was a bit of a typo in the program so uh the B was missing but we'll get to that and it's quite nice to actually be one of the people speaking towards the end of the conference because you kind of start to see what everybody knows what we kind of all agree on where is the kind of level in the community you see that that you know privacy is an okay thing now everybody is okay to talk about it you see that l2s are flying it's a goer we're actually going to build stuff it's not just about transactions anymore it's like okay
we're going to build Tech now actually and we're going to build systems and we're going to build actually the foundations of the society that eth promised us all those years so that's a little bit of a context to say that actually we are there uh if we want to do these modern societies uh they're built on digital Frameworks and this includes all sorts of stuff like Social Media communication storage sharing Financial system supply chain medical records like all sorts of stuff is delivered online with tech Stacks so if we are going to do all of these things and actually build this thing like future and society that we want uh it needs to be done with interesting INF
infrastructure and so a question is what kind of infrastructure should be should that be Google should that be these kind of big corporations should it be uh the types of people who can do censorship or who can do change things or yeah whatever like it's uh they can charge what they want all this kind of stuff so building this kind of new modern society that we want the kind of Promise of e and Bitcoin at the beginning kind of takes yeah maybe a more decentralized uh Tech stack so with that in mind this is kind of our goal where I see the whole industry and the whole conference is at now we're kind of all there yes we are
going to build the tech uh how can we actually do that and so as I was introduced they said that I was from definity I am a researcher there um and definity is one of the major contributors to building this internet computer and there's a whole bunch of stuff that exists already that is kind of getting us on this Pathway to this uh new utopian Digital Society so I wanted to put in context a little bit the Privacy Story by introducing some of the features that are kind of getting us partially there so one of them is this verifiable web so one of the big problems with the internet as it exists today is that uh things are not verified
very well and so if you're looking at a deep fake or if somebody's kind of spamming or some things can be yeah it's like not always clear who who you're actually talking to or who is actually communicating with you so it would be much better if we had an internet where we could do verification and we could trust the actual things that we're seeing and this would be really great so uh one thing that we can offer today already is this verifiable web because the structure of the internet computer is kind of built up in such a way that everything communicates every message assigned everything that's passed around is managed like and verified by this one single public key this is like our God key that we can all kind of uh
raise our hands to and phrase the key but there is one public key uh from which everything that happens on the internet computer can be verified so if you're running uh any sort of computation in a smart contract or if you're engaging with the blockchain from the internet everything that you receive will be signed with this key the actual key is there that's it uh you can go and uh put it in your pocket and save it for a later day when you actually want to verify anything that comes from the internet computer the things that you can do with this key are yeah verify interactions so if you're talking to the machine you know that this is the machine the correct machine it's not somebody uh there's no kind of man in the middle attacks or
anything like this and you can also verify correctness so any computation that is done you can verify that it was done correctly that's that uh oh I went too far the next thing is multi- chain so now that we can actually uh know that we have some security or kind of some safety in who we're talking to let's start talking to some people and so uh one of the things it would be nice is to be able to talk to other blockchains so operating on the internet computer is great but um there's a lot of activity on ethereum and there's a lot of kind of security and great properties and we're all here because of ethereum so it would be good to be able to talk to ethereum and so we can um we really wanted to kind of build this idea
of the world computer where you know you have Bitcoin as a very nice store of value ethereum as this very nice kind of computation very security intensive uh decentralized layer and then this kind of Internet computer to bring everything together we can talk to other blockchains now via this uh threshold signing that we have implemented in the internet computer so these notes uh which are equivalent to our valid s are connected via subnet they can sign uh they have secret shared keys they can sign a transaction which is essentially the same as your wallet signing a transaction uh to the ethereum blockchain so it acts as a proxy for you
uh we can also talk to bitcoin and uh yeah uh canister so these uh little cylinders on the subnet are canister so these are representing our smart contracts on the internet computer and these can also assign Bitcoin transactions natively and uh then there's a kind of Bitcoin twin which can act uh as a currency inside the internet computer for quick and uh cheap uh Bitcoin transactions there so then now that we can talk to other blockchains maybe it would be good to talk to the internet some people call this the Oracle problem I like to say let's just talk to the internet can we
do this yes we can um so we also have a way to talk outside of the blockchain um canisters so these smart contracts on the subnet call uh to web 2 the nodes or the validators then go get that URL the servers return the URL I'm being very quick but like just to give you an overall view of what some of the things that are possible uh then the returned uh information from the servers goes through consensus in the notes and then it's verified to be correct uh by the design of the system and is delivered to the canister so this is a way that we can talk to the internet and so uh this is very nice it means that you know web
3 and web 2 can be this kind of Continuum it's not the case that there is any sort of separation between blockchains we can talk across the internet we can talk to everyone now this is great so what to do uh now that we we have this kind of at least most parts of this utopian Tex St that we want maybe it's time to start using it in the real world and this is where gets crazy sorry for swearing but uh so right now the Tex stack that is used by the real world is Google Microsoft Facebook blah blah blah if you want let's say your passport to be issued uh digitally if you want I mean pretty much anything in your day-to-day life to be
done digitally it's going to be a big Cor operation that's doing it and when it comes to Identity and like your life maybe that's not always the best thing so it would be nice if we could have some kind of private way of doing these things and in a decentralized way so you want all this nice decentralization but at the moment all this nice decentralization is very public and that doesn't work when you want to get something like a digital passport uh the other thing is that yeah Google can send answer stuff they can change what you see they can change your user base they can change a lot of stuff this is not good so we don't really want to depend on corporations but at the
same time for some things like passports or national things it's uh not so good to be working fully in the public so this is why we come to the last kind of problem of privacy and uh what we wanted to kind of talk about today was a method that we have introduced um a tool an API that people can use to actually get the keys that can give them the Privacy that they need uh in a very kind of seamless and easy way so uh how do we do this here we go into a bit the uh fun technical side of stuff so earlier I said that canisters so these uh smart contracts can create and sign transactions on other blockchains so if
you want to think about privacy and actually getting privacy in an interesting way um really all the change that you need to do here is that you want to sign and also encrypt and decrypt and maybe arbitrary data rather than just transactions so instead of just signing transactions it's like okay I can also sign I can also do decryption I can also do all the kind of fancy cryptographic stuff that we like to do with keys so this is the uh Love Letter to Keys basically so um yeah this is the goal of vet keys uh so how does it work it's just a threshold key derivation so I don't know if you know much about cryptography or
if you have any experience but key derivation you can think of it like a password if you put your password into a browser and then you it's stored somewhere it's often kind of a new key is derived from this it's just this this is kind of the 101 of uh sort of privacy online so uh there's one master key that is secret shared across the nodes um and then these from this master key the uh derived key is derived um any like 10 points to the person who starts to see something already wrong with this picture so I said that the goal is to get a key that can help us to do uh encryption decryption signing and stuff like this but I derive this key and I send it
straight to the canister in this network which I'm claiming is public this is not necessarily good if this should be a private key it should not be seen by anybody and so yeah the canister can see this key this is not good so we need the key to be encrypted uh it needs to be return to the canister in an encrypted way so that the canister or the smart contract or the network or whatever cannot actually see this key and use it um how to do this the normal way uh you the user will generate a transport key pair so that when they actually ask or make a call for this uh vet key for this derived key they also send a public key under which the uh nodes when they're deriving the
key can encrypt and so then they send this encrypted key back to the user then the user can use the secret uh transport key to decrypt and actually retrieve the vet key and use this for uh signing encryption and whatever else they want um that's that then uh to as a little note vet keys are deterministic IC so that they can be retrieved later and this is why we have this uh derivation ID here so like it's not very useful if you can just generate a key once you also want to be able to come back later and say ah hey remember that key you gave me I now want it again
to do decryption and so this is why we have the derivation IDE uh finally as I've mentioned before as well by the kind of design of the system uh the internet computer has this verify verification process say so every computation that happens is verified and shown to be true and there's no different here and so this was the V that was dropped from the uh the program so yeah we have this verifiably encrypted threshold key derivation and this is now vet keys so if you see vet keys anywhere hopefully you know a bit more about what it is so now that we've talked about what it is um it would be nice to see what can we
actually do with them uh or well there's a few things this is the slide where I'm supposed to lose you it's uh if you are into crypto this is maybe more interesting if you're not uh bear with me for a minute so uh vet Keys came from a paper the paper was uh released earlier this year uh it's on print you can go check it out it's a lot of um description about the scheme it's the it's proved uh and very interesting ways so yeah take a look at that um it leverages the fact that BLS signatures are also decryption keys of abon Franklin ibe and this is where we get the encryption side from the uh derived key because the drive keys are BLS
signatures but then they can be used for encryption uh it uses elgamal to do encryption of the key share so the transport key that I said that uh allows the key to be sent back to the user without being seen by the canister or the network along the way um there we use elgl and the reason why we used this is because it's very nice in the sense that it has this additively homomorphic property because if you start to see how can we uh encrypt pieces of keys and then somehow put it together and still somehow know if this is a good key or not because if we don't know if it's a good key or not the machine won't go because it does this verification and everything so um elgamal salves this
very nicely and everything just works completely easily um there's an API which we are posing it's still open for discussion it's not implemented yet um it's available and the full integration is coming up the expectation is that we can generate hundreds of these Keys per second so it's pretty efficient um now I let me talk a bit about the uses of that Keys uh one of the main kind of easiest things to see that these could be used for is end to end encrypted messaging and if you don't know about identity-based encryption this is a very kind of of nice use case so now the way end to end encryption usually works is
that I have a key yeah I mean there I won't go into it but uh a very easy way to do this with an identity-based encryption scheme is that I as let's say Alice um just encrypt a message to Bob under his public identifier which can be a key can be a wallet address it can be an internet identity it can be whatever it's just some public identifier that is Bob's and then he Alice sends the cipher text to Bob Bob then calls to this vet key API to say hey can I retrieve um the decryption key for this public identifier it will derive the encryptor key send it to him he decrypts it and then he can use his decrypted vet key to decrypt the message from Alice so this
is one kind of quick and easy way to do and to end encrypted messaging for example with vet keys and so there were some nice talks yesterday yesterday about encrypting transactions in the mempool and we were kind of watching it because we do something very similar and uh or well these could be used for something very similar and I really loved this talk and this organization because I think they're doing great things and so I want to encourage lots of other people to be like them and do other interesting kind of privacy things like them and uh please start here because this would be great I would love to see this another thing is yeah the front running protection so this is exactly what I mentioned um there uh
there's this problem or not problem this is one of the things that I learned over the last few days that it's kind of unclear whether front running is a problem or not because it can be quite a nice security mitigation but then it's also something that harms users a lot so um yeah anyway if somebody would want to do front running protection um you can use vet keys to do it in a kind of nice way so the user would uh encrypt transactions to the Future so say a a block a future block number and then sends these encrypted transactions to aex aex commits to some ordering of them and then uh later when that block is reached the dexs can uh request its vet key to decrypt the transactions and
actually execute them and another thing is seat phrase backup so this is something that a lot of people struggle with they lose uh their keys uh they lose their seat phrases and um they don't know how to get back into their wallets so one thing that a user could do here is requ request a vet key under a given identity encrypt their seed phrase under that and then later if something happens or they need to reconstruct their wallet they can request uh the vet key under their public identifier and uh decrypt the seat phrase and so this is actually a community project it's something that's bu being built by someone in in the community at the moment and another thing that's being built by someone in
the community is this sort of uh variation or extension of the dead man switch so that they have this problem that they have a substantial amount of Bitcoin that they want to pass on to their kids when they eventually get old and don't want to mine their Bitcoin anymore for whatever reason um yeah so the question is how to pass on bitcoin keys in the case of a b event and there uh they let's say encrypt their Bitcoin keys to their kids identifiers such that later in a point in time whenever maybe someone dies or something is wrong the kids can actually then uh request uh vet key to decrypt the Bitcoin keys so this is also a community project something
that is being built uh at the moment so that's kind of the most some inspiration for you of I think things that are uh um that we'd love to see being built and companies that we'd love to see started to actually go and do these things properly we put the tools there now we're asking you to pick them up essentially so uh just one last thing I wanted to tell you about we had these vet Keys bounties so we kind of proposed this API put it out there but we also wanted to somehow incentivize developers to actually pick up the tools start playing around with them let us know if they actually solve like uh serve their use cases if they find anything wrong if they have any suggestions all this kind
of stuff we just wanted some feedback and so we had like many nice submissions um but I wanted to show you just a list of the ones that kind of won some prizes in various categories in these vet Keys bounties it's also just a bit more kind of inspiration of the kind of variety of things that you can do with vet Keys it's very kind of a super versatile tool so um there was a document-based proof of personhood where they were deriving uh keys from metamask addresses and doing all sorts of crazy stuff um uh I just check the time and then form thing end to end encrypted forms so these are kind of all the little ways that you can see how to maybe start replacing the traditional text dock um rabbit hole is
a encrypted file service there was a browser based AI chatbot where the conversation between you and the chatbot was encrypted ER nost so there was a simple Noster client running on the IC where they do Key Management with vet Keys uh Med PX where they are keeping um electronic medical prescriptions encrypted and then the user or the owner of the prescription can reveal it to whoever they want uh there was a time capsule that man switch for files so this is a classic case of kind of interesting thing for journalists often uh there was a note sharing application and there was Guild notes which was yeah uh encrypting and sharing
role-based content in a gaming community so and these are all of the the some a few of the front ends and I kind of wanted to put them here to say one last thing is that also these are hosted on chain as well so all of the front ends are hosted on chain so given that we can talk to other blockchains given that we can talk to the internet given now that we're getting privacy this is kind of the kind of future reality that we hope to see actually emerging and yeah that's it for me so if you like I can answer any questions but I would really just urge you to go and build some privacy stuff because it's now kind of easy thanks very
much
Related talks
- Aisling Connolly - vetKeys: How Blockchains can keep many Secrets
- Maclane WILKINSON - DECENTRALISED KEY MANAGEMENT
- What's Buried Under the Identity Stack? A Talk About Real Privacy
- Best Compute Over Private Data Application/Protocol - ETHOnline 2024
- KeySpace: End-to-End Encryption using Ethereum and IPFS by Samuel Walker (Devcon5)
- 🟢 LIVE SPECIAL: Charles Hoskinson & Mert Call In On Today's Show
- Managing Secrets in your DApp with NuCypher by Justin Holmes
- Privacy Means Having Space to Be Yourself
- Ais of TACEO @ ZK Hack Meetup in Denver, 24 Feb 2025
