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

Loading player…

Inco Network Workshop - ETHGlobal Brussels 2024

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Remi Gai from Inco for a workshop that helps you learn how to build novel use cases across gaming, DeFi, identity and infrastructure by leveraging our cutting-edge FHE (fully homomorphic encryption) tech to deploy confidential smart contracts. Solidity knowledge is all you need, as our fhEVM (FHE + EVM) streamlines the cryptography complexities. This workshop took place during ETHGlobal Brussels, a 3-day hackathon held in Brussels, Belgium from July 12 to 14, 2024. ETHGlobal Brussels brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ---------------- Follow us: x.com/ethglobal Website: https://ethglobal.com Email us at: hello@ethglobal.com

Transcript

[Music] so we're going to get started so we're Ino what we call the universal confidential Computing Network today all the layer one ler twos have one thing in common is that they're all transparent now we believe that in order to get Mass adoption we actually need a minimum of confidentiality so just a couple examples when you use crypto today as your bank account every one knows exactly how much money you have especially when you use for payroll all the employees within the company also knows how much they're making and this is a known bad practice we have already you know in web 2 second Enterprises and you know institutions are still having a hard time entering this space they have compliance reasons they also have Trade Secrets it just doesn't make sense for them to build on top of a transparent database and lastly there are just a lot of use cases that wouldn't make sense without any hdden information so think of the car games private voting or you know blank auctions a lot of folks today you know focus on solving the throughput problem or the cost problem of blockchains we believe that there's a lot of new use cases that can be unlocked with just confidentiality alone so this is what we call the you know public and private blockchain use cases and to do this we leverage a cryptography called fully homomorphic encryption so maybe by show of hand who has heard of this term or knows what this is okay about half of the people here uh so it's very different from ZK what f does is one thing and one thing really well which is computation on top of encrypted data so imagine if you were to encrypt some integers you can still add divide multiply on top of it without having to decrypt so this is really the magic of FHA for folks who are non-technical in case you're non technical imagine you can encrypt this C picture you can still modify each pixels by adding dividing multiplying and by the time you decrypt now you have a filter right so this is almost sounds like magic it's really a cryptography that allows you to compute on top of hidden data now why is this interesting in the crypto space so you know typical Legacy privacy solutions that we think about you know in crypto is typically ZK uh what makes FH really stand out is the composability aspect so why does composability matter in crypto blockchains are multiplayer systems you know if you want to build defi or gaming you need to be able to interact with each other's private State and so with FH you can sort in data on chain but you can directly compute on top of it so the blockchain itself is the share private layer what happens with ZK is often times you have to store these private data offchain and so if everyone storing their private data offchain there's no composability unless you have a centralized prover that can coord the states so when you apply FH into an evm called fvm it's very straightforward so you have your typical solidity all you have is a encrypted type type called EU so in the first line of code here just an example this is a erc20 you have a mapping of address to EU so you can have a hidden balance and when you do a erc20 transfer what you do is you add a encrypted amount to someone's encrypted balance so it's very straightforward you do a tf. add and tf. sub uh it just reads and writes like solidity and then lastly yeah we also offer onch Randomness that are quite useful for card games uh any hidden information games so what are the some of the benefits so for one it doesn't require any uh Hardware uh secur enclaves tees it doesn't require you to learn any complex languages how to write circuits uh also it doesn't require any centralized op coordination that you know allow the ZK based Solutions require and so let's talk about use cases right like what can you build with this so if we take a step back you know a lot of people think what we do is privacy but privacy is really just a subset of things you can build with confidentiality so let's take gaming for example today all the crypto games are not as challenging because everything is transparent and and you know public so if everyone has perfect information there's no fun a lot of the fun games that we have in web 2 requires some hidden information so think of the car games like poker some of the bluffing games uh things that you have to you know uh guess if the enemy is more powerful or less powerful right all that requires a minimum of confidentiality else there is basically no fun no challenge right um second in the in terms of defi there just a lot of New Primitives that you can think of so you can build know dark poles mind auctions PR amm you can even think of Noel Primitives around like you know under ceriz lending uh just because you can hide C information on the Enterprise uh I mentioned payroll earlier so payroll is a very obvious uh thing you could build you can just hide the amount that you pay your employees in a very simple manner you can also do private cap tables treasury or even predictions right so imagine if we also submit the hidden price of Bitcoin we can still calculate the average price without having to decrypts using F so last year we actually built a fully onchain Mafia game using inco so in this game you could be a doctor killer detective it's a bluffing game and it's very simple you generate the role on chain and so the role here within the struct is just a EU into 8 so very straightforward right so if you're zero you could be the killer if you're one you could be the doctor if you're two you could be the the detective we also bring confidentiality to existing blockchains so this is where you know if you want to build let's say a poker game on base what you could do is you can build the game logic on base where you can raise you can fold you can call just use Ino as a layer to generate and hide the cards so the idea is this we want to meet Builders uh you know halfway like what if you want to build on existing chains that has existing liquidity or user base you don't have to build on Ino this is where you can use ino for specific features another example is imagine if you were to build a some kind of RPG game on ethereum what if you just handle the battle mechanics on in go so you can trigger the battle on ethereum you can have the player stats that are hidden right your attack Power Defense speed all these stats could be hidden to add additional fun and then using the aent randomness you can also use that as a multipliers right right so this is actually just a really good example of how you can ret transform a game by adding layers of complexity that just does not exist today in crypto this is particularly is an interesting um use case that's also quite novel so today when we think of Di they're basically so bound tokens so on the on the on the right side you can see you know typically what you do is you kyc with someone like binance they would you know uh take a look at your identity and then issue you a so ball token that says are you over 18 are you based in Europe uh is your credit score over 700 it's quite inconvenient because this is static like what if this information changes over time also everything is public what if you don't want to reveal everything so this is a comcept that we came up with called dynamic D ID it the idea is what if you can store someone's credit score in encrypted matter directly on chain or someone's age right your age could just be your date of birth converted into time stamp but encrypted so you store this on chain and then you can expose specific functions view functions uh for Cent insights so just quickly the way this looks is very sward what you do with FH is not only operations you can also do comparisons so imagine if you were to do a comparison of the Hidden credit score with 700 what you get in return is encrypted Boolean that you can decrypt and so basically you can reveal insights without revealing the actual information so now back to this right imagine if you have specific information stored on chain just specific queries Right View functions that maybe for Casino dab I just want you to know I'm already 18 I don't want you to know that you know what my credit score is right so it's almost like selective um selective selectively revealing information that that makes sense and so if you think about this this is actually the web two experience that we already have today with Google off if you're using Google off and you connect to let's say an application you can give them access to your calendar maybe your contact but maybe now your Google drive right so this is an interesting I'll say use case as well where over time you could update someone's credit score that can change over time and then the the the Insight can change in a dynamic matter right so just as an example imagine you have let's say uh a money market on polygon and you just want to Wi list users who have a good credit score so what you could do is you could ping this did layer that returns you this specific insights uh and then you can wi list the user so we are compatible with existing ethereum tooling um this is why folks have been having a lot easier time you getting started just use you know solidity metamask hard hard remix things that you're already familiar with we support a fairly wide range of operations today so from additions divisions multiplications but also a lot of comparisons so it's really up to you to you know Unleash Your creativity think about novel experiences and DS that you can build so maybe for a private amm you need to you know use some multiplication divisions maybe for the did layer you need to do comparisons right so because of this range of supports you can re recreate a l the Logics that you have in games and Defi and just to take a pause basically if you think about what we do here is recreating the concept of almost like this private states that we have in web 2 in web 2 if you were to build something like eBay you have a centralized server everyone submits their bid the server is not going to reveal everyone's bid right because everyone has to bid in secretly now in crypto because everything transparent you can't have that experience so the only way to protect information is through encryption so there's no private state in blockchain it's basically encrypted State now with FH because you can compute on top of these encrypted States you get to build more complex logic that basically you normally do in web 2 with this you know Central server idea right uh so a lot of the things that you see here is basically uh interesting in a way that you know you can bring in a lot of web two experiences and use cases to web 3 using these operations so to get started all you have to do is import uh this Library uh so it's a FH Library uh if you are familiar with remix uh the simplest way to get started is to use inos remix uh pretty straightforward our current version does have a little bit uh of a uh version issue so you have to use 0.820 for now uh but yeah one more thing here is when you build using confidential information one thing you have to understand that there's no if El statements the reason why is imagine if you were to execute IFL statements on some kind of logic that path would actually reveal what the hdden information was right so the way to go around this is this multiplexor function called CX so here's just a very simple example of a priv voting when you cast a encrypted Choice which could be 0 or one the first thing you do is you compare if this encrypted choice isal equal to one so you get a Eble which is encrypted ban what you do is you pass in this encrypted Choice into a seox which is a multiplexor so if you're familiar with things like JavaScript a caox is basically like a Turner function it Returns the first argument if it's true second argument if it's false so in this case if the choice was equal to one you would return the encrypted vote count if it's false it will encrypt return zero but zero is also encrypted now on this third line it's reverse you return zero if it's true and then in the Von if it's false so one of these two arguments would be zero and then the other one would be the actual V count and you you add both of them to their respective tally so this is how you can go around this know if else problem uh in encrypted values is using uh CX essentially there are two forms of decryptions so this is quite important uh so the first decryption tf. decrypt would decrypt and reveal the plain text to the entire network so this only makes sense if you want to re reveal something and and not be afraid that this information would cause you know consequences so for example in a poker game at the end of the round when you want want to reveal everyone's hand you want to use TFG decrypt right now the second function is a reencrypt so what is a reencrypt reencrypt allows you to query your own let's say your own balance in a way that doesn't leak information so the way this works in practice is on your client side you generate a temporary private key that goes with a temporary public key and then when you pass into the view function you pass in this public key so that when the NPC networ decrypts you will do partial decryption and reencrypt that value using your public key and so all these values will be sent back to your browser and using that temporary private key when you decrypt you can reconstruct the pl text so this is a way so that only you can see the hid information and and not not anyone else right so this is good for let's say in poker if you want to look at your hands without revealing to everyone else or let's say for erc20 balance you just want to view your balance uh this is also a a great way to use this function uh one more thing as you can see there's a signature a signature here is just EIP 712 it's just to prove that you are you uh so not someone else is trying to Def your balance basically so let's go over some of the tooling here so there is a tooling called fmjs so what you see here uh this is called a cyhex a cipher Tex is the way you hide data in fhe it's composed of the actual data with some noise uh some noise padding and some data padding so let's say you want to transfer 10 tokens right in a confidential manner what you do is you encrypt the integer 10 using this library and then when you pass in to the solidity contract you pass in as a you know call data uh in the form of dtes you have to cast this into a eu8 so if you see below here with the hidden score example so you have to pass in as a as a you know byes data and then cast that into a E8 uh type and so today we support uh un 8 1632 and ebble and we'll support 64 and 128 uh very shortly including e address so yeah so let's talk about the bounties so we have 10K in bounties there are two tracks one is gaming the other one is open Innovation so we've hosted um about four high clones already and I'll say gaming has been one of the more popular track for most people because for one it's easier to build if you can think of some kind of you know mini games Hidden logic you can easily recreate this within 24 hours it's also you know typically you know more more fun to to build defi there definitely a lot of interesting things you could build it's a little bit harder just to give you an example if you build something like a private amm some of the concepts you might have to think about is around differential privacy so let me give you an example imagine you want to do a confidential swap if someone swaps before you and then you swap and that person swaps right after you technically that person can guess how much you have SED out right but there are ways you could uh you there are techniques you could do to basically uh prevent information leakage including know uh differential privacy but typically these topics are a little bit more complex but nonetheless I think there are quite a bit of interesting things you can also explore and then in terms of infro you can also think of that did layer example that I gave earlier uh you can combine that with the M Market so imagine you have a Mod market that only lands out if you if you have a good credit score right so this is where there are rooms for sort of Novel Primitives ways that you can think about composing def different def5 Primitives including gaming and then we also have a list of ideas here on this notion page so yeah if you are short of ideas feel free to check out this page uh we also have a booth there uh with all our team members so we're always happy to provide feedback come talk to us we're very passionate about you know exploring ideas you can also join our Discord so we have a Dev chat here for any know technical support and telegram group so we do have a test night so yeah feel free to get some test tokens and then get started um yeah just leave it for a second for people take pictures and then lastly yes we have our documentation here there is a arcade page uh with a few demos so some of them include you know simple mini games like the mafia game uh Wordle uh simple hangman slot machine so just to for people to try out the novel experiences that inco can offer and that's it thank you [Music]

Automatic transcript — names and jargon may be misspelled.