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

Loading player…

Privacy Preserving Smart Contracts on Ethereum with Enigma by Victor Grau Serrat of Enigma

ETHGlobalFri, Oct 9, 2020, 12:00 AM

Victor Grau Serrat, Director of Enigma, gives a talk at ETHBoston about Enigma. ETHBoston was an ethereum focused hackathon that took place Sep. 6-8, 2019 at Northwest Building, Harvard Campus. ETHBoston was a hackathon organized by ETHGlobal and a team of hackers, developers and enthusiasts interested in building and creating in the ethereum ecosystem. The ethereum focused hackathon took place for 3 days at Northwest Building, Harvard Campus in Cambridge, MA. For more information visit eth.boston and ethglobal.co

Transcript

morning everyone love to see this I'm excited you're here with me I wouldn't quickly get it short ends for anyone people are saying how many people have you hadn't heard about it England before coming to the hackathon or anything about Boston so the this talk is really packed but I don't expect that you're gonna follow along 100% but rather I want to give you an overall sense of what it might be what it would look like I'll be showing this my so I'm more interested in in keeping up with with so research shows that people can we get at most three ideas from any given time so I'm gonna focus on finding a hammer three ideas the first one being if you think about enigma think about the privacy there for eating and so let's talk a little bit about the problem of privacy data and the power life on the other blockchain is public by default I mean that's the whole thing more promise about the public ledger and being valuable and worth money but these great limits potential application think about think about all the services that you interact with other human filter that we use in your regular life and the fact that information you don't want to put in public watching and problems health records the final information your enjoyment history your salary your friends contractor yeah I got two more many things like playing games a strategy game and the moment that you will build your strategy so you can think about privacy in very important terms but also so enigma soft precisely that problem where we need more decentralized applications to compute over encrypted data and if you think about enigma as a layer 2 solution where in English the computation layer and we use idiom as the source of which allows for or basically in focus you can upload all the computations but these are the network I just use the idiom for or for coming to a consensus so is the company enables where [Music] and most relevant to this topic this event is one way of understanding anybody needs to talk from between the view of different stakeholders involved so my opinion we have developers who develop and deploy these items or we have users we have and we have workers - who execute those tasks workers being analogy to the note material we try to reuse somewhat of a different nomenclature or raining or economy so as not to get confused because we are going from one network to the other all the time so let's quickly go over that the flow of how any mowers so developers write secret contracts composite Python and then deploy those contracts to the Enigma network and those partners can also register on that's our source of food so you have to have a record of those contracts of them so then users interact with be staffed by spirit included dana is create tasks a high of that of that task again is recorded material and the tax be sent to the enigma level workers receive tasks based on us on a stake weighted modeling so the more you take the more chances you are you'll be chosen for a given task selected worker execute attacks and the simulator resource back to the network and there's an option here for women as a weaker result of that task you can call something on the team and activity and also the internal variability within theme which whipping its component answer so I'm having an idea privacy anything you think about Amy so now I'm getting into the hackathon mode where it's like okay you have some ideas you wanna you need some privacy in your application and the beautiful thing is that we are not asking you to rewrite all your application or an enigma it's it's almost the opposite you have your time if you have use my conside but wait there's that one function there's one thing where I need to have know some sensitive data that's what you call anything my customer so everything else works what is going to you but then you can upload the sensitive information to anyone so the blue boxes are the elements that gives a hacker it's time to think oh okay I want to use enigma what do I need what do I have to use encrypt it inputs so whatever you send into the network it's going to be encrypted and we have a lot about this we have an enigma we have a JavaScript library like websley etherium that basically handles all those things to you you basically say send us I deserve the parameters we have the encryption so encrypted inputs there's an encrypted estate that can be maintained on the network and no one may have access no one can read and there's an acute abdomen as a result and then there's anything you covered as I mentioned how it so fairly straightforward inputs outputs and the same again I'll be back and forth between these two spies so let's think about what can we build on anyway and this is more of a brainstorming ideas or night at this point your head should start spinning oh yeah I was missing this component no more work and I do so type of things that you can build on any map games that require you to hide actions and Atheneum say rock paper scissors it is impossible to play rock paper scissors are linear on an ethereal because you know I commit suicide as I go I know what hit you with a rock then where's the fun but now imagine that I I play my I'm a my my game i sending my ribbon scissors to the net where you send you and written whatever it to the network and then the network like the increased the place i since bacteria or say many palaces i will all play genetics with ships on the madness v18 3c4 hey miss just the data matrix of where your ships are is mistake i'm the befores and see series and we want are the inputs that similar hangman where your actual word is the mistake and you send the letters and you can tell whether or not it's got your hand reticular patients say I tell you go across the street on this path and when you are at the bar turn around and you see something and then is who I saw a mural so send more alacrity to the network and then you say okay now then you decrypt the next phase which is go across this way into the store second I'll what would be you see that that was it and secret messaging I think these are way too many where you send a payment to the network we Whiteley's your message sender address and then get some information that is stored in the encrypted state if message sender is white listed then we send you the content otherwise even have access okay we have another environment much like travel and I'll gonna try to keep one with this analogy all the time because really we've got we will travel the holder on the source code and then we inserted a bunch of things to run to compile and migrate secret contracts in parallel to compile it and migrating smart contract so if you ever use travel to compile my grave and test my contracts there will basically do the same wave secret contracts and in many slides there will be this thing where if you you might be able to follow along I think this is too fast we did this presentation so if you don't know that that p.m. you can go to the folder and you may beat up the network just by running discovery start and this this runs a colorized network and you know photos where you have an instance of simulators and then you have towards me knows that form the Enigma network whatever yeah yeah yeah so this is a sample I'll put out followed by a each component prints and output and help you figure out works for you so is most important debugging on so what we want to do today is related to things like two easy steps to interact with a it's not and here is I guess the bad news for you is that no I know it's it there's no way around it and of course you want to think that we peaked our language for writing secret contracts not because it was easy in like easy to use in a hackathon but boy it was a robust language that is memory said that has good performance but essentially we preserve the privacy that we assure that the network will will give so I am I thought about this talk is like okay I know you know in the new and then we have probably the millionaire problem some of you might be familiar with it but it's really simple Alex and popular millionaires and they are said which was returned as well as not disclosing their network the network so they want to compare their wealth if neither of one is losing to the other what is their work so it works something like this I create a new millionaires problem I have an instance of the millionaires problem I a demeanor say four million dollars I had a second millionaire Alex two million dollars and then I could get the reaches and the result should be okay so basically there are there's one single culture there are two functions at millionaire and compute either there are two inputs whatever as if you as a father again this is my this my hack number one this is our additional because it is one of our equals examples wasn't contracts there's a bunch of contracts that we have written in rust that we have is being done a good job of inline documenting so I embed that in in and then that's one that is really simple but basically five or six contracts with this we place it pretty much do whatever is possible in civil contract so you can just go there and copy paste copy there so I'm gonna go here and here and this is this file and I'm just going to go break it down by one my line and this final has about so this is just one example secret contract has 80 lines of code half of them are comments so we're down to 40 I claim that you only need to write that of dollars for EULA so an you might have nineteen an hour I think so quickly just look at your sense of what Trust is like and it's very similar to see and some Java or type it so these type of things is like copy paste if you don't wanna understand what they do I don't get it this is this copy but it's all this policy the quadrants have this are they carefully set up so rust has a lot of standard libraries that the execution engine does not support execution engine think about geography incredible machine there's a lot of things that you cannot do in the real machine so you cannot do in the Enigma machine and so all this time cross-functionally has not about so we we how the standard society then we bring two packages into scope one and two and this one is the one that allows us to interact with enigma runtime which allows us to write and read from the state and print for debugging purposes so basically we imported and we want to use everything that's in this fact then there's is on the package which allows us to define the functions that we can come from the contract and write the Phaedo comments find our album input into the contract of all these parts for free you just copy then the gimmick mistake this is a half cup and I need a key to access the hash marks of Texas stream that is called millionaires okay okay now stop here from one this is what I defined my data structure for the big mistake so it's a structure and I have feels adverse and network where the first one holds like 30 [Music] there's and then how do I come up with these numbers here at the end there's the relationship between Versailles and the Swedish guys and then these are the totally functions that I wanna define to interact with my contract remembering the scheme I said there are essentially two functions Adam a dinner and then compute richest and you know and like many programming languages is the pioneering force this has no why I put this one has no inputs and outputs the identifier of vision so then I I define my my contract and I can have private functions and public functions so this is a example of I wonder we've drawn this thing so I want to get me I'm going to be from the state with Mike I used to get to to access the hashmap and then I knew this will get me a vector of no structures or the active inspector again it would say well then then the actual language is a little bit weird is like yeah fine but you have a lot of examples on how and then these are the public functions for the contract with an engineer so I I witnessed I read all the million us that I have already in in this state and if it's the first one I'll get an empty vector and so I push the inputs that I got and I write to the state so this is this is the core like this is the power of your contract I want to add these are like to fire and then go get richest so I this is basically one line where I want to get a match and this is like typical rice stuff where I wanna get a match or yeah ketamine you notice the function we saw before I'm gonna iterate through all the results how we find the maximum by E which is network of the vector that I get up and either I'll get an entry matter if I try to follow this too soon or I'll get basically a result and from the result of get dispute is without the time like more or it's anything like sort of compression but again talk to us we know some rest we can help you with this critical rapid whale program who I don't know was it so first idea of privacy layer in the theory of an enigma second idea secret contracts are written in verse and there's no way around it because it's a very good choice of the language for many other reasons so now I have this secret contract that I've written and is what am i doing it much like profile as one discovery profile so basically that will turn that secret code written in rust into webassembly which is similar to the fine code that runs on so I'll get I'll end up with a file somewhere of my right and then much like you do for my great with no discovery my way and that basically we have this and we are using the top of migration files to my grave the anymore contracts and you already need to know is the point secret cover and you pass the file name this is the constructor the amount of gas that I want to use to the further contract from account one desire to the garage and I want to I want to keep that in the interest of finishing entire English patrol with the other speakers but maybe we have an English a JavaScript library in much like one city library where you have this functions in your disposal or find the space of so I just want to finish by oh so three eight years is an idea being that we have a developer environment that we thing is very user friendly a good way to get users to store it we have so now if you have questions I want to give you resources so if you want to get started setting up the network with the urban environment installing it whatever come and talk to me if you want your and your pasta and you start thinking about writing a contracts in class so I talked to a friend is one of our core developers and a lot of our us more than I do if you are thinking about potential use cases or places in your application where you need some privacy no one talk to who ain't Lee and John who sense they're prevent job is think about use cases so for every use case that you can think now cannot relate to five or ten more I think about I'll tell you about five or ten other people who are developing or thought of or working on similarities cases and it all tasted like the others overwhelming dislike unhide Enigma now but this time school are not gonna do anything on this one going to have to tour and Aaron and ways of getting involved into the Enigma community I can think of a little handful ways whether it's studying approaching in support being members of the Enigma collective and becoming ambassadors of enigma of the world per ticket into the documentation or phoning or developing use cases for enigma is a bunch of ways you can get in [Applause]

Automatic transcript — names and jargon may be misspelled.