Privacy in Cosmos Live: Max Hampshire (Nym) - Anonymous credentials on the blockchain
6 May 2022 · 20:51
Recorded live in Amsterdam at a Zero Knowledge Validator event supported by the Cosmos Hub, this talk features Max Hampshire of Nym explaining Coconut, the project's cryptographic signature scheme for anonymous credentials. Hampshire covers how Coconut shifts web authentication from proving who a user is to proving what they are permitted to do, and details the role Nyx blockchain validators play in issuing these privacy-preserving credentials.
Speakers
Topics
Transcript
and uh next one on the stage is max hamshire so here you go um where's the uh there it is brilliant thank you hi everyone oh bit sensitive that there we go so hi i'm max i'm the developer relations officer for nim and what i'm going to be talking about today are anonymous credentials on the blockchain so i'm going to be talking about our coconut credentialing system and our nix smart contract platform now if people have uh heard about him before then most of our communications recently have been very much focused on our mix snap so i am going to go over that in this talk as
well and then i will talk about the credentials and the blockchain very much kind of in context of excuse me what they do to actually support this mixnet as well as the kind of fun application level stuff that you can build on top of it so what's on mixednet the mixnet is a a multi-purpose mixer basically it provides network level anonymity for any kind of uh network communications and the way that we've built it it prevents traffic analysis by adversaries like the nsa which is something that existing privacy solutions such as tor have are maybe a little bit weaker against i'm also going to talk about yeah like i
said coconut coconut on the surface of it basically just allows third-party apps to anonymize any arbitrary key value pairs so quite similar to what um was just discussed with ssis we can basically have stuff like users dictating whether they actually reveal part or all of a credential that allows them to do something and then finally i'm going to talk about nics which is our blockchain and basically nyx is our cosmos chain that we've been using to host our cosmos and smart contracts that have been keeping track of both the nim token as well as looking at the rewarding system of our mix now over the past year the test nets we've iterated through and now the main net
that we launched last night [Music] before i jump into those i think i'll kind of i'll talk about the justification for why nim actually exists and it comes from this basic premise that the internet as we currently have it is broken uh the internet wasn't made with privacy in mind we've had privacy features kind of bolted on in a relatively ad hoc way over the last couple of decades but none of these solutions can basically defend against the kind of global passive adversary that stuff like the snowden leaks showed were monitoring the internet you know metadata is leaking even if you're using something like signal or a private um you know privacy preserving cryptocurrencies like zcash you're still
leaking metadata as to you know when you're sending transactions what your ip address is and all of this can be used to de-anonymize you vpns and dvpns essentially move the necessity of trust from you to them and like i said even tor can't actually defend against adversaries that can monitor the inputs and outputs of the entire network however tor and signal and the increase in popularity of them uh since snowden basically shows that there is actually a massive demand for privacy but both tour and signal and this has become really apparent during covid really really relied on a lot of public donations that kind of has uh
dropped off in the last couple of years when really that kind of funding should have been scaling so our solution is the first of its kind in the it's the first incentivized mixnet that we know of uh other mixnets have existed mix minion being probably the most famous of them probably the one that satoshi whoever they or the multiples of they were we're using to send emails into the mailing list that we all know and love and yeah the mix now like i've said i'll skip that the first network component so how does the mixnet actually provide this metadata protection and data anonymity
much like tor when you route traffic through the mixnet it's encrypt multiply encrypted and it goes through multiple hops what this does is it unlinks the origin of the message and the destination each of the mixed nodes as well as the clients that are communicating with the nim network however also push cover traffic right so dummy traffic into the into the mix net and are constantly passing it between them one thing i should also note when your data leaves a nim client it's encrypted uh in the sphinx packet format so it's the same packet format that lightning uses and it's chopped up into identically sized packets as well so now if we're looking at the traffic what
we actually see are identically sized identically encrypted packets that are also hidden in the crowd of kind of dummy traffic that's being sent around so you can already see just from these steps something like um you know traffic analysis attacks become almost impossible to perform on top of that as data moves through the mixnet there's a small there's a variable timing delay that each packet that is applied to each packet before it makes one of these hops again as soon as you have now a crowd of identically sized identically encrypted packets all of which may or may not actually be being fired in order stuff like traffic analysis tax becomes almost
impossible and the scalability of the mixnet is something that has become very important and is also something that the incentivization that we have with the nim token uh which is a the utility token kind of powering the network allows for so tour at the moment has about six thousand nodes it's had six thousand notes for a while and it will probably have five or six thousand nodes for quite a long time however you don't always need that many nodes mixing traffic depending on how much demand there actually is to the network so we are actually able to scale and shrink more importantly the network as required and here is a kind of a yeah a high
level comparison of the kind of um the kind of network stuff that you can that you can see if you're able to observe from a user to a service or a user to a user uh with these different networks so with the vpn you can still see traffic coming out there's no timing delays there's no you know the size of packets can also give a lot away about what that data might actually be referring to and then used to de-anonymize you similarly with tor you know packets can also be doing otherwise like this whereas with nim if you're actually able to observe the network all you're seeing is identically sized identically encrypted packets flying around there's not that
much you can start to infer from what the relationships between the user and the service or a user any user might be and yeah this is just a slightly more detailed explanation there [Music] so now the mixnets now i've kind of gone over the mix now let's dig into the maybe more cosmos related side of this and this is also stuff that we haven't really been talking about too much publicly yet so i'm excited to share it all with you so what are coconut credentials it's basically our cryptographic signature scheme that produces privacy enhanced credentials and users
basically will pay nim tokens to our validator set to create these credentials for them the kind of conceptual change that we think is really really important to highlight with this is it shifts the question of authentication with the credential and by credentialing you know you could also think of something as simple as like a javascript web token as a contrast maybe instead of asking who a user is when you want to log into github it wants to know that you're you with a coconut credential it shifts that question to does this person who actually has this credential have the right to take the action they're asking does this person have the right to log into this github account
does email address take part in this kyc the way the credentials are actually created so they're blind signed and what that means is that if i want to if i approach our validators i ask them to create a credential for me instead of saying hi i'm max could you make me a credential that would allow me to log into github what i would actually provide them with is a zero-knowledge proof that i am actually able to take this action so they don't know what it is that they're signing so even the validators are not actually able to start de-anonymizing the people who are asking them to make the credentials for them they're also re-randomizable and what this means
is that if you if i produced a credential for someone that for instance had the same identifier if that was used over a period of time you might be able to start to de-anonymize the person who is using it because you again it's leaking metadata maybe you can see what time they're always using this credential or what ip address is coming from something like this re-randomizability means that you can reuse the same credential but the people who you're presenting it to are never able to make a link between the first or 50th time you might actually be presenting the same credential to them the actual generation of these
credentials as well is split between our validator set so each one of them will only be producing a fraction of a single credential that they're blind signing that's also re-randomizable so again as these kind of uh as these characteristics pile up you can see that we're really starting to break a lot of the potential for de-anonymization with their use and yeah like i said before their selective disclosure credentials uh the example that came up before we checked with um if you're having to prove that you're over 18 then yeah you all you have to do is prove that you're over 18. you don't actually have to say how old you are nor do you have to show you know where your ident where
your id is from or anything else about you and the final thing i want to highlight about them is that they're ultimately like it's a very generic credentialing scheme and what i mean by that is that even though they originate from a valid data set they can actually be used for essentially any application that require a login an authentication or some kind of proof so i've been using the example of logging into github but you could also think of proving that you've paid for a vpn service as a way of logging in as opposed to providing your credit card details your password your username or
anything else that requires a proof the current status of our coconut credentials are we have implementations in both go and rust these implementations are interoperable between each other we are currently working on making or modularizing this code and turning it into a cosmos module which means that all cosmos sdk chains can utilize it um but the code is in a usable state right now it just will become a lot easier to integrate in the immediate future that said if you do want to start getting you know go ahead building with it reach out to me and i can talk about
how that might be made possible for you i've touched upon a few use cases when i've been quickly going over what the different aspects of credentials kind of allow you to do with them but some of the important ones that i want to highlight are obviously over the past two years there has been an increased amount of surveillance just because of needing to constantly present either vaccine passports or and there has also been a lot more kind of scrutiny crossing borders going into places all of this so we actually built a proof of concept of using coconut credentials to create a privacy preserving covid passport which
basically instead of me showing a passport a covered passport that as well as my vaccination status would say you know who i am where i'm from all of this um all it does is it shows that this person actually has the right to cross these borders because they are operating within accordance to for instance like schengen covet travel laws right but you could use a coconut credential as a replacement for essentially any kind of did or id system privacy preserving kyc also another example that came up in the previous talk this is something that a lot of people who are both well both people who are developing applications wanting to actually have
kycs is creating a lot of overhead for them to have to you know for instance make sure that they don't distribute anything to americans or air drop anything to people from certain jurisdictions you can basically then instead run your kyc through a process of people have to present these credentials that someone else has showed that they don't fall foul of any of the rules that you're not allowed to do but you can apply this to currencies data access both like database access but anything else voting all of this one of the things that is a little bit further in the future but i think something that could then actually
be incredible for the ecosystem to bring it back to cosmos in general is that uh you know we are a cosmos sdk chain without we are ibc enabled but we need to work out how to tackle passing coconut credentials uh between ibc enabled chains how you could maybe generate one from the osmosis side all of this and within cosmos this is just to kind of aid interoperability within the ecosystem and kind of boost everyone up but when you're looking at chains like ethereum the actual crypto that goes on underneath the creation and the use of coconut credentials is unrealistically expensive to run um i believe someone in our team
out of interest did try and do coconut credential generation on ethereum and it's over the block gas limit so kind of impossible to use at that point and once we've kind of done that we could start getting coconut everywhere else so maybe we could get coconut bridges on the horizon [Music] that then leads me into the third kind of net main network component that nim has and that's our next blockchain the reason why we called it nix was because the mixnet network is called nim the blockchain was kind of becoming increasingly prevalent and we wanted to just disintermediate the two and make it a little bit less confusing also nyx is the one of the names for the greek deity
of knight and it's just cool [Laughter] so what is next nix is a fairly standard uh cosmos dk chain ibc enabled and we also have the ability to upload and host kosum wasm smart contracts on there and the reason that we've maybe been a little bit quiet about that up until recently is that a cousin wasn't smart contract has actually been the thing that's been keeping track of thousands and by thousands i think our previous test now had over six thousand mixed nodes so thousands of mixed nodes gateways stake delegators all of the currency rewarding system and everything that went on between those
people and we've been kind of keeping this quite low-key just to see how it would work but it's worked flawlessly through all of these mixnets so it has a yeah we kind of it's scalable and has a massive throughput and is also incredibly reliable the reason that we're also presenting nics like this now is that we've decided to allow anyone to actually upload smart contracts and use coconut on our chain so we've basically decided to make nyx a kind of an open smart contracting platform that people can then join the nim ecosystem on the application level with cosmos and smart contracts if they want
to build like that so why why would you use nix one of the earliest talks today was you know talking about really discussing like the plurality of chains that we have in the cosmos ecosystem the ability to even kind of upload apps and then rely on the validator sets of the main cosmos hub so with all of this possibility there why would you decide to host your application on nics the first reason is the network security we have very very we have a very very good valid data set we have very strong network incentives for the investors behind him to keep this chain running and keep it secure the second reason
is that even though i've kind of just talked about our plans to modularize and maybe bridge coconut um you know it is going to be debuted on nix all the new features will be rolling out there and so anyone who's really keen to kind of start immediately accessing it will it's a good place to be for that and finally the kind of privacy community that we want to start building you know nix is the home of the smart contracts running the mixnap and you know privacy preserving apps will be in good company there they'll also be able to utilize having nim as the as a base currency if they want to use that as well and just take advantage of the general network effects of being part of the nim ecosystem
and like i said at the beginning i'm i'm the devrel officer so for developers nim has basically taken a shift now we launched mainnet yesterday as i've said so now we you know we've been really focused on infrastructure for the past year or so now we want to get people building we want to get people using these applications uh our grant program is going to be rolling out soon so if building on nim sounds interesting to you keep your eyes peeled for that also get in touch with me oh and then finish my last point as well get in touch so i'm max at nymtech.net i'll be around i'm also in our keybase and discord so reach out thank you very much max do we have any
questions i actually don't see oh yeah the box oh he does he has to see this hey thanks a lot for the presentation and the work that you guys have been up to so i actually have a question with regards to the credential scheme or mean you've already mentioned that verification on ethereum is pretty expensive um i wonder how does the proof generation looks like in terms of uh efficiency and how practical it is to generate those proofs on like constrained mobile devices etc so on mobile devices well our proof of
the proof of concept that we did for the poverty passport that was actually building everything on a phone so it very little latency is all i say it's very usable even at this kind of like poc level uh if you're doing this in a desktop setting then you shouldn't really notice too much lag with uh the actual cr you know the initial zk proof that you're using to facilitate the blind signing when you actually ask the validator set to create this credential for you um yeah is there's very little latency though cool thanks i think uh it's actually time i want to
say congrats you just launched yesterday yeah thanks congrats noon apologies for being slightly frazzled because of that yeah