Better privacy defaults for your users with stealth addresses
ETHCC 7 · 11 Jul 2024 · 31:52
Moritz Boullenger and Antonio Seveso, co-founders of FluidKey, present a workshop on stealth addresses for better onchain privacy. They explain pairing stealth addresses with smart accounts so transactions can be sponsored, and demo an ENS name that resolves to a fresh stealth address each time. They describe a viewing key that lets users see all received funds, privacy-preserving payment paths, and labels such as salary or client. The second half invites attendees to discuss privacy for their own products.
Speakers
Topics
From ETHCC 7, hosted by Ethereum France.
Transcript
Good to go. Awesome. Hi everyone. Thanks for joining the session. Today we're going to talk about how to provide your users with better privacy using stealth addresses. I'm Moritz and this is Antonio, and we're the co-founders of FluidKey. And we'll uh try to set this up in into two parts. First part, I'll uh talk a little bit about the background behind stealth addresses and how they work to give you some background. Um, and then we want to make this more of an interactive workshop, ideally, where you can also ask questions and we can also discuss some use cases maybe within products you are working on. Um so first let me start by talking a little bit about how we got started with stealth addresses.
Um the problem I was looking at as a user when I started um being interested in this topic was the issue of having better privacy on public EVM chains, right? So on Ethereum, L2s and so on and so forth, where your address is completely public and anybody can see all the transactions that you've done with this address, which assets are stored there and so on and so forth. And so one thing many users do, I think, is basically um just creating lots of different accounts in their wallets. So you have MetaMask and then you create a new account for something else, and you try to segregate accounts basically very manually. Um and uh and I thought there should be a better way to do this, and there should be a way to do this without having to go into another layer or go into another basically chain, but really being able to interact with smart accounts on uh on on basically public chains without having to get out of that environment.
Um and so I started to dive into stealth addresses. Vitalik wrote uh a blog post about stealth addresses at the beginning of last year as well, really breaking down how stealth addresses work. And I thought it'd be good to combine this with smart accounts to benefit from some um UX benefits that you wouldn't have with normal stealth addresses. One issue, for example, is that if you have an EOA stealth address and you send USDC to it, how do you then move that USDC if you don't have any you know ETH to move it? Um and with um smart accounts you can basically sponsor transactions and do lots of things that basically enable you to have better privacy um with with these stealth addresses.
And so um I wrote about this on Farcaster um almost a year ago, um, and that's when uh Antonio reached out and he was equally excited about uh um this uh this idea and we decided to build a proof of concept uh last year at Eve Global in Paris, so again a year ago. Um and uh and there was a lot of I think uh good reception about this as well, and a lot of people interested in kind of using this out, and we thought this should be more than just a proof of concept, and so we decided to actually work on this full time and and we incorporated a little bit later last year, and uh we're now also live uh in production. Great.
So before we go into what self-addresses actually are, um, show of hands with a few questions uh to better get to know you as well. Um who here has heard of stealth addresses before? Okay, so most of you know stealth addresses already. Um, who here has used a product that uses stealth addresses before? Much less uh hands raised for that. And then last question: uh, who yeah is working on a product that could benefit from uh better privacy? Okay, great.
That's great because we're gonna have a lot of uh interactions then in the second part of this uh the session. Perfect. So um I want to start by also showing you a little bit how stealth addresses work and give everyone the background uh needed to then dive deeper into your different use cases. How we'll do that is by demoing also very quickly how this works um inside uh inside Fluid Key, but this is really the same way it would work inside any other app using um stealth addresses. Um so here I'm on etherscan, and what you can see over here is my ENS. So every user on Fluid Key is assigned an ENS, and this has one particularity every time that ENS resolves, it's a new stealth address that is actually generated.
So you can see here there's a resolved address, your X57C. Um if I now refresh what you'll see in a second is that this address has changed. So basically, every time this ENS is queried in real time, a new stealth address is generated. It doesn't require any um any input from me as a user personally, a third party can basically generate these addresses, while knowing that only I can control these addresses with my spending key, right? So whoever generates this address cannot control the funds sent to this address, only I with my spending key can control those addresses, and so so that's the beauty of um of stealth addresses.
And if you look at it uh also on chain at that address, it's just like an empty address with nothing in it. And uh basically um if I now send money to this address and then Antonio opens EtherScan again or puts this ENS in another wallet and then sends money to the next address that is generated, he wouldn't know that there was a payment made to me just before with uh another amount, and so you get much more privacy through that um through that setup, right? And then for the end user, because there's a there's a viewing key you have with stealth addresses, we can aggregate all of these uh stealth addresses in a view that only the end user can see basically. And so, for example, here this morning I received 10 USDC and five USDC.
Um, but if you look on chain um and you check, for example, this first transaction going to this one address over here, what you'll see is just that this address has 10 USDC here, but you wouldn't know if I received another transaction of five USDC or whether I have a hundred thousand USDC on this account, you wouldn't know that from um from this, and that's the the kind of benefit of stealth addresses. Any questions so far? Yes. So you are kind of generating a new address from assumption? Yes.
That's that's uh you can also generate them on a different basis, right? Like so you could say like every hour I want to generate a new address. If you want the most privacy per transaction is the best uh basically um use case. Yes. So uh all the addresses are linked to a all the addresses that are linked to an ENS or do so yeah. So the ENS is basically just one implementation year with fluid key. You don't necessarily need an ENS, it's just a very nice kind of interface to like generate like basically return those addresses. What you need to return those to generate those addresses is the user's public uh meta public stealth address, and then you you basically uh multiply that with a secret, and that's how you generate those stealth addresses.
So every every stealth address is basically the public address of the user multiplied by a random secret that only the sender knows, basically, and that's how you you generate those those addresses. Okay, so so if the sender keep the same secret, he can use always the same address to send to the user and have like a track of exactly. So you could also use this per sender basically and have one address per sender. Any any kind of scheme works there. Yeah, you're totally flexible. Okay. And so and so like one sender can have a secret, uh, but if someone else used the same secret, they end up sending to the same address. Yes.
If you if you share basically the same secret or the same address, in the end, you can you can do that as well. Um, but the way I mean, if you want the most privacy, is basically every transaction you should just like create a new address that gives you the most privacy. When you do microtransactions, it might cost more gas than to move funds across many addresses and so on and so forth. So it depends really on the use case, but uh yeah. That's okay. Perfect, thank you. Cool. So if there are no questions for now, let me go a bit further into also a few more um explanation points, and then we can go into to some more questions. Cool.
So this is just a summary again. Um, to showcase how privacy looks in your default wallet, I guess, your MetaMask and so on, and what you get with uh with something like fluid queue and the other self-address scheme on the left here, you basically can see like there's one address where all of the assets are stored, and you can see all of the past um history. You could see like how much I earned this month, who sent me money, how much I have on this account, and so on and so forth. And by segregating all of these assets, you basically don't have all of that information about users anymore. And uh someone sending you money can't just look up on chain how much you made this month as well, right?
Great. I think one important thing to also explain is the privacy you get with self-addresses, and and that's unlinkability, um, and how that uh differs from untraceability. So, what unlinkability means is that um those addresses that are generated cannot be tied back to your main account and cannot be tied together, right? So if you look on chain, you just see an address and you don't know that this address belongs to me, and you don't know that this address is connected in some way to the address that was generated just before. What you don't get though is on traceability.
So untraceability means like you can still see um the flow of funds to that address, right? You can see who sent money to that address beforehand and where that money came from, and so on and so forth, right? And so you have other systems like Tornado Cash, for example, where which break that kind of traceability. Um it's a different kind of privacy you get with stealth addresses, and that also has different trade-offs. Um you could either mix and match those two properties together, right? Like combine those two, or um just use one or the other depending on what you what you need to use. The nice thing about unlinkability only is that you can still trace source of funds, and so if you then want to off ramp your money or anything, it's much easier to show where that money actually came from and what the flow of money was as well, right?
And you're not mixing that money with any other entity or anything or sending it to a centralized contract, it's always your self-custodial funds as well. Great. So, what's the unlock you get out of this basically? So, the the main unlock here is that you can now generate self-custodial accounts that are not publicly linked to a user's main account, right? So, as a DAP uh developer, you can basically generate as many addresses as you want for your users, and on-chain, all of these addresses would just be any any other address. They don't have any on-chain link, and uh and that allows you to give uh better privacy to your users in many use cases as well.
And so that's really um what uh got us excited about about stealth addresses. The other thing, as well, is that these addresses in the end are just normal EOAs or smart accounts, depending on the implementation. And so what that means is you can interact with any protocol that is on-chain, right? You can um send money to someone who just has a MetaMask wallet, um, you can you know do something on in DeFi, on Uniswap, any other app, you can use it as a signer on safe, and so on and so forth. And so it uh is quite powerful in the sense that you're compatible with anything that you can find on-chain um out of the box. Great.
So this is my last slide, and then I'll hand over to Antonio to go through different use cases with you as well. Um but um if you want to learn more, I think there's a few resources we've linked in this uh this QR code here, so feel free to scan it as well and look through the resources. There's been two ERCs that were finalized uh earlier this month around stealth addresses with a lot of work from uh Tony Vastetter from the Ethereum Foundation, as well as the ScopeLift team who are also behind Umbra. Um, not sure if you've heard of Umbra before, they're they're also a great uh stealth address protocol.
Um and there's also some SDKs in there, so um also if you want to get started building, there's our SDK, the Fluid Key Stealth Account kit, as well as ScopeLift's uh SDK there. Um feel free to reach out to me on Telegram at Moritz underscore fluidKey. Um, there's also a stealth address telegram group, happy to add you if you reach out um and want to uh learn more about this as well. Great. Any questions before we go into the workshop? Yes. Where is the secret? Where does the secret come from and who has it? Yes.
So it depends on the implementation. In the let's say vanilla implementation of stealth addresses, the send the sender would basically generate that random secret and then store it encrypted on chain. So you have a viewing key and a spending key, and the viewing key would encrypt that secret and then you store it on chain. So these ERCs are basically related to that. In Fluid Key, because these ERCs weren't ready yet, and we thought of some other methods to do this. The way it works is that those uh this uh this these secrets are pseudo-randomly generated based on uh a secret that the user shares with us. Um and it's so kind of like a viewing key, right?
So in Fluid Key, um you basically give your viewing key to Fluid Key, and so we are generating those addresses in real time when you query that ENS, um and that allows you for this UX where you just have this ENS, and the sender doesn't even need to know that you you're using any privacy protocol or anything, you're basically just uh sending money to an address. Um, and uh and so we took that decision right now. But I think with those ERCs now coming out as well, we'll be able to give users more options as well, and uh they can kind of also mix and match there. And and but then the the the same question but a next step, like that viewing key. Where is it?
Who custodies it and what happens when you lose it? Yeah, so um if uh in the first version you basically store it on chain. So when when the sender sends a transaction, they need to also basically announce it on-chain, meaning that there's an encrypted version of that secret stored on-chain on in the contract, and so these ERCs are about that. Um, in the other case, um with Fluid Key, we pseudo-randomly generate those. Um, so based on on one um private key, we pseudo-randomly generate those secrets that are then basically generating these addresses. So as long as you have access to your private keys, you can also regenerate them even if fluid key disappears.
I think there was a question maybe there. So once once the user received all the money with the different stuff addresses, yeah. How is he able to spend uh yeah? Yep. So so it depends a little bit on the application, and and I guess there's different approaches. On Umbra, for example, you would have to move the money from every uh you know received transaction separately and kind of decide what you do with that money separately. Um in Fluid Key, we basically allow you to you have a few options.
One option is to just say, okay, now you know I received uh ten dollars, a hundred dollars, and a hundred thousand dollars. Now I need to send a hundred and five dollars, right? How do I do that? Um, and we have a generic basically algorithm that computes the most privacy preserving paths. So in that case, it would be like combining the hundred and uh ten dollar amounts to do 105 and then send that out um to whoever wants to you want to send the money to. Um, but you can also label transactions inside fluid key. So you can say, okay, this is my salary, this is uh my personal money, and now send money out of the all the addresses that are my salary addresses, for example. So you also have control over which um uh addresses to to connect, basically, in a way.
Okay, perfect. Thank you. Yeah, so rather than salary, you put as a as a freelancer client A, client B. Exactly. That's a big use case. Um a big use case is basically if you want to receive your uh money from different clients, right? You just uh label those differently and then you can granularly also decide whose money you use for what and so on and so forth. Yeah. Great. If there are no further questions, then let's go into the the last section and I'll hand over to Antonio for that. Yep.
Okay. Um thank you, Moritz, for the first part. And uh hello everyone. Uh as Moritz introduced me before, I'm uh Antonio and I'm co-founder and CTO inside FluidKey. This uh second part uh uh I want to make it more interactive with you. Okay, in a way that uh uh we uh the title of the topic uh is giving uh users better privacy through stealth addresses. Uh while we the first part we try to understand how uh stalt addresses works. Uh there's not like one way of using stealth addresses for sure.
We just encountered a couple of uh uh different ways of using them just in payments. Uh there are also different ways of using that in specific products based on what the product does. Uh one thing that we have to keep in mind is that uh uh while before stealth addresses, let's say in this way, the only way for me to generate uh an uh an account was to generate a private key, then generate an account. Either it is uh uh smart account or it is uh um an EOA. With stealth addresses, I can pre-generate an account.
And that can be a smart account with modules installed, for example. Knowing that only the end user that has not maybe registered yet on my website, okay, I can control. And that changes the ability that we can do without going into more advanced technology like ZK that everyone is talking about, but there's still like a lot of uh different type of implementation around that. So I would want to like to tackle now is uh uh try to exp expla um expand and uh interact with you to possible fields where smart uh where thought addresses can be implemented. And I will start with a question.
Uh what's the first uh field that comes to your mind uh where stealth addresses might be applied? Int is very easy because we just spoke about that. It's always payments, that's it. Okay. And uh Moritz mention two projects. Uh one is Umbra. Umbra. And I uh suggest you to visit that. Uh it was the very first project uh that uh uh worked on third addresses within the Ethereum ecosystem. And uh, if you want to play around, you need uh as a receiver, you need to register on the website, and as a sender, you need to go on that website, connect your wallet, and pay the user you want to know to pay for.
Okay, so that's the flow that uh came out. What we said did with FluidKey was going through a little bit more of uh um user-friendly way of distant addresses. So our addresses uh are uh smart accounts. This allows us to within one transaction uh maybe combine two and send payments out when it comes to send out money, it allows gas sponsorship. Uh you don't need to have ETH on those accounts. You can just receive USDC or any other token and send out without having native assets uh into your uh accounts. And that's uh the second big advantage.
Now payments was an obvious one. Now, of course, that was not uh I would stop here now with use cases. Instead, like I think uh there is uh another another big one uh that uh you know maybe some of you might have an idea of uh don't worry if it's something that uh also is not related, otherwise it give you not yeah. Let's try uh here. Yep. Yeah, have uh maybe a little bit different use case. Yep. Um this will be some combination of I want to pay from the sales address, you know, like the the address initially will be empty, but maybe with a combination of the um the smart contract addresses and like stealth addresses, I can kind of do a private payment. So you so of course uh uh when it comes to private payment, uh there is also what a topic that I call uncertainty when you track on chain, because uh if you uh now we're you are thinking okay, I have money one still address and I pay another still address.
Uh okay, but between this path uh yeah, yeah. The the question is you know how to create the system or how to create a flow where uh the addresses will not be trendable, will not be trackable and will not be linkable. This is actually the challenge. Yeah, I agree, because uh uh like what I can say is that uh the good, but also the the uh other side part of stealth addresses is that they're regular addresses. And why they make compliance with anti-money laundering, uh the other side that makes that the the the fight the font traceable. And uh but uh what you can do, of course, uh is like it doesn't uh prevent you from going to A to B to go straight from A to B.
You can create a multiple multitude of addresses in a UTXO way like Bitcoin does uh, where in the end uh you have like with three, five, four addresses, uh, one of those send payments to one of the others while the other three are in control by you. Now, if I look at chain, I know it's more gas expensive uh and takes more time, but I don't know uh if that money goes uh all to the same user or has been split uh, you know, that's uh also the the way you can mimic. I know it's not perfect, uh, but that still doesn't break traceability, I think is uh is the goal. But it's another good point.
And said if I say a little bit more around uh identities. No, go ahead. Uh even if it's all related to identities. Uh yeah, it's not related to identities. Uh I wonder ask uh whether it's possible to change the owner of uh UTXO in the current implementation. With smart accounts, yes, 100%. Actually, there is one thing that has been uh people that seems like on Bayes and Safe, I also know working on that's our key store rollups, and that will be a killer feature for the smart account implementation because now you have maybe hundreds of addresses with the same key controlling them. If you want to change it, that's a hundred times under transaction.
Uh keystore rollup instead uh is a way that uses ZK under the hood, where you have one centralized point where you register a key, still with stealth addresses, and uh thanks to a ZK proof, you you need just to change uh the uh key in one place, and automatically all the other stealth addresses uh are controlled by that key. And that applies uh to multi-six, where it's isn't even uh um more frequent to update, add or remove uh a signer from a multi-sign. So that's like a good question. Nice.
So is this in production? So uh key store rollups uh in beta, it's uh been developed by Bayes uh team. Uh our system is in production at the moment doesn't rely on uh keystore rollups, but we are we will migrate to that once that is available in production. Yeah, what you can do is use the free key stealth account clips down there, and you can basically deploy stealth smart accounts, and those stealth smart accounts are um you know safes that are stealth, and so you can always rotate keys there as well. Yeah, so you can use that to rotate keys.
Right. Is the uh code for the safes open source? I mean safe is uh anyways open source and it's also open source, yes. This is uh only open source two weeks ago and uh open source open source their one now. Very nice, thank you. Can pass behind, yep. So I think you said that you can pre-generate an address. Yep, exactly. And assume you have the private key somewhere. The the private key stays in the hands of the user. I need the the public key of the user to put generate their address.
Uh so could you basically pre-generate an address, load it up with some token, and then sort of send that private key through a link to somebody else who can then open and basically store the private key in his sort of wallet? Uh so the private key here, like each stealth address uh under the hood has a different private key, of course. Uh though all the problem is all the private keys of the different stealth addresses uh are all derived by the main private key of the account. Uh okay.
Okay, so if I generate an address, I can preload with any tokens I want. This is how fluid key works, for example. We don't deploy a safe until money is uh is sent there. That's uh what makes also gas efficient the solution. Then only when the user wants to move money out that the safe is deployed. Uh then of course it's not ideal to transfer private keys. Uh I would suggest the other user uh to maybe I don't know, uh generate uh uh an address. And since this is a safe, I can transfer the ownership of that safe. That's uh more private.
I would now maybe do in the next step that's uh in IDs. Uh think about uh the problem of who managed treasuries. Uh like also in Big Dow. Sometimes there are people that are in more than one treasury. Now, if you do always with the same address, uh it's easy for you to be tracked uh for phishing attack, for example. Uh if you say if you use different uh wallets, uh no, it's fine, but you have to manage a lot of wallets. Personally, I have more than 100, and it's uh it's a pain when it comes to this part. Now think about spinning a stealth address every time. Well, that thought address uh can control a safe.
Under the hood is the same person, but looking from outside, there are maybe 10 different persons in 10 different uh multi-six safe. Okay, and this uh is one example of uh uh using of ID. Another one can be connecting uh to uh dApps every time with a new address, like okay. I want to connect to Uniswap, I spin up a new stealth address, I just send there the funds that I want uh to swap, okay, or whatever I do, and that's it. I'm not connecting my main account to that. And even more, I think uh cool example is what uh icebreaker, icebreaker.xyz does uh that website allows you to prove you are the owner of uh of an NFT.
Uh, don't think about NFT collection, also that of course, but think about solution where you uh KYC with an entity that drops you a non-transferable uh NFT, and you want to prove to someone else that you have already KYC'd without no giving all your details to that other service. Well, you can spin up a stealth address and with a ZK proof, prove that that stealth address that's an empty address, is controlled by another real address that has that specific NFT on it. Okay, that's a very more advanced use case of stealth addresses, but that was just to show that uh payments is one thing, but it's not uh everything.
And to close also my third uh and final thing vision, uh we have spoken of stealth addresses as a thing within a specific application. Umbra, uh fluid key, uh, icebreaker. What I see as a future is a future where wallets like we are using every day as a public and private mode, like browser we we have. Because maybe I want to show everyone that I have a specific NFT, like I show, I want to show everyone that I have a Ferrari, but I don't want you to show them how I'm transacting on chain, and that's a private mode of the wallet that under the hood just powered by stelt addresses and uh potentially an ENS in front of them. Uh I think that uh that's almost time to question.
I would like to close with two things very quickly. The first one is uh if you want to try out and play around with stealth addresses, this is the QR code link to uh access fluid key uh it's free. Uh and you can also install on your phone as a progressive web app. Um and if you have feedback, the important part is that you reach out to us on FluidKey, either on Twitter and uh Farcaster, or personally on Moritz or me Tony on uh Farcaster. And uh the second thing, uh if uh we can go back in the core code if you just can don't worry.
For it CC, uh we have created uh this uh small uh NFC tags key rings. Uh after the talk, if you come to us uh we will pre-uh uh uh add your username on here, and once you onboard on fluid key, you can generate start addresses just by tapping uh on your phone or on the phone of the people you want that pays you, and that will spin up every time a new address uh that's a private address. Thanks for your attention, and if there are any other questions, we are here and happy to answer. Thank you.
Um I think everyone here has been hearing a lot about account abstraction. And my question pretty much at every single talk is how are these different apps in DeFi or whatever going to be able to work with you? Uh are they going to have to add an specific integration or so? Um that's that's a great question because we had the same talk with the AVI team the other day. Okay.
Uh we are deciding about lending and borrowing that no it's stuck to a specific address over that. I think that comes in two ways. On one side, as Moet said before, we are out of the box compatible with any uh application, either that it's force you to use one wallet or multiple wallets. Again, if you want to do a swap on Uniswap, you don't you're not stuck to one uh specific wallet. But if you want to uh borrow something, then that's a specific address you must keep connecting to that. In that sense, I think it's a space in general that needs to move from a concept where a user is an address to a user is an S with a multitude of addresses. And I make you a parallel.
If I ask you, if I want to stay in contact with you, I ask for your telegram handle or your email. I don't ask for your IP address. Okay. Uh well in the very past uh I used to ask your IP address, there was not uh this stuff. So that's the step that I think the space needs to do. And that's at that same level, also the application needs to stop thinking that uh one address is one user. But uh you know, for example, how Aave could solve this? Uh well, with a ZK proof that can prove that uh the wallet repaying something uh is somehow connected to the another wallet that borrowed the asset. I know this might involve like a deeper uh refactoring of the application, so it's something that will take time.
Uh another one? Yeah, we have time. Do you have an access code for the app? Uh oh, if you scan a QR code, yes, it's uh ether CC7. Uh sorry if it was somehow yeah, but anyway, it's ETH CC7, and in a few weeks uh we'll be uh we we plan to open to anyone but thank you. You're welcome. Wonderful. Uh, if you have another question, again, uh we are here, and thanks for your attention. Thank you.
Related talks
- Stealth Addresses for Everyone: ENS as the Universal Stealth Meta-Registry
- User-friendly privacy on public chains with ENS | Lightning Talks #2
- Vitalik Buterin: The need for standardization of L2s, smart contract wallet | ETHTaipei 2023
- Antonio Seveso - Friendly Privacy with Stealth Addresses and Privacy Pools Fluidkey
- The Wallet Privacy Crisis and the Fight to Fix It
- ZK&AA, private smart accounts and other examples
- The Defipunk Bank
- Railgun | Best of All Worlds: EOA Simplicity, Multicall Power, RAILGUN Privacy - Kieran & Zy0n
- Ethereum Privacy