Building the PQ1: The first verifiable post quantum hardware wallet
Devcon 8 · 6 Nov 2026 · 24:42
Nicola Ceornea and Markus Haas of FreedomFactory present the PQ1, an open-source hardware wallet that signs with the SPHINCS hash-based post-quantum scheme instead of ECDSA. Nicola covers the chip and secure element design, AI-assisted firmware checked with Lean and EasyCrypt, and a memory-fill check that the device runs only the intended firmware. Markus covers signing twice with masking against electromagnetic leakage, automatic key rotation, an ERC-4337 onchain verifier costing roughly 120,000 to 150,000 gas, Merkle-proof clear signing and encrypted shipping data. Q&A covers signing time, duress PINs and random number generation.
Speakers
Topics
From Devcon 8, hosted by Ethereum Foundation.
Transcript
[music] [music] >> Hello guys. Thanks for coming to our talk. My name is Nicola and this is my colleague Marcus. And as our MC just very nicely stated, we're going to talk about the PQ1, which is another wallet that we're building right now. We will talk a little bit about the technical decision that we took and explaining why we did them. So maybe you should start the presentation a little bit by asking ourselves one question. Which is [snorts] not working.
So do you use another wallet? Well, there are many reasons as one would say yes or no. But maybe we can go a little bit more to philosophical and ask each other another question. >> [snorts] >> So what is another wallet? So I think the definition that I like the most is the following. Oh my gosh. Oh, sorry. Which is a device that is meant to reduce the attack surface um the the attack surface while using cryptocurrencies. So what is attack surface? So you probably have something like this in your pocket or in your hands calling right now, which is fine.
And uh a lot of people use crypto for their from their mobile. But if you peer behind the curtains and look a little bit to what's happening behind the the your screen, we you see that we have a lot of other surfaces of software surfaces, which is your apps or your hardware components that compose your phone that could be exploited in the future to again access to your device. And this is something that I like to call the security spectrum. All this stuff that we understand falls somewhere somewhere here. And there are many ways where that you that we can employ to fix them. Now hardware wallets do a very practical
thing and they "You know, we don't need all this stuff, so let's just get rid of it." But, of course, stuff still happens, and this is a stark reminder that there is a lot of stuff that we don't see, and we need to be very careful of not just staying static and actually improve, because at the end of the day, security is just a point in time. So, this does not only apply to hardware, but actually to the software that we employ in our block in our blockchain technologies, for instance, Ethereum. Maybe you see this post by Justin Drake, as our MC suggested. He said more or less that ECDSA will not last forever. So, the question is, why is
that the case? So, in short, we can understand uh uh the the cryptography cryptography used by Ethereum today is something called elliptic curves, and in an eventual future where we have uh strong computers, it would be possible, in short, to get your public key, the one that you used to tell your friends where to send the crypto to, could be employed to reverse engineer what your private key is. And sadly, this is something that I mean, this was known for a long time, but it was still okay because it was well understood at the time, and there was a lot of work done, and we didn't know at the time that the the technology will improve so fast.
Now, not to say that everything is over. Ethereum and other blockchain technologies are employing a lot of time and effort into finding solutions, and I'm very optimistic that this this will be found before it comes to to it. But, today we are going to talk more about what we be playing with. So, the PQ1 stands for forecast to post quantum one, is our attempt at solving uh the quantum problem today. It's an open-source hardware wallet, uh fully open-source on our GitHub hub, which uses an account abstraction abstracted wallet to do the transaction, which my colleague Marcus will talk more about. And it also has a clear signing, which will also be
something that Marcus talks about. So, the hardware stack is composed of the main chip, the STM32U5, and then we have a two secure elements, the Trust M V3 and an EdgeLock SE050. In short, your private key will be stored in a split XOR configuration in both those devices. And then it will just be recomposed in the ISO hardware isolated secure world on the top right. So, it gets recombined, and this is what is being will be used to sign your transactions.
So, we built the PQ1 with a lot of agent coding and if you worked with it with those, you know they are very error-prone still, even though they improved massively in the last couple of years. So, we started to employ a little framework internally that we used to develop with AI. In short, we lay a spec of what we want, and then our agents will start building it. Eventually, there will be a wave of reviews where we employ a swarm of AI agents to verify the code, and this we can happen multiple rounds until all the um the agents approve agree on the solution provided.
Then there is a manual check that we do, and then the the things repeat until we're good we feel that the firmware is stable enough. Now, of course, that's not enough for us, so we started looking into formal verification. So, our firmware stack is built using Rust, and there is a pipeline so a tooling called Aeneas that we can use to take our Rust firmware and translate it into Lean specs. We also take the official documentations from STM about the chip that we are using, and we also transform them in Lean specs, which we then use to approve that our software is actually uh, bug free in the sense of
it does what it's supposed to do correctly. Now, we do the same thing for our signing scheme, but for this we use something called EasyCrypt, which helps us calculate and measure the software bounds. Now, of course, uh, hardware wallets just because the software is secure doesn't mean that the one that you will receive in the future, now independently of which one you're going to buy, is actually running the correct software. So, we started also thinking what could we do to improve the situation, uh, at least with our hardware wallets. So, we found a paper from 2017 that suggested a cool way to do this, in which like the short time of it is
you take your hardware device that you have and you fill its entire memory with uncompressible bits. Uh, after a power cycle um then we take again the data that we just wrote into the um, the hardware and we compare them to see if something has been changed or modified or deleted in any way. If the data that is turned back is the same as the one that we put in, we know that it wouldn't been possible for a hardware to put malicious software on it because there was literally no space for them to do so.
Afterwards uh we do uh, provisioning of the hardware uh, where we lock down the the chip, so meaning we put a certain memory pages into read only mode and then uh, the bootloader on each subsequent uh, reboot will hash its own firmware and give you a digest or checksum on the screen, which is displayed as eight words uh, uh, black on white. But now, I think it's uh, it's a nice point to start talking a little bit about uh, post quantum signatures and what we did with this and for this Marcus will help us.
>> Thank you, Nicola. Yes, I will take it from here. Let's talk about post-quantum signatures, but let's first start I want to talk about there's essentially three different hardware wallets in the world right now. The first one that doesn't have any mention of quantum in their marketing materials, then there is the ones that call themselves quantum ready, and there's the ones that actually do post-quantum signing. So, the quantum ready ones are essentially two right now. It's called the Ember Ice and the Trezor Safe 7. Now, the Ember Ice calls itself quantum ready because they say, "Well, our hardware has enough computational power to theoretically do post-quantum signing in the future."
Now, the Trez- Trezor Safe 7, the reason why they say they're quantum ready is because they say, "Well, our firmware upgrades are quantum secure and so quantum computer cannot fake a firmware upgrade." Now, in my humble opinion, if a quantum computer arrives tomorrow, I don't really care if my firmware can be, you know, maliciously upgraded. I care that the very first thing the attacker is going to do is take my crypto and suck it out into their own wallets because quantum ready doesn't actually mean that your device is secure from quantum computers. Now, post-quantum signing hardware wallets, what they do is they do not allow any ECDSA spend path on your actual assets. So, the only way to authenticate a transfer is using
a post-quantum signature like with the PQ1. The post-quantum algorithm that we chose is SPHINCS. It's a hash-based post-quantum algorithm, and specifically the C10 parameter set, which means that the signatures are compressed. It's also faster to sign on small hardware, which our hardware wallet is. And also for the user, it's the very same experience as having like a regular Ledger, for example, where you create a seed phrase, but instead of deriving an ECDSA private key from your seed phrase, you derive a post-quantum key from the seed phrase.
Now, how does the PQ1 sign a transaction for real? Well, we do it twice. For once, to guard against computational faults, but also because of a very interesting attack surface that hardware wallets have. And it's called electromagnetic radiation. So, a lot of hardware wallets, when you do signing on the actual components, they emit a certain electromagnetic radiation that a lot of uh attackers have shown it's possible to reverse engineer into the private key that is on the secure enclave. So, what do we do against that?
We first of all have a little shield on the component so that we reduce the radiation. And then we do a second thing called uh masking. So, as I mentioned before, SPHINCS is hash-based. So, when we sign a transaction on the PQ1, it's doing a lot and lot of hashes, like for quite some time. So, what we do is we introduce randomly certain hashes that also are calculated. They look just like the regular hashes, but they are not included in the actual signature. Now, what does that do? It introduces noise into the electromagnetic radiation, which makes it impossible for attackers to reverse engineer the private key from that. And we do that twice, and then we compare and verify it, and then we
release the signature. Now, how does that compare to ECDSA? Well, the simple is that it's quantum secure, of course. But the one downside is is that the signatures are much larger than an ECDSA signature. So, you can see a SPHINCS-16 signature is 4 kilobytes, about 62 times larger than a regular ECDSA signature. But, there is an antidote for this. In the future, what we're going to do is we're going to aggregate many signatures into one STARK proof, and then we only have to verify the STARK proof for many different signatures, which will decrease the amount of gas that we need to pay per transaction significantly.
Another interesting fact about SPHINCS is that you can only do a certain amount of transaction with a key before the security slowly degrades. So, with a regular ECDSA wallet, you can do as many transactions as you want. The security doesn't degrade. Of course, it's still recommended to rotate your wallet at some point, but it doesn't degrade technically. But, with Sphinx, after especially with our set, after 65,000 signatures, you slowly lose security of the private key. So, we did was we created a system that automatically rotates the key and makes it so that you can actually do 4.3 billion transactions per wallet per chain, which to put into perspective,
Ethereum mainnet doesn't even have 4 billion transactions, uh you know, in all of its lifetime until now. Oh. So, outside of the PQ1, how does it uh how's it implemented? The PQ1 releases the signature after it signs. Then, the bundler will um then the app, basically the companion app or extension, will take that signature and submit it on chain through a bundler, for example. The bundler executes the entry point, the ERC-4337 entry point, and their entry point then asks the smart contract, it's an on-chain verifier, essentially, that verifies the Sphinx signature, and it asks, "Hey, is this signature correct for your wallet?" And then it verifies the transaction uh the signature on chain and says, "Yes, it's
correct." or "No, it's not correct." And if it's correct, it then executes the transaction that you wanted to do. Now, we also did a lot of work regarding predictable addresses. With auto-rotating keys, the problem arises, what if you already rotated on one chain, but didn't rotate on the other chain, then you have a different address there, or you use the old less secure private key from before. So, we made it so that there's actually a master private key and uh slot private key. So, the master rotates the slot keys, and the slot key does the actual transaction signing.
Now, many people have asked us, "Why didn't we choose lattice-based signatures?" And the truth is, our proof of concept actually did have a lattice-based signature, but our very first proof of concept also took 5 million gas on chain to verify for one transaction, and that's obviously way too much for, you know, regular users. And not only that, but there's also some assumptions about lattice-based cryptography that aren't as tested yet as hash-based cryptography is. So, we decided to go with a Sphinx eaten because it's hash-based. It's more conservative post-quantum, and also it's very quick to sign on our hardware.
Now, we also did a lot of work for clear signing. With hardware wallets today, you essentially have to trust that your the website, your browser, your OS, your laptop, your USB controller, all of even the USB-C cable isn't infected, isn't hacked by a attacker that changes the transaction just in a little bit to make it seem real, but it's not actually it. So, there's essentially two type of hardware wallets, ones that save clear signing data on the hardware, and ones that basically trust a third party or first party API, and we try to put it all on the device. For example, the Ledgers, how they do it, they trust the Ledger API. So, instead
of you having being able to see what Ledger does, you send a transaction to Ledger, they create some sort of clear signing, and then they sign it as like Ledger created clear signing proof. So, they have to trust Ledger. Now, what we did as a result of this, we only have 2 MB of storage, which also houses the firmware. So, we came up with an interesting idea. We, instead of storing all the clear signing data on the device, we create a Merkle tree, and then we only have to save a 32-byte Merkle root on the firmware. That means that the app then sends the transaction data, the clear signing data, and then also the proof for the clear signing data. So, that it's all open and
inspectable, and the firmware doesn't have to itself save all of that data. So, how does it translate? As I said before, send the transaction data, clear signing data, and the proof that it's included in the pre-negotiated database. It then verifies the proof, matches the transaction to the actual clear signing data, and then builds a beautiful UI so you can actually see what you're doing. We also have built-in decoders for Cal-Swap and safe transactions because we really like their products. Another big thing for hardware wallets, and a lot of people have asked us about that, is privacy and hardware distribution. Essentially, every hardware wallet that exists today at some point has leaked their customers
data list. And it's not only their fault because the problem is as soon as you have a partner with which you do shipping, they have a list of your customers data, then they usually also have a sub-vendor, and they they have a sub-vendor. It's it's it's a constant spiel of having a lot of a lot of people all of their own access to your customers data. And so, even if you yourself are secure, some sub-vendor might have a security vulnerability which will leak your data. So, for example, with Trezor, they had a leak where the analytics platform that their shipping provider was using leaked their customers data, and this is bad.
But, so there isn't actually a solution out there today. And another problem with that is with you know, privacy is that what you buy reveals your intent. With a phone, you have a lot of use cases for that, so it's not really important to have or it's not that important to have privacy in your customers data. But with a hardware wallet, it's extremely clear what you're going to do with that data. You know, and it's really bad if you have a list of basically people you can visit that all have a ledger at home, you know, storing some sort of crypto. And as I mentioned before, you have the data replication problem. Payment processor, shipping partners, 3PL, your own company database, and it's amazing if you yourself are very paranoid about
your own data, but you cannot have all these partners that all have their own database and own security assumptions. It's It's really bad. So, one thing Yeah, these are the results of such systems. Many kidnappings all around the world, especially in France. And one remediation that you can do is you can incentivize crypto payments, but that also only works if your address is pseudo anonymous. If you have an ENS name that is your full legal name, then everybody already knows that what you bought and this is even worse than So, we built is something that we're going to open source very soon. It's called Serenade. And what we do we do encrypt the customer's data inside the browser using a cold storage key
and then only decrypted in the warehouse at the packing station for the shipping momentarily and then it gets cryptographically deleted. So, even though there will be many databases, all of them only have ciphertext. So, it's end-to-end encrypted from the customer's browser all the way to the warehouse. Thank you very much. >> Maybe a little bit >> Hm? >> A little bit. >> Thank you. Thank you. Thank you, guys. Take care. >> All right. >> Steps here. Now, I mean, whatever you want. Okay, cool. >> Uh and it's time for the Q&A session.
Again, our beloved audience, well, you are you are doing amazing job. So many questions and votes. Let's start with the first one. And this is going to be a pretty intense one. This These are three questions. How much signing budget does C-tan have? How long does it take to sign? And how much does it cost to check the signature? So, let's address them one by one. >> Perfect. Yeah, that's a great question. So, signing budget, 65,000 signatures and then the security degrades under 128 bits, but only slowly. So, it's not like you do one more transaction and you're lost, but it's just slowly. So, we rotate it. And then how long does it take to sign? We have an hash accelerator on the hardware, which makes
it so that it only takes to sign around two to three seconds. And cost to check the signature? well, our on-chain verifier right now costs around 120 to 150,000 gas, but obviously in the future with Lean Sphinx, we can take that down to around 3,000 gas. >> All right. Now to the next question and I guess many of you in the audience might have this question because all of these abbreviations, they drive us crazy. So, what is ECDSA?
>> Okay, so I can go more on this. So, it's just an abbreviation which stands for elliptic curve signature cryptographic algorithm and it's what's currently used on Ethereum and Bitcoin and most of the other popular blockchains. And the way it works more or less is through algorithm logarithmic multiplication. It's very easy for your private key, which is like your password, to generate your public identity, which is your address that you use to do to sign transactions, but it's very hard for classical computers basically impossible currently to do the reverse. So, the quantum problem that I spoke about before is that imagine that from your username online, I could find out what
your password is. This this is basically very like this is not how it will work, but to make give you a picture what would happen with if with a strong enough quantum computer and this is why we chose to use another signature scheme. >> All right, straight to the Oh, Jesus Christ, we have new top voted question. I have to change plans right now. Do you think there is a need for a false sign feature on hardware wallets in case someone kidnaps me and asks to sign? >> 100% 1 million percent agree.
What we have as a feature on our firmware and it's fully open source, you can check it out. It's called the "duress pin". So, you put this pin in and it loads up just like it if it was a a regular wallet, but a different seed that doesn't have your, you know, actual money. So, you can actually load up your duress wallet with I don't know, 100 bucks or 200 bucks or maybe even 1,000 bucks and then basically say, "Okay, yeah, this is my wallet. I don't have any more money." and give away that money. >> That's smart. That's smart. Okay, we still have time for a few more questions. So, the next one, do you use a quantum random number generator for the seeds?
>> Okay, so it's actually very funny. We have three true RNG on sources on our hardware wallet. So, the both secure enclaves and the RNG engine of the STM board that we use. And so, quantum random generator, the thing is the whole idea is that there's background radiation and some background noise in the world and that influences the little randomness generator of the hardware. So, it's it's it's if you go deep into it, it's like a super interesting subject. I don't like quantum random generator I would say in this case, yes, cuz there are certain quantum properties that influence it.
>> Interesting. I mean, really interesting approach. Do you have something to add? >> No, no, no. >> Okay. Moving up to the next question and even though I consider myself a bit of a technical person, it absolutely breaks my mind, but I'll try to read that. If you take in lean Sphinx, how then how long does your signature take at 2 to the power of 30? >> So, we haven't run benchmark on the lean Sphinx as parameter set, but we use soft eco Sphinx C minus 10, which is not too far off from this. So, a single Sphinx signature on our hardware wallet with key generation takes a couple of seconds.
So, the way we do it on the PQ 1 is we sign twice and we compare them. So, the whole flow as you need to take into consideration that UI is managed by the same core and it's not a multi-core. It takes in total something like 6 to 7 seconds and but it's unoptimized. We still need to run stuff on it. But, yeah, a single signature on lean Sphinx, I assume it will probably take just slightly more time to compute. >> Okay, after this answer I feel a little even less technical than I was feeling before. Anyway, we are over time. Huge >> [music]
Related talks
- The Hardest Hardware Wallet
- ethOS + dGEN1: Self sovereign OS + Hardware
- What You Sign Is What You Get: Ending Blind Signing with ERC-8009
- Future-Proof Your Treasury: Post quantum Accounts for Kohaku wallet
- Building the Ethereum Universal Signer
- Constrained Signing
- Threshold Signing
- Clear Sign All The Things
- Securing DeFi - A sneak peek in the world of Ledger Nano Ethereum plugins
