Episode 43: Hardware Wallets and Blockstream’s Jade wallet
Ep. 43

Episode 43: Hardware Wallets and Blockstream’s Jade wallet

•

Episode description

In this episode of The Van Wirdum Sjorsnado, Aaron van Wirdum hosts one more interview without his regular cohost Sjors Provoost. Instead, he is joined by Blockstream’s Lawrence Nahum, one of the developers behind the Jade wallet, and Ben Kaufman, one of the developers of the Spectre wallet, which is specifically designed to work with hardware wallets.

Aaron, Lawrence and Ben talk about what hardware wallets are, and discuss the design tradeoffs that different hardware wallets have taken by focussing on the Trezor, Ledger and ColdCard specifically. In this light, Lawrence and Ben explain what secure elements and secure chips are, and why some hardware wallets choose to rely on using such chips more than others.

Then, Lawrence explains which tradeoffs the Jade wallet makes. He also details how an additional server-based security step is used to further secure the Jade wallet, and briefly outlines some additional differences in hardware wallet designs, for example those focused on usability.

Finally, Aaron, Lawrence and Ben discuss whether the concept of hardware wallets are a good idea in the first place, or if it would perhaps be better to use dedicated smartphones to store your bitcoin.

And don’t worry, Sjors will be back for episode 44!

Chapters

00:00:00 Hardware-wallet basics with Lawrence Nahum and Ben Kaufman
00:05:53 Trezor: open firmware, PINs and physical attacks
00:11:24 Ledger and secure-element tradeoffs
00:19:28 COLDCARD and the two-chip design
00:26:45 Jade: secure boot and flash encryption
00:31:28 Jade’s blind PIN server and encrypted keys
00:37:51 Server outages, backups and recovery
00:41:14 USB, Bluetooth and QR-code tradeoffs
00:43:14 Hardware wallets, dedicated phones, DIY and multisig

Transcript

Download transcript (.vtt)
0:09

Aaron van Wirdum Live from Mexico, this is the Van Wirdum Sjorsnado. I'm doing another episode without Sjors. Sjors will be back soon. But today I am joined by Lawrence Nahum and Ben Kaufman. We ran into each other here. And Lawrence told me, Lawrence is working on a new, well, you're working on a hardware wallet. And I figured, you know what, I've actually never... Sjors and I have never done an episode on hardware wallets, so maybe this is a good opportunity to just keep it going. And the other reason it's... Well, first, okay, let's... Lawrence, introduce yourself, please. Let's start there.

0:45

Lawrence Nahum All right, Lawrence Nahum, [unclear] Blockstream. I worked on various software wallets and now Jade hardware wallet.

0:55

Aaron van Wirdum Yeah, the Blockstream Green wallet. That was your main project before this.

0:59

Lawrence Nahum Yeah.

1:00

Aaron van Wirdum And now you're working on the Jade hardware wallet, also a Blockstream product.

1:04

Lawrence Nahum Yeah.

1:05

Aaron van Wirdum Ben?

1:06

Ben Kaufman Yeah, I'm Ben Kaufman. I'm working on Spectre wallet. Yeah, it's a way to use your Bitcoin Core node with hardware wallets, basically all of them.

1:19

Aaron van Wirdum Yeah, so I wanted to do an episode on hardware wallets and I've never really, personally, I've never really written extensively about hardware wallets, like the trade-offs there are. And there is some, you know, debate and discussion on what are, you know, the best hardware wallets or what are the best trade-offs to make. And so I figured if I'm going to do this episode with a developer of one hardware wallet, I kind of want to have a neutral expert sitting next to me to kind of tell me, if Lawrence, if you're overselling everything like you always do. Everyone knows that you… so yeah, Ben is going to be my sort of sidekick expert today. So, yeah, I'll have questions for you here and there. If I don't understand something or if Lawrence is, you know, overselling it.

2:04

Ben Kaufman I'll be watching him.

2:06

Aaron van Wirdum And it's really cool to have you on as well, Lawrence, because when Sjors and I started our podcast, so you also do the Reckless Review podcast, right?

2:15

Lawrence Nahum Yes, we do.

2:15

Aaron van Wirdum So when Sjors and I, when we started our podcast, we were sort of making benchmarks for ourselves, but we didn't want to disappoint ourselves. So we figured, Alright, our podcast needs to be at least as good as Reckless Review. So we set it like the lowest bar possible. So there's no way we could fail. So it's great you're on as well. Alright, let's start with a very basic question. Because what is a hardware wallet? Why do people use hardware wallets or what are they for?

2:51

Lawrence Nahum I'll start. And maybe before I say what a hardware wallet is, I'll say what a wallet is. A wallet is just some piece of software that holds your private keys and together with those, it signs your transactions and maybe generates addresses and so on. So a hardware wallet, it's just like a software wallet, but it has a much smaller surface of attack. So it's a device that is dedicated to one thing. So unlike your mobile, where you can, you know, read the news, download video games, watch movies and so on, a hardware wallet does just one thing. And that's, you know, signing transactions, showing addresses and so on. And yeah.

3:34

Aaron van Wirdum I think one big benefit, but correct me if I'm wrong, that goes for both of you, is that a hardware wallet isn't connected to the internet and therefore it can be hacked by outside parties in that way at least. Would you agree that's a main benefit or no?

3:48

Lawrence Nahum I don't agree in the sense that ultimately your laptop is connected to the internet and your hardware wallet is connected to your laptop.

3:55

Aaron van Wirdum Right, at some point your hardware will just hit the internet indirectly.

4:00

Lawrence Nahum At least that's the most common case. I mean, some people use offline laptops and so on, and you can definitely do that, but there's some work involved. And, well, sometimes, you know, some devices use cable, some devices support cable as well as Bluetooth. Some devices support SD cards, and some devices maybe use QR code. But even those are still, like, a way to... To get, say, potentially code on those devices and maybe attack them.

4:29

Aaron van Wirdum So if the main benefit is that it's a single-purpose computer, that's how you explain it, I think, right? If I summarize it in like one sentence, it's a one-purpose computer, why is that actually a good thing? Then why is that a benefit? Why is that something people want?

4:44

Lawrence Nahum It's because it's not just a single-purpose computer. It's a small single-purpose computer that has been hardened to minimize... You know, what you can do with it, and thus there's less surface of attack. So the more software, the more bugs, the more bugs, the more security issues. Because it's single purpose, it has less code, less software, and so less... There's bugs, but also depending on the manufacturer it may have some different kind of hardening. So maybe we'll get into that a little bit later.

5:20

Aaron van Wirdum Yeah, we'll get into that in a bit first. Ben, do you agree with this? Is this the main benefit of hardware wallets?

5:26

Ben Kaufman I would say so. I think not being connected to the internet is just one part of this, reducing the attack surface. So it's a very important one. But there is a lot more into it so it's not just not connected to the internet. It's also that it's very much minimized, like everything that you don't really need, it's just not there anymore.

5:51

Lawrence Nahum Yeah.

5:53

Aaron van Wirdum So there's just less risk if there's less stuff, right? So let's get into some hardware wallets. We'll get into the Jade wallet in a bit, but let's discuss some of the trade-offs that hardware wallets have made over the years, because there are different designs of hardware wallets. The first hardware wallet was Trezor. So how does Trezor, for example, work? Why is that secure or why is that not secure? Maybe that's your opinion.

6:26

Lawrence Nahum Yeah, so Trezor is a USB device. There's two, I think, now. Trezor-T and Trezor-1. But basically, it's a small computer, a small device. I think it has a chip called the ST32 from ST Electronics. I think it's a French company. And yeah, they designed some firmware in C. You know, that drives the display and listens to button events.

6:57

Aaron van Wirdum Maybe in case someone doesn't know, what is firmware?

7:00

Lawrence Nahum Firmware is software for hardware.

7:02

Aaron van Wirdum Yeah, it's software specifically designed for a piece of hardware.

7:06

Lawrence Nahum Yes, and usually, maybe I'm wrong, but I think usually it goes without operating system and it's like bare bone to the iron, to the hardware, to the metal.

7:18

Aaron van Wirdum Right.

7:18

Ben Kaufman Yes. Not in all other wallets, but yes, most of them.

7:26

Aaron van Wirdum Right, so Trezor is a piece of hardware, which is a piece of firmware, and that firmware secures your private keys and can be used to sign transactions. Usually through another wallet, like Spectre for example.

7:39

Lawrence Nahum Green supports Trezor too.

7:40

Aaron van Wirdum Right, and then you broadcast that to the Bitcoin network. That's how it works. So the main purpose is that it secures your keys in that sense. Now I think one of the... trade-offs of Trezor. So it's usually secure in that sense until someone gets a hold of your actual Trezor. Is that sort of one of the trade-offs or one of the problems there?

8:07

Lawrence Nahum Not necessarily. So Trezor is open source, the firmware is open source. I think the hardware is also open source or at least used to be.

8:15

Ben Kaufman From what I know it's open source.

8:20

Lawrence Nahum And yeah, it has some, it tries to, you know, prevent extraction of keys and, you know, unless you know the PIN or the passphrase, it prevents you from using it. But basically unless you use a passphrase, it doesn't have physical security. Because a number of independent companies or people manage to extract the secret, the private keys, the seed, the mnemonic.

8:47

Aaron van Wirdum Yeah, physical security is what I refer to, like if you actually get the device in your hands.

8:52

Lawrence Nahum Unless it has a strong passphrase, in which case you can't. You can extract the mnemonic, but then without the passphrase, you cannot get the keys.

9:02

Aaron van Wirdum Yeah, let's separate that out real quick. So there's PIN. Every hardware wallet usually has a PIN code. You just need to put the PIN in. Yeah, um… but, and then there's the private keys to you know, so you need a PIN to unlock the private keys basically, but if you get it back Sorry, and then there's the passphrase which you mentioned. Yeah, so if you use a passphrase which is just a password or just a long version of a password.

9:29

Lawrence Nahum It needs to be strong; if it's like in a dictionary, then it's trivial to brute force.

9:33

Aaron van Wirdum Yeah, so if, if you have a Trezor and someone uses it with a passphrase then it's as secure as the passphrase at least. The problem is sort of that the PIN doesn't provide the security in case of a physical attack. Am I saying this right?

9:48

Ben Kaufman Yes.

9:48

Aaron van Wirdum Yeah. And so how would this physical attack, like, how does it work? Or is that even known?

9:55

Lawrence Nahum Basically, you open the case of the Trezor and you, in [unclear], it's called the glitch. You glitch it. There's various kind of glitches. Power glitches is one. I'm not, you know, an expert in the sense that I've never glitched hardware or never done this. But basically, yeah, you... I also heard that sometimes they use laser to glitch Trezor. And by glitching it, you basically change the instructions. And if you time it right, it works really well and you can bypass the PIN protection, for example.

10:38

Aaron van Wirdum Right.

10:38

Lawrence Nahum And you can extract the [unclear].

10:40

Aaron van Wirdum Right. So that's the main downside of Trezor. The main upside, I think, and you did mention this, but I want to make this more clear, is that it's completely open source. So we know exactly what the device is doing, what the firmware is doing, how it all works. Is that right?

10:56

Lawrence Nahum Yes.

10:57

Aaron van Wirdum Right. And then, okay, so that's Trezor. And that's sort of, I think, and that's why, that's one of the reasons I mentioned Trezor as first. I think that's sort of on one end of that spectrum, of the sort of security trade-off spectrum, is that it's all open source, you know exactly what it's doing, but if someone gets their hand on the actual device and didn't use a strong passphrase, then it can be extracted in the way you just explained. So that's sort of one end of the spectrum. As I understand it, on the other end of the spectrum, there's something like Ledger, which uses a secure chip, I believe.

11:32

Lawrence Nahum A secure element.

11:33

Aaron van Wirdum Yeah, so how does this work?

11:35

Lawrence Nahum Well, it's a chip that has extra protection both in terms of glitching and in terms of...

11:48

Ben Kaufman All sorts of known attacks, basically. Whatever it's decapping the chip, whatever it's glitching it, whatever it's tampering it with temperature or whatever you can do.

12:00

Aaron van Wirdum Maybe I should first ask, and maybe you were answering that question, but just to make the question very clear then, what is a secure element? Why is it secure? Why is it even called that? What is it?

12:10

Lawrence Nahum It's a chip, like the same that Trezor uses, but it has extra protection. So Ben was talking about decapping or uncapping. That's the process of removing layer by layer the material until you can actually see the secrets of the of the chip and secure elements tend to have extra protection against that so that basically it's very hard to use like an electronic microscope to read into the chip. say the flash to extract the key or whatever. I think I'm not, you know, again, an expert on this, but I believe it has like a little, like an electrical net that will destroy as soon as you, it will prevent you from reading. And if you try to move it, it will destroy the circuit, something like that.

12:56

Aaron van Wirdum Right. It's essentially a tamper-proof chip.

12:58

Lawrence Nahum But then, but then, but then it comes; usually those chips come with NDAs or in any in any capacity it's um like the tool chain often it's not uh available to third parties unless they sign the NDA or it's not open source and so on. That's usually the downside.

13:13

Aaron van Wirdum Yeah, so that's it. That's a trade-off there. So the benefit is because of this secure element this physical physical attack cannot be done.

13:23

Lawrence Nahum They can. It's a matter of price. So, maybe with Trezor, I heard that you can get equipment for, say, $200 to extract the key.

13:34

Aaron van Wirdum And is that software?

13:36

Lawrence Nahum It's hardware.

13:37

Ben Kaufman Some hardware tools, yes, but it's very cheap.

13:42

Lawrence Nahum It used to be more expensive, but basically it's some hardware that allows you to glitch it at the right time so that some instructions get executed or don't get executed.

13:50

Aaron van Wirdum And that kind of hardware does not exist for the secure elements or it exists, but it's just way more expensive.

13:56

Lawrence Nahum Basically, I don't, I mean, it exists. It's way more expensive to extract because you're going to have far more failures. And, you know, maybe we're talking about $200 for Trezor, maybe we're talking about $200,000 for Ledger, or maybe even $2 million for Ledger.

14:13

Ben Kaufman And even then, it's much less guaranteed that you will manage to do that. It's way more risky because it's temper-proof.

14:20

Lawrence Nahum Yeah, because the thing is, you don't care about, like, sometimes you care about extracting something from... these secured element chips and if you burn one you don't care because you can you know buy more and try until you succeed um but in case of a Bitcoin wallet you do care about succeeding on that specific wallet that has the coins; otherwise you know you don't really care about breaking an empty wallet.

14:39

Aaron van Wirdum Right. So, because of the secure element it's much more expensive to extract the mnemonic. That's always the word I'm struggling with.

14:49

Lawrence Nahum Mnemonic.

14:49

Aaron van Wirdum Thank you, Lawrence. That's much, yeah, or the private keys, basically. So that's much harder to extract. The trade-off is that you don't know exactly what the chip is doing. Is that it?

15:04

Ben Kaufman That's part of it, I would say.

15:06

Lawrence Nahum But even with the other chip, like ST32.

15:10

Aaron van Wirdum I mean, it's not open source.

15:12

Lawrence Nahum The chip itself, I mean, the chip of all the hardware wallets out there [unclear] open source. I think Trezor is working on an open source chip. In fact, maybe an open source secure element. But basically all the chips out there are currently not open source. The spec may be open and the toolchain may be open, but not always. Like for secure element, it tends to be closed and it tends to be covered by NDA.

15:36

Aaron van Wirdum Okay, so what is the problem with that then exactly, in your own words? If there is a problem with it.

15:44

Lawrence Nahum For example, with Trezor, there's a few clones and if someone has somewhat basic electronic skills, they can build one themselves and flash the firmware themselves and whatnot.

15:59

Aaron van Wirdum You mean if someone else wants to sell hardware wallets, it's very easy for them to take Trezor's firmware, their work, and sell hardware walls themselves? Is that what you're saying?

16:11

Lawrence Nahum Yeah, there's plenty of Trezor clones, and even COLDCARD uses a firmware that originates from Trezor in terms of... You know they forked it from Trezor early on and then they moved on.

16:24

Aaron van Wirdum Right, but I'm interested in what are the problems for users? Why is it for a user for me if I want to secure my private keys why is it the problem for me to use a secure element or is it not a problem for me to use that?

16:36

Ben Kaufman I would say it's mostly that they are covered by NDAs usually and they're closed source mostly which adds to you know it adds to the obscurity and risk in terms of you are not necessarily knows what the stuff is doing so sometimes it can be with the chips too and like normal but this basically just adds another layer where you don't know what things are what's going on.

17:03

Aaron van Wirdum So what's the worst that's could be going on then, too?

17:07

Lawrence Nahum Well, so, for example, each other wallet has a random number generator, and maybe the keys generated are all known by Ledger. Now, it's also possible with Trezor, to be honest, because the chip used by... But Trezor could do that. So it could be hidden in hardware. But my point previously was like, if I wanted to, and forget about commercializing, I could build a Trezor from scratch and flash it and use it. At Ledger, I simply couldn't.

17:37

Aaron van Wirdum Yeah, right, but that's the commercial argument. I'm still interested in it.

17:40

Ben Kaufman No, it's even for build it like a DIY.

17:44

Aaron van Wirdum Oh, just as a matter of better understanding what it's doing.

17:48

Ben Kaufman Also extra security in both terms of supply chain attacks. So if you're building it your own, there is much less risk in that. And also in terms of the hardware security. Trezor would want to execute some retirement attack and hide something in the chip. And if you're building it yourself, you cannot really do that.

18:14

Aaron van Wirdum Right, got it. Is it going to be summarized into saying the secure elements require more trust? To some extent,

18:23

Ben Kaufman I would say, yes.

18:24

Aaron van Wirdum So it requires some more trust in the wallet developer to an extent.

18:30

Lawrence Nahum And the manufacturer of the chips themselves.

18:35

Aaron van Wirdum Right. So these are sort of the two polar opposites or the two extremes within the hardware wallet space a little bit. On the one hand, you have Trezor that is completely open source in all its ways, but that comes with a trade-off that a physical attack is possible, or at least affordable, I guess. And then on the other end, you have Ledger, which has a secure element, which is therefore not as expensive or it's much more expensive to perform a physical attack on, but it requires some level of trust on the wallet provider and the developer.

19:14

Lawrence Nahum And it's only partially open source. Ledger has some open source parts, but it's only partially open source.

19:21

Aaron van Wirdum Yeah. Ben, you agree this was sort of fair enough?

19:25

Ben Kaufman In that sense, yes. At least from that aspect, yes.

19:28

Aaron van Wirdum Okay, so then there are other hardware wallets. Before we get to Jade, let's discuss one other hardware wallets. It's the COLDCARD. COLDCARD. Yeah, they have a security model that sits in between of these two.

19:45

Lawrence Nahum Kind of, yes. So it has two chips. And so Trezor and Ledger use a chip, I said, called ST. I mean, from a company called ST. I believe that COLDCARD has one chip from ST and one chip from Atmel. The ST is almost the same as Trezor, if not the same as Trezor. It's an ST32 or something like that. While the Atmel is a secure chip. I mean, some people call it a secure element, some people call it a secure chip. But it's not used, unlike Ledger, it's not used to sign transactions. It's only used almost as a black box to hold the keys against your PIN. And if you get the PIN wrong, I don't know how many times it will delete the secret. So when you get the PIN right, it will provide the key to the other chip. The chip will do whatever it needs to do while Trezor-style until it's powered or until you log out, say, of the wallet. And then it will disappear from memory and will be protected by this Atmel.

20:53

Aaron van Wirdum Right. So two chips. One of them is pretty regular, same as what something like Trezor uses. And the other is more like what Ledger uses. Not quite.

21:05

Lawrence Nahum Not quite.

21:05

Ben Kaufman But the important thing is that in Ledger model, all the operations for signing transactions happening on the secure element itself. On the COLDCARD, it's not happening on the secure chip, it's happening on the normal chip. The only thing the secure chip is used for is storing the keys themselves, but they are getting loaded into the other chip while the COLDCARD is actually in use.

21:29

Aaron van Wirdum Yeah, that I got. But you also mentioned the secure element isn't quite as secure, or how do I think about that then? Or is it just a secure element that does less?

21:41

Lawrence Nahum I mean, in principle, you could say it's a secure element that does less. I heard of it as a secure chip, but not exactly a secure element. And so another thing that secure elements tend to do, and the code that you run on it is very important as well, is that it makes it harder to extract the key by means of listening. So at some point… someone was trying to extract the private key from a Trezor by signing lots of times and trying to capture because it wasn't a constant time code, so signing different things meant that it would take you know different lengths and of time, and and that is enough information to eventually extract the private key and secure element tend to have not only hardware accelerators for crypto but also you know, tend to leak less in terms of, you know, electromagnetical information.

22:41

Aaron van Wirdum Right. So in any case, in the COLDCARD, there are two chips and one of the chip, which is sort of the secure elements, in this case, in the sense that we just discussed, and that just holds the private keys. Does it generate the private keys?

23:00

Lawrence Nahum I think with COLDCARD you have various ways you can generate the private keys even with coins or dice or like externally. I'm not sure which chip they use between the two to create the private keys.

23:12

Ben Kaufman I'm not sure about the initial randomness but they also offer you to use dice rolls I think.

23:20

Aaron van Wirdum So is there, what kind of trust is there, if any, is there still trust involved there? Like what would be the worst case scenario there then if the secure element turns out to not be secure or turns out to be backdoored or there?

23:37

Ben Kaufman There can always be a bad… even if the mnemonic is completely random and it's not like backdoor, like the generation of the mnemonic itself. It is still possible, for example, to leak some of the private key information while signing Bitcoin transactions. And for people it will look like noise, only for the guy who put the backdoor, he will be able to actually read that. So there's always some risk, I would say. But usually it's not, I would not say it's a very high risk usually.

24:09

Aaron van Wirdum You think the risk compared to, for example, the Ledger, you know, polar, that side, you think the risk is in fact diminished by using two separate chips?

24:20

Ben Kaufman No, I think it's more or less the same in that sense, I would say. From that aspect, I think it's more or less the same.

24:28

Lawrence Nahum I would say it sits in the middle between... Trezor and Ledger. I think Ledger is a little bit more secure. But it's a nice design because you can keep the rest of the source and this chip is not used for almost anything other than securing the money. Obviously, the chip could have some error or some bugs or some other problem that allows to bypass the PIN or to extract the key somehow. But at the moment, there's no known… issues with that.

24:57

Aaron van Wirdum So at least there you can sort of inspect or understand more parts of you know how the wallet works compared to a Ledger where in a Ledger sort of everything happens in the dark to call that. Well, I don't know, is that is that a good way to put it? So, well with the OpenDime more parts of it are open and therefore… Oh, sorry what did I say? OpenDime? Yeah, COLDCARD yeah, COLDCARD with the COLDCARD, more stuff is happening in the open then. And therefore, you can sort of verify more of it and see what's, you know, there's less room for attack again.

25:29

Lawrence Nahum Yeah, right.

25:31

Aaron van Wirdum Okay, so the COLDCARD uses two chips. One of them is a secure chip, secure element, whatever you want to call it. The other is a regular chip. The secure chip only stores the private keys and the rest is open source. Therefore, there's less, you know, you have a better idea of what's actually happening and what's going on so that's why it sort of sits in between the Trezor where everything is open source but it has this downside that you can extract the keys if you have physical access to the device and you don't use that extra passphrase; and then on the other end Ledger where it's all sort of in a secure element so you can't extract the keys but there's the trade-off that you don't really have the same level of knowledge or control of what's actually happening.

26:17

Lawrence Nahum Yeah, to give you an idea, um once you put the PIN and the the private keys are loaded on the non-secure chip in the COLDCARD technically at that point you could try to extract the keys. But, you know, if someone takes your COLDCARD from, you know, your desk or something, usually it's not, you know.

26:40

Aaron van Wirdum They can't get the private key because these are still locked in the secure chip.

26:44

Lawrence Nahum Exactly.

26:45

Aaron van Wirdum Right. So, yeah, that's sort of the main, I think, yeah, sort of the, or at least to give an idea of what hardware wallets are and what the different trade-offs are that they make. So now let's get to your hardware wallet, Jade wallet.

26:59

Lawrence Nahum Yeah.

27:00

Aaron van Wirdum So what trade-offs does the Jade wallet make? Why is there a new hardware wallet needed?

27:07

Lawrence Nahum Well, so let me start from the chip because it's continuing the conversation we just had.

27:15

Aaron van Wirdum Yes.

27:15

Lawrence Nahum It doesn't have a secure element. It has a chip with some security features such as a secure boot and flash encryption. Basically, the secure boot part means that you cannot flash any firmware on it that is not signed by Blockstream unless you get a DIY version.

27:39

Aaron van Wirdum Flashing it basically means copying it.

27:41

Lawrence Nahum No, no, no. Flashing as in upgrading the firmware, upgrading the software on the device requires a signature that is checked during flashing and bootloader. And the flash encryption works by some eFuses. eFuses are basically a part of memory of the chip that, once written, cannot be rewritten. And specifically, these eFuses are only readable by hardware, which means you cannot read the key that is then used to encrypt the flash, which, in the case of Jade, is using AES.

28:23

Aaron van Wirdum This sounds very complicated to me right now. So let's break this down. First of all, there's one chip in the Jade or two? Well,

28:34

Lawrence Nahum there's only one chip when it comes to running the firmware or touching your private keys and so on. There's actually a couple more chips. One, it's used to control power to the display or power to the camera and so on.

28:54

Aaron van Wirdum There's one main chip for security.

28:56

Ben Kaufman It doesn't have a secure element.

28:59

Lawrence Nahum Even Ledger Nano S, for example, has two chip, but the second chip is only used to drive the display or the buttons.

29:06

Aaron van Wirdum When I say one chip or two, in this context, I guess I'm talking about the security sensitive stuff. Only one chip. One chip and is this chip open source or no?

29:18

Lawrence Nahum Well, no chips are open source at the moment for all hardware wallets. So there is no open chip. The PCB or the board schematics and everything are open source. I would say it's like a Trezor in this sense.

29:33

Aaron van Wirdum It's more like Trezor in that sense. Okay. But you mentioned there's also something secure.

29:41

Lawrence Nahum It has some more security features than the ST32 that the Trezor uses. It's a chip called ESP32. It's produced by a company called Espressif in Shanghai. And they use a technology stack created by an American company called Cadence. The architecture is called Xtensa. While, say, COLDCARD and Trezor use an ARM chip.

30:14

Aaron van Wirdum Am I understanding correct that this chip, it's a bit like a secure element, but it uses a different technique in that sense?

30:23

Lawrence Nahum Well, it has some secure element features, but not as many, especially hardware measures, as the secure element used by Ledger. It also doesn't have as many, say, government or military certification as secure elements do, but it does have some, you know, relatively strong security feature.

30:49

Aaron van Wirdum Right, so in a way, this chip on its own sort of sits in between the security models of Trezor on the one hand and Ledger on the other.

30:57

Lawrence Nahum Is that the right way to look at it?

31:00

Aaron van Wirdum That's just the chip.

31:01

Lawrence Nahum Yes, and I would argue it's a little bit closer to Ledger than Trezor. I don't know to what extent, but that's… that's, you know, where I think it's right.

31:10

Aaron van Wirdum And then I think there is another like, there's, there's more to this wallet. There's another sort of layer of security to sort of cover up for the fact that it's not as secure as Ledger in this way, but by the way before we continue, do you agree with the summary, Ben?

31:26

Ben Kaufman More or less, yeah. I pretty much agree with it, yes.

31:28

Aaron van Wirdum Okay, so yeah, so that so to sort of compensate for the fact that this chip alone is not as secure as the Ledger secure element, at least for these physical attacks, there's another layer of security with the Jade wallet, is that right?

31:42

Lawrence Nahum Yeah, basically, we use all the security features that the chip has, but we kind of assume that someone will manage to break them or that maybe there's a bug or maybe, you know, we assume that that wasn't enough. And so we created something that is kind of novel in the hardware wallet space. It's basically an improvement over a protocol that we designed for Green many years ago. Because you cannot really encrypt private keys with a PIN because it's trivial to brute force. Let's say you have a four-digit PIN, that's 10,000 tentatives, right? From zero to 9999, right? And so that's terrible as encryption, right? It's trivial to brute force.

32:26

Aaron van Wirdum PIN is not enough is what you're saying.

32:27

Lawrence Nahum Yeah, yeah, yeah. A passphrase would work if it's a good passphrase with good entropy and not easy to find in a dictionary or something. Or even a phrase in a book would be bad because people are brute forcing all sorts of things nowadays. And yeah, so we created a protocol where you... We can actually enforce three tentatives of the PIN, and we use strong encryption for the private keys for the mnemonic. We use AES-256. And there's basically a blind PIN server. By blind, I mean it doesn't know anything about you, it doesn't know anything about your public keys, or even the private keys, or IPs, or anything like that, or email, or nothing. And basically… There's a… the firmware of Jade has the public key of the server embedded like, it's, it's written in the in the in the firmware, and there's a…

33:24

Aaron van Wirdum There is a server somewhere and the server has a public key and that is embedded in the firmware of the hardware wallet.

33:32

Lawrence Nahum Yes, and the server is open source; you can run your own if you want. We recently added the functionality so that you can run your own if you don't want to use ours. And we're also currently working on a design where we have multiple servers with redundancies and whatnot. But basically, yeah, there's a protocol where there's a negotiation, there's an encryption key that's generated. And you provide the... a PIN to the server. The server doesn't actually see your PIN. They see a hash of the PIN plus some nonce that is kept on Jade, on the hardware. And if you provide the right one, it will give you this key that it's used to encrypt the private key or the mnemonic.

34:21

Aaron van Wirdum Okay, hang on. Normally, the private keys on a hardware wallet are encrypted, if we even can call it that, with a PIN.

34:29

Lawrence Nahum No, they're not encrypted. Usually they're not encrypted.

34:31

Aaron van Wirdum Wait, so what does the PIN do then?

34:33

Ben Kaufman [unclear]

34:33

Aaron van Wirdum They're protected by PIN. Oh, but that's not encryption.

34:36

Lawrence Nahum No, it just checks if the PIN is correct, then it will use the private key or if it's not correct. Basically, there's no point ever encrypting something with four digits.

34:44

Aaron van Wirdum Right. But on your wallet, the keys... are encrypted.

34:50

Lawrence Nahum Not only are they encrypted because we use flash encryption, but then on top of that, we encrypt it again with a key that is kept on a remote server, which you can run on your own and works with Tor and whatnot. And the idea is that instead of using a passphrase or just a non-encrypted access by PIN, we encrypt with strong encryption, 256 AES. And the key is not on Jade, the key is on a remote server, and the server will [unclear] give it to you if you get the PIN right. If you get the PIN wrong three times, both Jade and the server will delete [unclear].

35:23

Aaron van Wirdum Right, so there's an external connection. You need the PIN to get the key from the server, which in turn decrypts the keys on your device.

35:35

Lawrence Nahum Yes.

35:35

Aaron van Wirdum Did I explain it? Yes.

35:37

Lawrence Nahum But there is no actual connection from Jade to the server. It's just that when you connect it to say your Android or iOS or desktop or laptop or whatever, your software wallet will communicate with the hardware wallet. And there's this bit where, you know, if you want to enter the PIN, there's going to be a message that gets passed to the companion app and the companion app passes it to the server. Now, the companion app is completely blind to this. So it doesn't know whether you're requesting or setting a PIN. It doesn't know the contents of these messages because all the communication between the device and the remote endpoint are encrypted.

36:14

Aaron van Wirdum So in that sense, the extra layer of security, I guess, if I'm... If I'm getting it right, is that normally with a physical attack, you get the device in your hand and you can sort of keep spoofing the keys, the PIN, I mean, you can keep spoofing the PIN or in some way extract it.

36:33

Ben Kaufman If you manage to glitch it in some way, then yes.

36:36

Aaron van Wirdum Yeah, especially with the open source types then, right? That was sort of the problem there. In this case, because you're not 100… Well, you're adding an extra layer of security. So that… in this case there's definitely a server that's also required to decrypt it and if the server sees a PIN three times that's not correct, then the keys are deleted.

36:59

Lawrence Nahum Yeah.

37:00

Aaron van Wirdum No, the decryption key is deleted.

37:02

Lawrence Nahum Yeah, encryption, decryption, uh, it's deleted but also Jade will will notice that you got it wrong three times and will also delete everything, just like the other hardware. You could almost see it as a COLDCARD but instead of an ST32 the chip has some higher security features like encryption and secure boot. And then the other chip instead of being on the device is kind of remote.

37:26

Ben Kaufman Yeah, pretty much. I think that also COLDCARD has a secure [unclear], but I'm not 100% sure about that. But anyway, yes, I would say that instead of having the main difference is that instead of having the chip, everything on the device, then there is another protection layer, which is from a remote place.

37:51

Aaron van Wirdum So the most obvious question that comes to my mind is what happens if the server goes offline? In that case, it means your coins are locked, gone.

38:03

Lawrence Nahum Yeah, so that's one of the reasons we have the server being open source and you can run your own. And also the redundancy of the new design that we're having for the blind PIN server. But ultimately, the device could break, just like all hardware wallets can break or you know maybe you forget them in the washing machine or something in your clothes or whatever. The point is you need to have a mnemonic backup or you know private key backup and if the server is down you can just use the backup.

38:28

Ben Kaufman So as long as you have the backup, you're safe, even if the server goes down. The only difference compared to other hardware wallets is that if the server goes down and you don't have a backup, then just the PIN will not be enough compared to other hardware wallets where it will be. That's the main difference, I'd say.

38:45

Aaron van Wirdum Right. Yeah, that's important to mention because you basically always need a backup for a wallet anyways, for a hardware wallet. And in this case, you would still have the backup even if the server goes offline. You still have that.

38:56

Lawrence Nahum Yeah.

38:57

Aaron van Wirdum Right.

38:58

Lawrence Nahum By the way, Jade has a modality, a mode that works without the PIN, without the PIN server. And the mnemonic is remembered as long as the device is powered. As soon as you power it off, it's all gone. So you could have, you know… a situation where you just even if the server is done you just enter the keys again, sorry, the the mnemonics again on the device and you can use it without the PIN server,

39:22

Aaron van Wirdum Right.

39:23

Lawrence Nahum As an emergency situation.

39:24

Aaron van Wirdum Okay, so we've now covered four hardware wallets so let me see if I can sort of explain the trade-offs here in a decent way. And Ben, please correct me if I'm making a big mistake here somewhere. All right. So on the one end of the spectrum, we sort of have Trezor, which is the most open source, I would summarize. But it has the problem that the keys can be extracted in case of a physical attack, unless you add... uh a passphrase. Then on the other end you the other end of the spectrum there's Ledger. It has a secure element so the keys cannot be extracted but there's some trust involved in a way in what's actually going on on that secure element. Then we discussed the COLDCARD which has two chips so it sort of minimizes the secure element thing; it still has some secure elements but it does the absolute minimum possible, and the rest is used in an open source way. And then we have the Jade Wallet, which you just explained, which has sort of one chip that, you know, instead of two, it's one, which sort of sits between completely open source and completely secure elements. You think it's closer to secure elements, but then there's an extra layer of security involved with the signature needed from a server in order to actually be able to spend the coins. Did I summarize it okay?

40:53

Ben Kaufman Not a signature or like a decryption key, but yeah, more or less.

40:56

Aaron van Wirdum Right. Okay, so these are sort of the main security trade-offs of these four wallets. And there are more wallets, but... Yeah, we kind of cover the spectrum. And then there are more wallets that have their own trade-offs that sit somewhere in between or their own designs in other ways. Actually, that is a good point to bring up. There are other differences between the hardware wallets, of course. We've now discussed the security trade-offs, but let's very briefly maybe mention some of the other... design choices that could be interesting for people to know about? Like, how does it connect to your computer? There are these kind of differences as well, right, Lawrence?

41:37

Lawrence Nahum Yeah, so USB is the first thing that came out with Trezor, right?

41:42

Aaron van Wirdum That's how you connect it to your computer—

41:44

Lawrence Nahum or to your phone even, if you have the right cable or adapter. Then Ledger came out with the Nano X, which has Bluetooth support. COLDCARD came out with SD card support as well as cable, USB cable. There's some that use QR code. Jade is kind of using USB as well as Bluetooth as well as QR codes. QR codes are not enabled yet in the firmware.

42:17

Aaron van Wirdum Yeah, it actually has like a camera thing, right?

42:19

Lawrence Nahum Yeah, it has a camera, which we do use internally for debugging and testing, like loading the mnemonics faster than having to type them in, for example. But that's only for development at the moment. And actually, this affects also trade-offs in terms of security, because everything with radio, it's easier to attack remotely, which is why we have two firmware variants, one with BLE support and one without, and it's not even compiled in and it's completely disabled. Yes, there's various ways.

42:54

Aaron van Wirdum You mentioned that there's some security trade-off maybe involved, but this is mostly about usability, this kind of stuff.

43:03

Lawrence Nahum I mean, yes. For example, on iOS, there's no way other than Bluetooth or maybe QR codes to use iOS. And so if you want to use iOS, Bluetooth is kind of like... The way forward.

43:14

Aaron van Wirdum Right. Okay, then I want to ask one last question because the podcast has been getting pretty long and also pretty heavy, I think. You have an intense stare, Lawrence. You're zoned in. One last question. Okay, the concept of hardware wallets itself. There is the argument that the whole concept of hardware wallets itself... It's not a really good idea. Exactly because now you have a device that's explicitly intended to store your private keys and that everyone knows is explicitly intended to store your private keys. So that makes it sort of a target. So that can be a supply chain attack kind of thing or maybe other types of... Even the physical attack, it's, you know, if you see... a Trezor laying around, you know what it is, and so you know that that that's something that's probably storing private keys; well if you just use a wallet sorry a phone that you you know you buy a cheap phone you do nothing else with it you just use it as uh as a hardware wallet then no one will know that there's Bitcoins on it, presumably, and there's also much smaller risk for supply chain attacks. What do you think about this argument sort of against hardware wallets in general?

44:37

Lawrence Nahum Well, you're right. I mean, there was also that Ledger leak.

44:42

Aaron van Wirdum That's also a good example, yeah.

44:45

Lawrence Nahum So I agree in principle that you avoid the entire supply chain attack with a laptop or a phone. It's never going to be as secure as a hardware wallet. Even, you know, the worst hardware wallet is much better than a phone or laptop in terms of security.

45:00

Aaron van Wirdum Do you agree with this, Ben?

45:02

Ben Kaufman Yes, so it's different trade-offs in terms of security. So in this sense, it's a supply chain risk versus physical risks and etc. But also, there is the option of DIY hardware wallets.

45:22

Lawrence Nahum You can basically flash the same firmware that runs on Jade on at least three or four different off-the-shelf boards that you can buy on Amazon or AliExpress like M5Stack or the T-Display and there's a couple more. And also there's a DIY Spectre.

45:40

Ben Kaufman Yeah, there is the Spectre DIY which is a more expensive one but is also supporting QR codes, communication and is completely off the shelf. So there are very different trade-offs and you could use a hardware wallet which is DIY in order to avoid supply chain risk but then you have to do a bit more work, in like assembling and flashing firmware and stuff like that; so it's always trade-off between some things either convenience and usability and security physical security supply chain risks, all of that needs to be taken into account. I think for most users using a hardware wallet still makes it the best trade-off but it can very much depend personally on your personal skills etc.

46:36

Lawrence Nahum Yeah, and just to finish, I would say that the most secure thing I believe out there right now would be to use all of these hardware wallets in multisig together, because then even if one of these manufacturers is bad or even if you get a supply chain attack on you know receiving one of those, the fact that you have so many different hardware wallets from different brands and different teams and so on means that one single one cannot compromise you. Whatever is your K of N, multisig, you know.

47:03

Aaron van Wirdum Yeah, you can buy like five hardware wallets from different manufacturers and make a three out of five set up or something like that.

47:10

Lawrence Nahum And then someone will need to compromise three hardware wallets before they can get your funds.

47:13

Ben Kaufman Exactly.

47:13

Aaron van Wirdum And this is possible in Spectre, right?

47:15

Ben Kaufman Yes, so Spectre is used for that. Yes, it allows you both single-sig but also multisig with all of these hardware wallets. In any combination you would like. So it's a very different security model compared to just trusting a single hardware wallet.

47:34

Aaron van Wirdum Right. Well, interesting. I actually learned something during the recording of this podcast. I always pretend to ask questions that I already know, but this time I actually learned something. So thanks, guys. Thanks, Lawrence. Ben, thanks a lot for helping me out here.

47:49

Lawrence Nahum For sure.

47:50

Aaron van Wirdum For keeping Lawrence honest. This was the Van Wirdum Sjorsnado. Thank you for listening.