New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

How to stop your wallet from collecting your personal data: Enabling the Nym Mixnet with Metamask

Ethereum DenverMon, Oct 9, 2023, 12:00 AM

Speaker: Harry Halpin CEO https://nymtech.net https://twitter.com/harryhalpin Recently, there has been various privacy scandals about how wallets, such as Metamask, and the very RPC nodes used to access Ethereum, such as Infura, are collecting personal data such as IP addresses. This personal data can be used to de-anonymize Ethereum addresses and link transactions to real-world identities. In this presentation, we show how to use the Nym mixnet today to block even Infura from gathering the IP address, as well as the exact time and nature, of your transaction. We show how to enable the Nym mixnet inside of Metamask and how it compares to other less privacy-preserving options such as VPNs, Tor, and HOPR, none of which can defend against a powerful adversary with a 'God's eye' view of the entire Ethereum network. As a bonus, we will show how Ethereum 2.0 validators can deploy the Nym mixnet to make sure they do not suffer from a DDoS attack in the new Ethereum consensus algorithm. Harry Halpin CEO https://nymtech.net Harry Halpin is the co-founder and CEO of Nym Technologies, a blockchain startup building the next generation of cross-chain privacy infrastructure. The Nym mixnet is the only real-world mixnet that currently provides protection against an adversary that controls an entire network, and currently works on Ethereum, Cosmos, and Bitcoin - as well as generic internet traffic. Before founding Nym, he was a research scientist at MIT designing cryptography APIs under Tim Berners-Lee and received a Ph.D. in Informatics from University of Edinburgh. https://twitter.com/harryhalpin

Transcript

Most of you, what are you doing here if you don't do it? Hmm, how many of you here were upset to find out that MetaMask and Infura were monitoring you? Okay, so we'll tell you how to stop that. Basically tell you how to stop that. Basically , the big problem is that Ethereum was never designed with privacy in mind.

Indeed, as you know, when you use the original website, they monitor you all the time. And people assumed that in Web 3 there would be this kind of sovereign movement where you would control your data, pay for things, and not be spied on. But, in fact, what we see is that the opposite is happening. That blockchain infrastructure actually allows companies to monitor their users. This wasn't widely known until it came to light that MetaMask leaks IP addresses and all transaction data to your RPC provider.

So, when you use MetaMask in your browser as an extension or app, you communicate with an RPC provider, and this provider communicates with the rest of the Ethereum network. Basically, what happened is that ConsenSys changed the terms and conditions so that Infura collects your IP address and wallet address every time you send a transaction. And that made a lot of people angry. I woke up and thought: [ __ ] ConsenSys. It's a damn ridiculous thing to do.

Because? I just want to send a transaction. I refuse to be part of a data collection experiment so that they can sell my IP address and transaction history. You guys just raised 90 million or whatever from Sequoia. Use that money.

Do not sell my data. Do not capture my data sell my data. Do not capture my data . So what we did here was work on this problem for many years at Nym. Nym is a startup funded by Binance, A16z, Polychain and others, and we come from a line of research called Mixnet.

Has research called Mixnet. Has anyone here heard of a Mixnet? Wow, that's more than usual. I'll describe what it does in a second, but think of it this way: no existing solution can defend against mass surveillance, including, unsurprisingly, Tor. If I observe the data entering and leaving Tor, I can correlate them.

The same goes for Signal, the same goes for MetaMask; Anyone can do this. No solution, except a Mixnet, can defend against an adversary who observes all your network connections with a privileged view. So, what a mixnet does, to explain it, is that traffic passes through multiple nodes, similar to Tor or a peer-to-peer network. Furthermore, if nobody uses the network or there are not enough people, Nym creates fake traffic and adds it to the network flow. Therefore, someone observing the network cannot distinguish whether it is real or fake traffic.

What happens with shuffling is that, at each node in the network, it imagines that the packets are like a deck of cards. They mix. They are shuffled at each node. So they don't leave in order of arrival, but in a different order. And when there is more demand, you simply add more mixing nodes.

This is a small illustration. Whenever you use a VPN, you hide your IP address. You might be able to download Netflix in a country where you shouldn't, but the fact is that all your trust lies in that VPN provider. Tor improves it a little VPN provider. Tor improves it a little , but not much, because Tor only sends you through a decentralized three-hop network.

But if an adversary is watching, let me see, it would be good if I could walk around . If the adversary observes the entry and exit of Tor or any type of decentralized VPN, they can automatically know what you are doing. You're not actually hiding your IP address. Not even who you are. What Nym's mixnet does is , you see, the packets have different sizes and shapes.

These packages provide a kind of fingerprint. And when they go through the mixnet, they are mixed up at each hop and made the same size using something called Sphinx packet format, which Lightning also uses if you use it. And then the packages come out and you can see that they are anonymized. So the question is: can we use this technique to defeat an adversary like a consensus? And the answer is yes like a consensus?

And the answer is yes , you can. We have integration components that are open source integration components that are open source . You can download them. You can use them. A local customer, who takes your packages and makes them all the same size.

We have the service provider, which is like the exit node , and a gateway, which is the entry node. And integrating it with an application is quite simple. If you have a web application or a browser plugin, you can simply use websockets, right? Websockets allow you to open a TCP stream within arbitrary web sources , if you have permission. Furthermore , if you have permission.

Furthermore , our entire codebase is built in Rust. We compiled Rust to WebAssembly, and you can use WebAssembly and JavaScript to work with Nim. That's exactly what we do with MetaMask. Additionally, if something integrates with Tor or any program in general with Tor or any program in general , you can use something called SOCKS5 to create a local proxy on your machine and send all that traffic through it. So, I'll summarize the steps of what happens when you use Nim.

First you find out where the merge nodes are , find their keys, and then register with an entry node; The catwalks authenticate you. If someone sent you messages, you can download them sent you messages, you can download them . If you want to send messages, you create these onion-encrypted Sphinx packets . You send the Sphinx packets to the network and the network mixes them up. It looks more or less like this.

You are that little alien. You are sending TCP/IP or UDP packets to your machine. The machine makes them all the same size and sends them to this mixing node. You know, there are about 500 mixing nodes right now . If you want to send a lot of traffic, more will appear send a lot of traffic, more will appear .

And then the packages come out anonymized. And they go anywhere, like an RPC provider, a full node, Signal, or any application you want. The great thing about Nim is that it works with any application, not just Ethereum; In fact, it works with everything. You can use it with Signal. You can use it with Telegram.

You can use it with Bitcoin. We don't care. If you speak the language of the Internet, we can anonymize you even against the NSA. That's really important. So, again, SOCKS5 is pretty standard.

You simply run it on your computer. It's a binary. Everything passes directly through him. And anything that works with Tor will work with Nim thanks to this technique. That said, I'm sorry, we'll skip that.

WebSockets are very useful if you want to send JSON or other binary-encoded messages within certain environments such as web browsers. Finally, we also do WebAssembly. We have an SDK. We allow you to use Sphinx in the browser. And this is something you can't even do with Tor, right?

Right now I can't open a website like, for example, Wikileaks and send a leak through it. That would be impossible. It's a website, would be impossible. It's a website, right? But we allow you to open these connections within a web browser and you can anonymize browser traffic, which is very useful for MetaMask.

We have a token like everyone else. But unlike almost all other tokens, ours is not a damn useless thing. It's not just another DeFi token with a fruit or something on it, is it with a fruit or something on it, is it ? Basically, if you want to run a merge node and you want to merge people's packages, that's a computer. That computer costs money; it has maintenance costs.

So you simply run a mixing node just like a Bitcoin miner, but instead of solving a pointless puzzle, you use the power of your server to provide privacy by mixing packets. It's like mixing instead of mining. And as more people use the network, you get more Nym tokens, provided your mixing node is working well. And if you're too lazy to manage your own node, you can use delegated staking to delegate your tokens to other nodes. And well, basically everyone makes some money from this.

The user can give Nym tokens to speed up their traffic. Mixing nodes receive Nym in proportion to the packets they mix. The validators ensure that everyone is paid correctly. And most importantly, if I want to use Nym, I want to ensure that all my traffic goes through Nym. I run a service provider.

For example, let's suppose I am the Brave browser. Brave or Signal can buy Nym in advance and make their service use Nym for free for their users. We have a blockchain that is essentially like the authority of the Tor directory like the authority of the Tor directory . This is who you talk to when you need to find out where the nodes are and how to send traffic through the mixnet. That's built with Cosmos mixnet.

That's built with Cosmos . If you're interested in blockchain, we'll have a talk tonight at the Cosmos session. It's in a bar, but we basically run everything through Cosmos. And while Tor only has a dozen servers, we have over 30 Cosmos servers running the Nym blockchain, ensuring that the broadcast reaches censored countries like China and Iran, which I think we'll hear about later. Anyway, when we heard all that nonsense about ConsenSys spying on everyone, I woke up and said, "Wow, we should fix this, it's easy."

The community fix this, it's easy." The community , random people we didn't even know, already started using Nym's mixnet to prevent Infura from capturing their IP addresses and other personal data IP addresses and other personal data . If you want to do it, this is a fairly simple method. However, the problem is that, instead of using Infura, you trust these people. And I don't even know who these people are.

They seem very friendly, but would people are. They seem very friendly, but would I trust them? So if you don't trust these "don't trust, verify" people, maybe you should set up your own proxy, right? You can easily run your own NIM proxy. In fact, one of our VCs, Eden Block, created software called Spook, and you can configure it to run everything yourself.

So you set up your own input node, your own output node, and you don't have to rely on anyone but yourself and several random mixing nodes. And because of the way the system is designed , the mixing nodes can't know anything about you. That's the main point of a mixing network. And if you don't even trust anyone's RPC node , A16 created this software called Helios. Now, we know everyone hates A16, but still, this is a useful piece of software.

This software allows you to run your own trustless RPC node, and you can use NIM to communicate with that node yourself, because remember, NIM doesn't just hide you from the RPC node. It hides you from anyone watching the RPC node. It's bad enough that Infura collects your IP address, but it would be trivial for an organization like the NSA or Chainalysis to observe all the traffic going in and out of Infura. So even if you run your own RPC node, you still run that risk, and this software allows you to reduce the risk of someone observing your own RPC node. Anyway, we have all this up and running and if I have time, which I think I will , I'm going to show you how it works, maybe not live, but I'll show the video.

Good. So basically, this is NIM running with MetaMask. It looks exactly like MetaMask. You activate it when you want and then you can see that it's working. This is your transmission node, which is basically your output node.

You configure it. You enter your MetaMask password. You know, we'll use Goerli because we're cheap. And basically, what's happening here is, let's say, what's going on under the hood. They are about to send some money to another account.

It shouldn't be that difficult. Give me a second. Demonstrations are always a bit boring because tedious things always happen in the first minute or two. Good. Okay.

Come on. Sorry. I had all this ready last night. Good. The transaction actually went through MetaMask.

Now, what you'll see happen here in a second. Good. Come on. MetaMask is a bit slow. It's very old JavaScript.

Confirm. Good. Good. Now, we just started the NIM web assembly client and sent the packages from MetaMask to our web assembly client and communicated anonymously. Wow, that happened really fast.

The message reached the RPC node. So, it really works. Again, it's not something theoretical. They can do this easily. Is there anyone from Consensys here, or do you know anyone from Consensys?

We are trying to talk to them about enabling privacy as a default option for MetaMask users. So, Francesco, Angelini, who's here? Anyone? Anyway, we're still trying to talk to them. They might not be interested, but if they know anyone from Consensys, it would be good if they didn't become the Google of Web 3 and a giant data collection factory, but instead enabled them by default.

And now I want to, oops, sorry about that. I want to mention one more thing. It just ended. The traffic has just passed. Anyway, we have all that working.

Uh... Again, very simple in case you didn't understand. The ETH transaction payload goes to NIM, creates the Sphinx packet, and sends it to the ETH RPC. Even in Infura sends it to the ETH RPC. Even in Infura , this is a data flow that is, frankly, not complicated, but it should be enabled by default, and that's what we hope will eventually happen.

However, there are other problems with Ethereum. A big problem you may have heard about is called validator privacy. In Ethereum 2.0, the leader selection protocol is deterministic and public. So what this means is that, let's say, I can find out who will be selected as the leader.

And if I were malicious, I would DDoS attack that next person and take down their validator node, and I could make all sorts of very clever financial attacks to make sure I get the money, or that my friends get the money and not them, right? DDoS attacks are a real problem on the internet and Ethereum 2 is currently vulnerable to this type of DDoS attack. It 's not a good thing. So we've partnered with ChainSafe. I expect there are some people from ChainSafe, and there they are .

We have Chain Safe in the audience. Chain Safe provides consensus clients for validators and works on them for more than 500,000 different nodes. What we hope to do is create, with the help of Chain Safe, since I am not an expert in Ethereum. We are going to create a Nim module for libp2p. This will mean that any validator will be able to hide their IP address and continue participating in Ethereum's proof-of-stake consensus algorithm, without fear of DDoS attacks, being tracked, or revealing their identity.

We believe this is very important; it will be ready in a few months and we will announce it. We hope that if anyone here operates an ETH2 validator... Well, some of you do. We would love for you to try this. You will lose a little latency, but we will adjust everything so that the loss is minimal while maintaining your privacy.

If you have any questions, I think I'm about a minute early. I am the CEO. I'll be here all week. On Sunday we will be giving a talk with the Universal Privacy Alliance. There I will talk about what happens to activists in certain countries when they use cryptocurrency technologies.

I think it's around 4 p.m. m. Saturday. Please attend.

You can send me questions via email, Telegram, Twitter, or simply join our Telegram channel and ask whatever you want. I have one minute left. Does anyone have any other questions? No questions. Okay, there's a question.

Forward. Do n't know. No, him, him, that guy. Hi, are there any latency issues when using Nim? No problems, but does it when using Nim?

No problems, but does it increase latency? Yes, it adds latency. Is that possibly why the consensus is hesitant to integrate it into MetaMask? In other words, are integrate it into MetaMask? In other words, are they trying to be as efficient as possible?

Well, it depends on what you mean by efficient; If they were, they wouldn't be using such outdated JavaScript. But yes, I believe that every time you use privacy technology, whether it's VPN, Tor, or Nim, you add latency. However, what Nim allows you to do is adjust that latency. We have seen significant privacy gains with latency increases of only a few seconds. Honestly, it's not so bad compared to how slow the rest of the process is.

It is barely noticeable to most end users. Fair. OK. Thank you. However, if you really want privacy, you need to be slower.

So super paranoid people can wait a minute, and we allow them to configure that in the client allow them to configure that in the client . Or you can wait five minutes or an hour, whatever you want. Any other questions? Okay, there you have it. When you use MetaMask with multiple accounts connected at the same time, it updates your balances in the same TCP request and therefore maps all your addresses at once in that same request.

I don't think NIM will solve this. So I think that's up to MetaMask to fix. So if anyone from Consensys is listening to this, please fix this problem as well, because otherwise, I don't think the mixing network alone will help. Yes. We cannot resolve problems that are within MetaMask due to poor design decisions made by Consensys.

However, I want to correct something. Tor. When you use the Tor VPN, you are setting up a bidirectional and synchronous flow of packets, like TCP/IP. When you use NIM, we actually route each packet through the network individually. This means that no package can be correlated with another, at least at the package level.

Now, if the application data contains any identifiers of yours, there's really nothing we can do about it . But at the package level, which is what matters most when you're worried about external adversaries, packages should basically be anonymous in their own way, because every package is sacred. Okay, that's all, I'll look for you later. Take care everyone.

Automatic transcript — names and jargon may be misspelled.