Unlocking Privacy on Chain: Advancements in Hardware for FHE

ETHCC 7 · 11 Jul 2024 · 19:22

Jan-Pieter D'Anvers of Belfort explains why fully homomorphic encryption (FHE) needs dedicated hardware to be practical on chain. FHE lets a server compute on encrypted data, enabling private transactions and smart contracts. He says usability is improving, while speed remains the barrier. He reports his company's FPGA accelerator at 123 times single-thread CPU speed, and targets 20,000 multiplications per second on dedicated chips by 2026. He says FPGAs come first because FHE parameters are still shifting.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

Hello everybody. Hello. So I'm Jan Pieter, and I'm talking about hardware for FHE today. So we're I'm from a company called Belfort, and we do provide hardware for FHE. So I assume you know about FHE, but I will do the introduction so that everybody's on the same page, right? What are we trying to solve? What we're trying to solve is essentially the data paradox. The data paradox is the fact that on one hand, data is the new gold, right? We have this AI boom, we can do amazing things with data. Um, but on the other hand, we know that we want to protect our data.

You don't want to put your medical data on a blockchain where it's public. You don't want to put your financial data, like maybe some of the transactions on a blockchain where it's too public. And so the question is how can we use data without disclosing it, without giving away all this data. And so the solution to this is homomorphic encryption, fully homomorphic encryption, which allows you to do computations on encrypted data. This means that one or more parties can encrypt their data, they send it to the server, and the server can do calculations on this data without ever knowing what the underlying data is. So the server just sees garble data, just sees randomness, but still can do calculations on your data.

And in the end, only one designated person can decrypt the data from here. Think about putting medical data on a blockchain, but making sure that it's encrypted, making sure, guaranteeing to people that their medical data is protected on chain, that their financial data is protected on chain, and thus making all these new applications possible. That's really what you have to think.

And there's a lot of possible applications. But on the blockchain, think really about privacy preserving transactions, like a company that is paying out all of their empire, and they don't want to reveal for every MPE what they're paid. Or you want to buy something from a supplier, you don't want everybody to know who you bought something for for what price. So if we take this a step further, we can go to smart contracts that are privacy preserving. Now I'm talking about FHE.

What is the state of the art? Where are we now? Well, the advantages are clear. This is a really amazing technology. We have this end-to-end confidentiality, we allow all of these new applications, but there's certain barriers to adaptation. The first one is, for example, um usability. Um, how do we use these things? And the second one is cost. And I will talk about both of them briefly. And the first one is usability. So working on FHE used to be highly technical. You used to need to have like cryptographic engineers that understood the mathematics behind this to work on this. This is no longer the case, right?

At this moment, there are companies like Google or Glaxama that are working to provide tools to make it really easy for you who might not be a cryptographic engineer. So you're just a pro you're a programmer, you know all about blockchain, you know all about this, but you don't know about cryptography. Well, you can use FHE at the moment. Um yeah, just download one of the these libraries, play with them. It's really cool. So, this usability problem, at the moment, we're really solving this. Um the second problem I mentioned is speed.

How can we get these operations? Because FE comes with a cost, it's it's more costly. So, how can we get FHE to a point where we can actually use it in all of these cool applications? And so there has been a lot of research where we try to improve the maths and we try to uh better fit these algorithms, as you've, for example, seen in the previous presentation also, partly. But in the end, you hit a wall, a wall of what you can do if you do all of these improvements. And then it comes, and then you hit this wall and you say, How can we really improve from here? And the answer is really uh compute platform hardware.

So at the moment we're working on CPU, maybe we're already working on GPU, but what we really want is to go to FPGA to go to ASIC. Is really a dedicated chip, making a chip. Um, and every time you you go from CPU to GPU, from GPU to FPG, every time you go uh to the right in this graph, think about gaining a factor 10 typically. But also think about the fact that designing for this takes you also 10 times more effort. You need really dedicated team of people that have high knowledge of these uh things, like making a chip is not easy, right? So it comes with a cost, but it comes also with the advantage that we can gain this factor 10 every time we go to the right.

And so um this is just pictures of all of these. You know CPU, you know GPU, FPGA we call come uh immediate immediately too. Because we are working on FPGA. So, what is an FPGA? FPGA is programmable hardware. Think of it as a chip where all of these hardware ports like end gates or gates are already on there, and what you do as a programmer is just make the interconnects. I want to connect this one with this one, this gate with this gate. And so the advantage here is really that it is programmable.

In one day, and I will give you a demonstrator later, we can program for this and roll out our new application. If we have a new version, if we have new parameter sets, we can program this. This is not the case if you build a chip. So if you build a chip, you start working, you have all your design ready, you send it out, and half a year later you will get your chip. You test it. If something is wrong, then you have to make a new version and wait half a year. So with FPGA, we can really amp up this process and really go because in one day we can have a new version, test it. If something doesn't work, we make a new version.

If there's new parameters, uh in one day we can have a new version. That's really the strength of FPGA. Now we're working on top of the latest technology node. So this means that we can still have this very, very high performance, and we will showcase that at the end of the presentation. FPGA is also available in the cloud. We don't make chips that we then have to put in the cloud. We can use this right now. Amazon has, as you can rent a CPU at Amazon. You can also render the CPU with FPGAs on Amazon, which means we can scale easily. We put our solution on the Amazon cloud, uh, a customer rents out this cloud space and has immediate applic um uh speed up of their application.

And so we see really hardware as an enabler for this technology. Think of it in terms of AI. So AI is a neural networks have been invented in the 1950s. We have seen actually no real adaptation of neural networks until the 2010s, where we see that hardware becomes available, that we can do all of these calculations in a cost effective manner, and that completely changes the picture. And so really having this efficient hardware makes this breakthrough of AI possible that we're seeing at the moment. And the same thing is true for ZKP.

So also this is a very old technology from 1985. And we see recently that there is a breakthrough, also because we can calculate all of this in a cost-effective way. And we believe that FHE is really the next step where we really take a technology that is old. I mean FHE is not that old, but it is an older technology, but we're really at the point where we can make it cost effective enough to deploy widely. So who are we?

We are Belfort, and we're essentially a company that targets hardware acceleration for advanced cryptography. Our first target is TFHE, and we've been rooted in cryptographic hardware design for years. So we're in a research group, we have years and years of experience, leading experience in building cryptographic hardware designs. And our first hardware accelerator is actually out now. So Belfort, if you look at our hardware accelerator, we provide at the moment 123 times speed up versus single thread CPU. And further speedups are coming.

Also, as I said, there's fast scalability. We can deploy this on Amazon Cloud. So if you want to use this, uh you can try it out. You don't have to buy the chip, you can just rent out some space on Amazon Cloud. And we also provide seamless integration into TFHE libraries. And I'll skip over this so that we have time for questions later. But what we provide is really acceleration per operation. So on CPU at the moment, you can do about 175 multiplications, 8-bit multiplications per second. With Belfort, you can at the moment do 250 multiplications per second.

But really, now we we can start to bootstrap this. We have this first version, we know how to speed this up. And by next year, we will be able to speed us up by a factor 10 on FPGA. We know how to do this. And by 2026, we will have 20,000 multiplications per second by really then going to dedicated chips for this. And so this means that we're really at the start of affordable FHE. So what does this look like? Imagine that you want to use FHE. What do you do first?

Well, you have to see do I want to do it on my own cloud? Do I want to do it on Amazon clouds? Both are possible. That's the first choice you have to make. The second choice you have to make is you choose any supported library. So you choose a library, you start programming it, it's really easy actually. Really try, they're open source libraries, so try it. And the third thing is uh you use the Belfort accelerator API. What does this mean? On the left, we have some code uh from TFE CRS where we have an application where we do uh multiplication. And on the right, uh we have the same application that we speed up with our accelerator.

Um so the only difference that you see is that we add one um line of code where we initialize our FPGA, then we put the FPGA in the library, and then the rest of the calculations magically will be sped up. And again, I will uh shortly uh showcase a demo of this. Now, this is just one library. If you have another library that you want to have uh supported, please contact us. This is possible. So, what I will would like to do now is give you a demo of how this works. So, what I'll do is I'll first run an FPG application.

And so, what this application does, it's essentially an application that you can use uh to reduce the bandwidth of FHE if if you want to communicate uh to your server. So it's just any application. We've programmed it with our easy interface in the library, not that hard to do. And what I'm gonna do is I'm gonna run it on our server that is uh in our company. I have an SSH connection. Um I'm gonna run it there on twenty uh on 32 threads, and now it's uh initializing. So while this is uh doing, it's starting to do calculations, and then uh in uh some time we will see the result of these calculations.

I will also do the same thing uh on FPGA. Uh we have a setup with four FPGAs. So I can start running at this. So at the moment, what we're doing is we're programming the FPGA, right? So it takes some time, the FPGA is programmed, and well, this is the result. So we're not only even there uh with the CPU, you can really see the speed up. I should have waited a bit more for dramatic effects uh here, but yeah, you really see the difference between the two. And this is what we're at at the moment.

In one year, remember we will have this 10x speed up. In two years, we will have this 100x speed up of this. And this is what we believe will really make FHE a tool that you can use in daily applications. So with that, I'm very happy to answer all of your questions while we wait for this execution to finish. We have quite some time for questions if we look at this. Yes. What's the decision to turn the FPGA into an ASIC afterwards?

When do you decide that you know it's like you're satisfied with the design and it's time to produce a chip? Yeah. So the reason that we're doing FPGA is one, as I said, is this very fast design time. But also, if we look at how we design this chip, we really optimize towards the parameters that we're using. And at the moment, the parameters are still shifting. So the algorithms are still changing, and we really want to keep up with the latest parameters because I mean the numbers that we're giving here is really the speedups of the hardware. But on top of that, there is still mathematical research, there's still improvements in the parameters, and so we really want to gain that too.

So that means that we don't want to in a year have this factor 10, but actually we want to have this maybe factor 100 because we've improved the schemes, we've improved all of these integration things. And so at the moment, as long as I think these mathematical improvements are still coming, we really want to be able to quickly uh have new versions that follow this. Once we see that there is maybe a standardization where people settle on certain parameters on certain schemes and say, I mean, for for blockchain, this is this is gonna happen, right? People will settle on a certain um scheme, and once we see that people have settled, we can go to ASIC design uh specific ASIC.

Uh so one important more important thing to notice is that our hardware design, this is a hardware design. So we can go to a chip manufacturing. Of course, we need to do changes, it's not like a one-day thing, but it's already a design that is also very nicely nice for chips. So yeah, thanks for the question. You mentioned that in the future we could get to like oh, sorry. Uh you mentioned that in the future we could get to like 20,000 multiplications per second, right? Uh or or maybe more. Uh yeah, we can be trying to figure out like what is the number of multiplication per second on a regular CPU right now, non-encrypted, just to get a feeling of the speed up? Not the speed up, like like so FHE will will like how how much slower compared to regular non-encrypted computation.

So again, this is for the hardware. This is just a comparison that we make with the CPU. And and I'm only qualified really to speak about, I mean, I actually know that there's gonna be speed-ups um in also other aspects, right? So we're only talking about hardware here. This is kind of the speed up that we can deliver at the moment with the hardware is another factor 100. On top of that, we will have speed ups uh because improvements in in in in mathematics and so. So I don't know what the the final overhead will be in let's say in in in two years, right? Because 10, whatever.

Because you know, I think we will and and it's an interesting thing, but I I think the speed up in in two years I mean the slowdown will still be like a factor 100 um in two years in the future will be less but uh yes definitely a factor 100 slowdown so this means that you're looking at applications for now where you have high value data right finance medical data where you really have this high value data where you really want to do this calculations if we look at five ten years maybe then we're looking at applications like large language models where the computation costs has shrunk so much that we can actually do this I think that's kind of the timeline the next two years go to applications that are that are like high value data applications in five years in ten years we'll go to this mass uh mass production uh things thank you thank you any more questions yeah if you have later questions you can always also contact me so still following up on the on the ASIC thing like when when you reach a design like how much flexibility do you have on the let's say you settle for TFHE for example uh what what flexibility do I have as a user uh if I use like a TFHEAZ can I still tweak some of the parameters like security level uh all the other different things like that or or is it like always set in stone and I have to use it this way okay so um let's go from from top to bottom.

You will not be able to do other FHE schemes. Like you'll do TFHE, right? We don't want to have that flexibility, that's gonna cost you too much. If you go down, there is certain tweaks you can do, but the more flexibility you want, the more it's gonna cost you. And it's a trade-off that's with the evolving markets, we're eager to see, right? If the industry settles on this is a standard, this is the parameters, we will make like a very optimal design for this. If however there will be like a range of parameters, um then we will be more flexible. And that's definitely possible, but that will come with a cost.

And that's essentially something that I think in the next two years, that's why we're developing an FPGA. In the next two years, that's something that we want to figure out what does the market what is gonna how is the market gonna consolidate around like one or two parameter sets, or around we optimize for each scheme and then we will need to be more flexible. Of course, flexibility comes with a cost. So if if you're a software developer or developing parameters, know that you can change the parameters, but the hardware this will have a cost in the hardware. So take this into account, maybe talk to us.

That's that's the best uh yeah. Okay. Thanks for your attention then.

Related talks