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

Loading player…

Bring On-Chain Confidentiality With Fully Homomorphic Encryption (FHE) | Remi Gai - Inco Network

Ethereum DenverWed, Oct 9, 2024, 12:00 AM

Speaker

Remi Gai

Fully Homomorphic Encryption (FHE) has recently been introduced into the EVM ecosystem as a pre-compiled option, known as fhEVM. This integration is a breakthrough in blockchain confidentiality and permits a range of encrypted operations and comparisons without revealing the underlying data. APPLICATIONS FOR ETHDenver 2024: #YearOfTheSpork ARE OPEN APPLY NOW https://ethdenver.com/apply

Transcript

[Music] oh hi everyone uh my name is Remy I'm the founder of inco we're a modular confidential Computing Network so maybe just to start off why do we care about confidentiality so if we want to use blockchain as the value layer for all of us then you know confidential is important because it's a fundamental human right the simplest example I can give is you wouldn't want for example your neighbors to know how much crypto you own right but this is the problem with public blings nowaday is that everything's public second is it's going to be extremely hard for institutions and Enterprise to adopt crypto if it's completely transparent and this is because there are regulatory requirements but also as you know Enterprises they also competitive advantages that you don't want to leak directly on chain and then lastly you also uh want to have the ability to build applications uh that basically requires some confidentiality so for those who came to web 3 today you would quickly realize that you can only build use cases that only make sense on a transparent database but this is not how web 2 Works what if you want to build a poker game you need to be able to have some confidentiality on chain in order to enable these other use cases and so this is where we come in so we are leveraging a different cryptography called fully homomorphic encryption F so what is FHA from a very high level it's a cryptography that allows you to encrypt data but also compute on top of it so imagine you were to encrypt some integers you can still add the vi multiply but also compare them and for folks who are not developers imagine if you were to encrypt this C picture into this pixelated image you can still modify the RGB values uh while being crypted and when you decrypt you have this uh Magic filter basically applied to it so this is really the unique property of FHA so in the context of privacy you know we do have you know ZK solutions for privacy but what are some differences here I would say the biggest um differentiation here is the idea that if you apply FH to blockchain and store the seex onchain they're also composable and this is again because you can do computation on top of ined data so essentially in the context of blockchain this means that you can do state transition and so if you want to build some kind of you know multiparty uh use cases let's say predictions markets we can all submit our hidden prediction uh for the price of Bitcoin and still compute the average without having to decrypts now when you apply FH to evm uh called fhvm essentially what you have is you can have a encrypted State directly stored on chain uh so in this example on the first line you can see for a confidential erc20 it's just the mapping of address to EU 32 so EU 32 is just an encrypted integer to hide your balance and if you want to do a erc20 transfer you just do a FH operation for adding the encrypted amount on top of encrypted balance and then you're subtracting uh from the sender essentially and lastly we can also generate uh onchain Randomness that's also hidden by default which can be quite useful for games such as poker or you know uh games like Mafia where you have to generate a hidden roll so again here FH is an interesting solution because you know as compared to te we don't require any centralized Hardware compared to ZK we don't have to write any complex circuits this is all abstracted away in solidity and more importantly for multiplayer use cases you also don't need option coordination the blockchain acts as the coordination layer directly so what is inco inco is two things first we are a modular layer one blockchain uh that leverages FHA and second we want to extend confidentiality to existing chains so we want to be the universal confidential layer of web 3 just a high of the way this works is you know we are a l one blockchain uh evm based and then there we there's a FH Ross Library that's added at the precompile level so this is where you know if you need to uh support encrypted operations this pre-compile will be run to you know do the FH operations um throughout the execution for decryption there is a NPC system so this is where you know um if you want to do a decryption you basically each validator has a key fragment they have to do a partial decryption and you have to aggregate enough of a threshold to decrypt so this prevents uh any validator from know decrypting uh decrypting themselves and the way we bring confidential to existing chains uh is through General message passing so there are three ways we could do this uh first we can do it through IBC because we are a cosmos blockchain second we can also use external Bridges such as Wormhole axar uh layer zero and then lastly we are we will also support a Ned bridging and this is because we are built on top of I layer so you know as an nvs um these operators could also monitor States on ethereum so you know we are we will also support native bridging uh but the idea is this right um most public blockchains will now able to support FH because the hardware requirements are quite High there's also this NPC component so the idea is we want to bring confidential features to existing chain so imagine if you you were to build a game let's say on polygon you can just store some confidential States inco so now about the use cases right why why is confidentiality uh such a big unlock so we can start with gaming uh if you think about games today in crypto uh when they're built on public blockchains you are going to be very limited in the types of games you can build and this is because all the states are are known right so for example in a game of RPG if I know that you have higher stats than me why should I ever attack you right so if you think about web 2 Gaming most games that are fun require mechanics that hide certain information right so whether it's your stats uh whether it's your role so in a game like Mafia you actually don't want to reveal that you're the killer or the doctor or the detective in a game like poker in a game like poker you also don't want to reveal your cards onchain uh and then then again we can also you know conceal resources for a game uh RPG strategic game um we can also do bluffing you can sabotage so we think we can unlock quite a bit of Novel mechanics within the crypto gaming set of things uh and the second C is defi so there will be novel Primitives as well uh because again today you know most def5 Primitives uh only work uh if they make sense on a transparent database right but what if you want to do something like a dark pool like a blind auction or prob amm you need confidentiality and so we believe that we can unlock a suite of Novel def5 Primitives that could be quite interesting on the payroll side of things it's also quite of a you know helpful or useful um feature to have confidentiality because for those who already pay their employees in stable coin you probably face this dilemma where you know everyone kind of knows how much everyone's making and this is kind of a bad practice non bad practice in web too so for us in the example confidential erc20 you can just hide the amounts being trans transfer and that is essentially bringing in more of a web2 experience to web 3 so something that maybe we all already use is something called VMO right so you can send money to your friends um but people cannot see the amounts being sent right so this is kind of like the experience um that's more web to like and also necessary for Mass adoption we can also do private cap tables private treasuries uh mentioned realtime prediction earlier priv voting is also a quite important use case is today if you are part of a dow especially if you're one of the you know Executives or K's sometimes it might be very difficult for you to you know honestly vote right because there could be repercussions on your votes so a layer of you know privacy on voting is also a very practical um and necessary Tool uh for for d for DS I'll cover the confidential did in a bit um but yeah so this is a game that we built uh during EO NYC uh it's a fully onch Mafia game so for those who don't know what the game is it's about essentially it's a game of bluffing uh so you could be the killer uh you could also be a doctor and the detective and the g the the the goal of the game is to find out who the Killer is and so for this game to make sense on blockchain you need to be able to hide the rool so here it's very simple it's just A8 type uh within a struct and because of the ENT Randomness that we have you can also generate the hidden Ro directly and so this is uh essentially a novel experience that's not possible on public blockchains that we we are brought during e NYC and here again with the onch randomness we can enable you know car games um speculative games and this is built uh directly on the Chain the the the randomness uh and then in terms of you know extending confidential to existing chains you could for example build a poker game on base where you can make the deposits you know you can deposit 100 usdc you can raise you can fold just generate and store the cards on inle and then at the end of the turn just reveal the cards and settle back on base if you want to build an RPG game you can store the hidden loots hidden player stats on inco and just build the core game logic let's say on polygon for the missions for the you know the farming uh so this is kind of how we plan on bring in confidentially through existing chains so you know this is also a very good example of how confidential can unlock novel ideas within web3 today the IDS are static uh there're so bound nfts right so you will kyc with a third party that will send you some kind of nft that has static metadata so are you 18 are you based in Europe however with FH because we can do comparisons over encrypted data we can have this idea of a more dynamic or programmable layer did so for example I could encrypt your credit score store it on chain and do FH comparisons to reveal whether your credit score is about 700 or for for example for your age it could be your date of birth converted to timestamp and then encrypted stored on chain and then you as a end user you can basically toggle which insights you want specific applications to query so maybe for Casino dab I just want you to know I'm over 18 and nothing else so it's a very uh again it's a very much web to like experience similar to Google Au where maybe I just want to access my calendar but not my Google Drive right so um the way this works in code is very straightforward uh it's one L code here tf. GT meaning greater than all you do is you compare your credit score whether it's above 700 and then from there you just do a decryption and the way this is cool work in practice is imagine you have a money market on polygon you want to you know only allow users who have good credit scores to use it then you could request this D layer built on top of inco and then and you know as a callback you can then Whit list the user uh based on insights that you have generated so we are compatible with existing ethereum tooling uh so you can get started within 20 minutes if you're a solidity developer uh you can use hardhead remix metamask you can do a pretty wide array of operations and comparisons over encrypted data so this is really you know helping you Unleash Your creativity you can build across defi gaming uh because of it so we can do additions subtractions multiplications divisions uh you can also do all sorts of comparisons right this is a the example of the did you would just do comparisons on specific insights that you want to expose as an end user to get started you just have to import a line in code um this is a screenshot from remix one thing to note is building confidential Dap You have to slightly think differently because you don't want to leave leak information you don't want to leak um hidden information in your logic so for example if you were to have if and lse statements on top encrypted data the path of execution could potentially leak what the information is right so the way to go around this is there is a multiplexor function called SEO so what CX is is essentially similar to a turnery um for people who code in let's say in JavaScript right so the idea is on the first line of code what you do is you see what whether the encrypted choice is equal to Z one so here you compare to one what you get is an EO which is an encrypted ban with the EO you don't know if it's true or false it's encrypted you passes this EO into this seox function that Returns the first argument if it's true and the second argument if it's false so the first argument here is the encrypted V count and the second argument is zero but zero is also encrypted so essentially on the second line code you don't know if it's zero or the actual in V counts you do the same thing for against counter cast but it's revers right so you return zero if it's true and then the Inc vot count if it's false so one of these two values would be zero and the other one would be uh the ACT vote counts and you have both of them through their respective tality right so this is how you would build confidential applications with Ley information and then there are two decryptions so one is a decrypt function where you know the encrypted data is revealed to an entire network so very useful for games like poker right at the end of round you want to decrypt all the cards um reveal everyone's hand and settle the hand right the second one is more of a view function called read crypt the way this works is on the client side you generate a temporary private key and public key pair and you pass in this public key inside this view function so the validators they will basically use their key fragment to do a partial decryption and immediately reencrypt using this public key so all this information is sent back to the browser you basically use that private key to decrypt and then use the uh threshold recption to reveal the pl text in a safe manner so the way to store a cipher Tex essentially so a cyer Tex is the way you hide data uh in our system a seph Tex essentially is composed of data padding some data the pl text Data some noise and some noise padding so you generate this on the front end with the front end clients you encrypt this using the global FH key of the system and then you pass this information on chain right so this is kind of like the flow for um interacting uh with the blockchain and yeah so lastly we are sponsoring uh East hackathon uh we have a few bounties and for us we would really like to see folks uh basically building novel use cases that aren't possible on public blockchains and really kind of try to push for the next Frontier of deps and bring novel experiences similar to the mafia game that we build bu uh to the space we have a notion page with a list of ideas that we think uh are a little bit more interesting and novel um based on the capabilities that we can offer so feel free to check out this page um also if you want to talk to us talk to the team feel free to join our Discord we're pretty active uh we're happy to provide feedback on your hackathon ideas uh also just you know if you just want to jam on new ideas um and we also have essentially a u Advocate Program also Builders program where you know if you're interested in in building with us on the long term we're also happy to to work with you uh very closely uh so telegram group and then we launch our testnet a few days ago so you can get some testnet tokens and start playing with it today and and yep that's it and uh if you want to find more information about us here are the links uh we also have some demo dabs that you can play play around if you come by our booth we'll also have this you know iPad that has a bunch of mini dabs that you can try around play around um please follow us on Twitter and uh and lastly there is a secret game that we're going to release during um this hackathon it's essentially a two3 guessing game so the idea is everyone gets to guess a number between zero and 100 and the winner is the person that gets the closest to 2/3 of everyone's guesses so this is also to illustrate kind of like the capability of you know what we're building here is is the idea that we can still compute the average of everyone's guess without having to decrypts using FHA uh so yeah we love to have everyone you know come try it out we'll be at the booth um yep thank you

Automatic transcript — names and jargon may be misspelled.