🎤 Automating web3
ETHGlobal·Sun, Oct 9, 2022, 12:00 AM
Join David Sneider, Chris Cassano for a talk title "Automating web3", part of the HackFS 2022 Summit. HackFS is a three-week long virtual hackathon focused on building a digital world that is censorship-resistant, decentralized, and trustless. For HackFS, ETHGlobal has partnered with Protocol Labs - the organization building Filecoin and IPFS - to run an event centered on dapps, web3, decentralized storage, and everything in between. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
[Applause] [Music] all right we're going to jump into our next talk here uh which is going to be a talk by uh david and chris from lib protocol they'll be talking about uh automating web three uh all the different kind of interesting primitives new things you can do when uh automation's built in um this is uh this is a huge problem space uh that is is particularly difficult in in web3 although kind of very common in what too i'm still really excited to hear a little bit more about uh what they're working on and then just kind of exploring the space with them so i invite both david and chris to turn on their videos um and welcome them to the stage feel free to share your screen hey jacob hey everybody uh thanks for being here um i'm david that's chris we're the founders of lit protocol and yeah let's go ahead and jump into it i'll start with the screen share here all righty then so before we talk about specifically automating web3 let's do just a few minutes of context setting um so first things first what is the web so on the web we have this kind of like decentralized and resilient packet transfer network for sending around information and here's a little video of that uh evolving over the past several decades and so you know this is decentralized in the same way that one of these nodes can drop out and the information can still reach its destination and so as you can see in any kind of system there's three main components which is the sending of the information and we see a check mark here because the sending is in fact decentralized but what we're going to talk about a little bit today is the decentralized compute and the decentralized storage of information and a lot of that was just touched on in the last talk and so now that we kind of have an overview of what is the web generally let's talk about what is web 2 and so using this same lens of sending information computing information and storing information we can define web 2 as the internet where the data is computed and stored by these centralized platform corporations so what does that mean specifically well of course it starts with the individual and in this web 2 construct the individual has a bunch of data collected about them from pixels essentially tracking codes and and tracking cookies across the web to the gps data in the phone that is being aggregated and of course uh all of the spending and financial data and so the result of all of this data being sent and traded and bought and exchanged by these third-party corporations and here's kind of like a map of what that ecosystem looks like these are the top five thousand uh marketing technology companies is that for each of us the individuals who are using the internet there is this picture of our identity that is the wholly owned property of these third-party corporations collectively and this is uh kind of a result of the fact that the compute and storage of the data to date prior to web 3 was only really happening in a centralized way so now let's talk about defining web3 using this same frame we can define web3 as the web where the data is computed and stored by decentralized networks and again it starts with the individual but then the other major component of course inside of web3 is the notion of the asymmetric key pair the public private key pair the private address and and and the public address and so this is the component that lets individuals and corporations and dows etc interact with these decentralized systems with higher levels of sovereignty because the key pair itself delivers the power of being able to sign messages sign transactions encrypt things decrypt things this is a huge huge huge kind of innovation in terms of how people interact in our digitally mediated society and so some of these networks you'll obviously be familiar with them include things like blockchains which are these uh public state machines uh uh that are ledgers showing who has what tokens um storage networks like ipfs and filecoin and then what the team at lit is working on which is compute and encryption and so we'll take a couple minutes to talk a little bit about lit how it works and how to get started with it and then have some time for questions at the end so in context of of this framing what is lit lit is a decentralized key management network at the end of the day so structurally and architecturally what lit is doing is custodying a private key an elliptic curve in a decentralized way so the private key that you have in your wallet is essentially just the line on a graph and the lit nodes represent points along this curve which is the secret of that individual node and so the first product that we brought to market using this underlying network is a decentralized access control and encryption service and with this service an individual can get access to some resource whether that's a video an application a chat a feed somebody's friends list based on some on-chain data so a user may say uh i own this nft and i want access to this locked video they sign a message which is broadcast to the lit nodes the nodes then check the chain does this person qualify for access if so that node uses its underlying secret which is that point along the curve to generate an authorization or a decryption share which it sends down to the user and the user aggregates those shares in kind of a client-side encryption excuse me like a client-side consensus type of view and once they've collected two-thirds of those authorizations or of those shares to perform that operation which is to access something or decrypt something in this example they're able to do so they're able to watch that video access that chat so on and so forth and so this has been really excellent there's about 200 apps of all kinds of uh types that have implemented decentralized access control and encryption with lit today some of those examples include being able to do token gated commerce inside of shopify uh decentralized encrypted chats on this application called orvis.club is just one example and then what the whole team including chris and i are really excited to introduce here today um is the notion of programmable key pairs uh uh and the ability to do decentralized compute and signing and so what this means from the perspective of the network is for the access control and encryption product lit was just one key that was checking those credentials and provisioning access but now we're imagining a future with our community whereby every agent who is using the web in addition to having their hardware wallet in addition to having their mobile wallet or their browser wallet can also have a decentralized custody cloud wallet which has some extremely unique advantages around being able to run automations because the signing can happen in the cloud and can be controlled by rules and programs rather than getting an alert about something and having the user have to open their phone and sign the signing can happen on the user's behalf inside of this pkp paradigm so with that i'll kick it over to chris who will talk a little bit about installation and chris you just let me know when to go to the next slide wonderful yeah so um in order to use these pkps um generally you'll you'll want to use some javascript and that's we're calling that a lit action um and so what you see on this slide here uh first is like how to install the sdk um in a way that supports using lit actions so you have to use that um at serano tag at the top there that that you'll see and then once you have the sdk installed you need to write some code that will run on every node and that's what uh what you're looking at here in this little code snippet this is the piece of code that um each node will run and it as you can see in here we have a um sine ecdsa function call that will instruct the node to use its private key share to create a signature share and what happens um is the nodes all run this little code snippet in parallel and the user collects those signature shares and then combines them and is able to use them for anything you could use an ecdsa signature for so you can use it to authorize a ceramic right you can use it to send a transaction on any ecdsa blockchain including bitcoin um and and that's like uh that's that's how the lit action code itself works um and then can you go to the next slide and then yeah this this uh snippet of code here is the code that um actually uses the sdk to uh to tell the nodes to run that code snippet from the previous slide um and you can imagine in in this code snippet um if you look down a little bit you'll see um there's a line that says cons signatures equals await lit node client.execute.js and you'll see there's a parameter there code and it it says lit action code yeah right there yeah that um that is basically that's the code that you defined on the last um on on the last slide um and so that would that could be like a string and you pass that to each of the nodes and they run it um and what what you get back is the signatures that that were created the the lit javascript sdk takes care of like combining all the signature shares for you um so that you just get the the raw signatures back that you can you know broadcast to the network or um do whatever you want and one more thing that uh well actually two more things i'll mention one is like um in this example we're passing the code in as a string that's what that that code parameter is where dave's mouse is um it's also possible to pass in an ipfs content id and what what that will do is um instruct the nodes to pull down that ipfs file and um and execute it as javascript um and where that's really interesting is that um ipfs uh things sorry ipfs things are um immutable and um so where that's really interesting is that you end up with an immutable piece of code um that you can uh you can use for signing um and what what you can do now is um you can use smart contracts but we're we're still we're still pushing some of these features up so you can't do it like today but soon you can um use smart contracts to grant access to a given lit action to use one of these pkps um and so what you end up with is like an immutable piece of javascript code that has a private key that it can use to sign that's stored and runs in a decentralized manner and so anything that you can think of that you could use a decentralized signing mechanism for you could use this for so you could you know in terms of automation right you could um so we we don't have a listener that's something that that you would need to figure out you could use tenderly for that for example but um you you need some kind of event listener right and when an event happens um you would kick off you'd run this code that you see on the screen to kick off um a signature and what's what's really cool is that you can put because it's running your code you can put constraints and conditions in that code right so like if you if you want to say like oh when the price of ohm you know drops below a certain level i want to unstake my own and sell it you can um have an event listener that looks for the price of home dropping and fires this off but you also can have inside the code here like an if statement that double checks the price um and so it so the actual event firing can be done by an untrusted party because you can put those guard rails um into your lit action code um and uh yeah definitely uh oh yeah next slide um definitely we have developer docs on all this at the developer.lit protocol dot com website and come on into our discord and we will you know help you with any questions or any support at all back to dave thanks chris and so yeah i think uh a couple kind of ideas in the context of what to build on this especially through the lens of of hacking file systems there's obviously some of the examples that chris mentioned around d5 automation and quality of life tooling around uh finances but focusing specifically on on file systems and off chain data something that gets really interesting here is you know it's long been the dream of early internet pioneers for individuals to be able to travel around the web sometimes people use the metaphor of a data backpack with a self-sovereign data hub and what is so kind of wonderful is in the past in order to have self-sovereign data an individual would have to go and rent a server from a provider like digitalocean or amazon and install some software on that in order to interact with the web in a sovereign way but now with the rise of decentralized storage networks and the fact that it is the private key that lets an individual interact and read and write to those storage networks one can have a a sovereign internet experience without having to go rent a server by reading and writing uh to their own encrypted shard of the open web whether that's on uh using a service like ceramic file coin or table land as the protocol for for where that data is stored and so some like examples of applications that start to get really interesting are things like what is social networking look like in this context rather than writing your posts and your friends list to facebook or twitter's database what does it look like to start writing that data to a user's own hub where their own information is and then having rules around who can see it who can comment on it who can like it so on and so forth and so this is really the vision of the user-owned internet and user-owned social networking starts to emerge out of this frame and then we'll open it up for questions but just to end on an interesting idea here that we like to talk about often over at lit is really thinking about what is privacy um there's definitely kind of a cultural idea that privacy is about building up walls and saying what's mine is mine and in the context of a networked digitally mediated world we really like the idea of thinking about privacy less about building walls but it's more about building bridges the point of privacy is not to necessarily keep uh any information away from everybody else but is to give each individual each application each company each dow really explicit controls around who can see which of their data and when so we really like this kind of consent view of privacy um and just wanted to share that concept and so open up for questions here in a second but yeah thanks for your attention um here's our various kind of handles on twitter and yeah i would love to take any questions and uh looking forward to interacting with some of you in in discord and talking about the prizes and all that thanks so much awesome thanks david and chris i appreciate you going over that with us and i mean super exciting to have this like kind of new primitive coming to coming to be um i think we're still waiting to see if there's gonna be any questions to filter in but maybe i'll just kick one off on my side like um i i think you're totally right that this is sort of you know part of this vision that a lot of these kind of early internet pioneers had around just you know being able to teleport around the internet and kind of bring everything with you um i i guess like i get curious about the genesis story i guess of like coming up with with this as a future and like was this always the plan like did you start with kind of the keys and then you sort of realized oh like that would be crazy we could do this like um like how has you sort of got to gotten to this point and uh i mean it's exciting to be out so i'm just kind of curious like what that journey was like yeah great question um so uh so like the the so chris and i have been on this we're on like a three year journey trying to come up with uh a really impactful idea and iterated through a number of different things and about two years ago we kind of got obsessed with the idea around how can we make an nft an unlockable portal to an experience trying to like think about nft's lessons kind of picture frames and more as browser windows that somebody could enter and thinking about what it would take for only allowing the owner of that nft to be able to enter that digital experience and so the question that emerged out of that was where does the key live and basically the insight there was oh let's use a decentralized network to custody a key and just in the context of building it i think you know something that we talk about a lot on our team that um innovation and inspiration typically happens during the work rather than before um it was just very clear that the uses of a distributed key um we're well beyond uh the things that we could conceptualize and you know even if you think about like the founding of ethereum and vitalik's journey of saying oh people really like making coins and they keep setting up these forks of bitcoin what does it look like to make a network that somebody can create tokens on top of um you know led by chris we really went down a similar path in terms of thinking okay this is this notion of a decentralized and distributed programmable key is very very powerful we don't know all of the use cases for this there the opportunity here is to uh basically take care of some of that work that would need to be repeated for each one of these use cases and make this kind of a generalizable compute or application platform gotcha very cool um awesome looks like there are some questions coming in now um i guess some specific questions some kind of more open-ended ones um i i guess was this technology would this enable anonymous threshold voting as part of like would that be one of the things that you could build with this or is it missing anything from that i think you could build something like that yeah um yeah it's i'm trying to think about the specific architecture of that and how that that would fit in but um yeah because you can you can do things like um like signing and you yeah i'm looking at the anonymousness of it um so all of our um stuff right now all the the nodes run their uh their execution inside of intel sgx which is a trusted execution environment which is opaque to the um to the node operators they can't see into it um so depending on like what data you're writing to chain um i think you could uh you could do something like that with it yeah gotcha okay sweet and then maybe maybe like a little bit more of like a general or more philosophical question like um given that you now have this kind of concept of like key and then you have this concept of like compute like is it actually possible to sort of create a dap at this point that would be like completely computed on like the lit protocol like ecosystem um and like maybe not even need the kind of i guess you still have the blockchain component but like kind of almost like like a kind of compute roll-up type situation totally yeah we've been like calling these like liquid programs and are excited about the future where somebody can build a software product that provides a service generates revenue and is running on entirely decentralized architecture and let's say somebody builds that up and it's making a hundred thousand dollars equivalent a month in tokens and they decide you know what i'm ready to sell this business and rather than having to go through the work of like paperwork and and everything uh and finding a buyer they can just list that con the nft that controls that software on openc or one of the other marketplaces and somebody can literally buy what is functionally a software product business and the exchange of ownership of that business can happen um on chain wow yeah okay that's an interesting idea sorry i don't want to cut you off keep going chris no no yeah yeah yeah i just want to add really quick like the the idea of like replacing a back end with some of the stuff that lit does um i'd love to just talk about that really quick right so a typical node.
js backend right will sort of have god mode access to a database it can read and write from the database whatever it wants but the actual code you know in those endpoints are what govern what gets rid of the database right if the there's an endpoint for a like post function that endpoint will check if the user has liked it already it'll off the user then it'll just write that one piece of content um to the the database and what you can do actually today with lit actions um is you can have one of these uh lit actions that owns a pkp you can have that that pkp own a ceramic stream and so what you end up with is a very similar paradigm right where you have some javascript code that has god mode um on a ceramic stream and then you can write the code that governs like what actually gets read and written to that stream um and that code can be immutable um and you it's it's a very like uh easy transition i think from thinking about the the web 2 node.js backend mindset to this um way to do it in a decentralized way where the you know the data actually lives on the d web and yeah you don't have to stand up a database you're using ceramic yeah that makes sense i mean in a way like it almost feels like but it almost does kind of feel like almost a serverless function type idea as well where it's sort of like yeah you're sort of you know outsourcing some compute out to this thing and like you know it'll get back to you at some point and like maybe there's some kind of characteristics about it that you need to pay attention to but like beyond that like i mean that's like i mean you serve this function yes but then i think even in the case of david what you said like a serverless company which is like kind of interesting yeah i think that's a perfect example right it's basically a serverless function um and like if you go use you know aws lambda today you can hook it up to the aws kms but the service provider that says like hey we built some kind of defy automation using uh amazon's serverless function product the person who's building that application has total access to that kms and can you know rug the users at any point but in this paradigm that we're talking about you can do that same thing it's the same mindset except the key is custodied by this decentralized network and somebody can build a really wonderful service and then say to the users look i can't rug you uh this is built on this decentralized key management and infrastructure even rug just from the key point of view but even just like the compute point of view too right like i mean aws can at any point just turn off the function and you're kind of out of luck right um so wow very cool um awesome just see if there's any last questions that sneak in um cool does i think we're kind of drying up on the question side maybe just before i while i still have you both and and before you go i know you touched on it a little bit at the end but um obviously we've been kicking off a two and a half week hackathon like what are some of the cool things that uh that you want to see built with this like what are like some of those like kind of option those awesome like outcomes that uh that you'd like to see explored chris you want to go first yeah um anything that like uses ceramic like in the way that i described it i think it'd be really cool um also you can make http requests inside these javascript snippets so you can read and write for like you could build a bridge um you know between file systems between you know between chains um i don't know it's like there's just so many possibilities it's hard for me to come up with concrete ones and you got some dave yeah i mean i think like basically you know three comes after two web three comes after web two like we're we're back down to the fundamentals so it's things like messaging posts friends lists profiles like i you know we can there's always interesting game dynamics to explore but it's really just some of the basics of what does the user-owned internet look like like you know if you think about the start of facebook it basically started as the notion of essentially a profile page right where you could upload your pictures et cetera and things like the feed and these other kind of interactions came later on um so i think that's like the state of where things are at it's just like it's wide open and early and being able to tackle some of just the super obvious components that exist in web 2 today whereby all the data is stored on these these third-party servers in the lens of of what we've been talking about whereby that is controlled by the user you know through this pkp paradigm that is like controlling a ceramic stream for example is really interesting the other place where this gets really interesting is on the authorization side so for many people um it's a real privilege to be one's own bank uh and a real honor to be able to custody a 12-word seed phrase but there's a lot of kind of fellow members of our species where that's a real burden right they may not have a secure place to store these words um that they like they're receiving these words in a language that is foreign to them and so there's a lot of opportunity on the authorization side which is how can an individual tell that cloud key how to behave using kind of more um let's call the more traditional authorization methods like biometrics multi-factor authentication things of google authenticator so there's that whole world to explore on the off side as well um and all of this stuff is just like super extendable to then every other application that is building inside of this same user-owned paradigm wow amazing i mean out of all that like i mean the auth stuff is very interesting but then also like just being able to make an http call from within it like getting data within that context and being able to do cool things with it yeah maybe you won't have the same guarantees as like you would if you're using like an oracle provider or something and yeah i mean it's a point of failure but i mean to one's point earlier at the end of his talk like at the beginning it's all about just solving a problem right and like if you could solve that problem then like sure you have like a centralized data source within this kind of liquid um thing that you're building like cool like later on take that out swap that for something more resistant and solve that problem later so it's awesome seems like a really cool tool to uh yeah i don't know it seems like a very open open-ended thing that people can build with so really awesome yeah and we couldn't be more excited to have those dialogues like please get in touch if you want to ideate and chat about stuff um you know it's always more fun together awesome okay great uh well that is time on our end for this talk but i really appreciate you about david and karis for coming out and chatting more uh about kind of automating web3 and the work that you've been doing there we're going to move on to our next chat
Automatic transcript — names and jargon may be misspelled.