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

Loading player…

Filecoin 🛠️ Scalling Programmable Storage

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join us for a Filecoin workshop! From November 17-19 2023, ETHGlobal welcomed developers from around the globe to take part in shaping the future of Ethereum at ETHGlobal Istanbul. Over $600,000 USD in prizes were given away at the prestige Istanbul Congress Center... thanks for an amazing weekend hackers! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] I'm going to be talking about fpm the filecoin virtual machine an IPC interplanetary consensus and a quick demo of a data Dow just to give you an example of what you can build uh on top of some of these Technologies so quick recap uh the filecoin master plan build the world's largest decentralized storage Network that we have managed to do and continuing to do uh the network is about something like between 10 12 exabytes of size uh onboarding and safeguarding Humanities data that is what we're working on at the moment uh onboarding data at a rate of about 40% increase per month um they're about I think it's about one exobyte of data they've got stored on the network at the moment and then the third part is bringing compute uh to the data and enable web scale apps and like I said I'm going to be talking about data DS Ali's going to be talking about lilypad and compute um sort of offchain onchain uh Bridges so one of the ways you could think about this is ipfs if you've used ipfs you can kind of think of ipfs as kind of before the blockchain so below that dotted line uh ipfs is a decentralized way of storing data many of you may have used it especially if you're using anything like nfts uh that is kind of sort of pre- blockchain uh kind of level and then we have filecoin it sort of layer zero as a storage layer and then if you think about conceptually uh compute and comput over State rather with FM is kind of being layer one and then Layer Two being kind of performance and scalability on top of that I'm not talking layers as in kind of layers specifically of a blockchain but sort of more on a conceptual uh level there so this is kind of like the evolution of the storage system from uh ipfs in which you have to sort of manually pin data uh potentially pay a pinning service or run your own nodes in which to pin the data up through uh various layers of evolution of that storage uh going on FM the fileo virtual machine uh delivers onchain programmability I'm here my colleagues Sarah and longay wave uh also here and Nikki as well um Sarah longf also with me on the developer experience team uh we will be at the filecoin booth so further questions you can come and find us talking about FM stuff there uh it is ethereum compatible so you can deploy um uh solidity smart contracts directly on top of filecoin that's going to show I'm going to show that in a little bit it's uh designed I'm going through this fairly quickly so I can get to the demo um and we're a little behind on time so the virtual machine allows uh like I said the execution of smart contracts on top uh it actually enables various different run times we're going to concern ourselves mainly with the ethereum runtime on top of there because that's the first one we've built couple resources here this QR code will take you to uh some information about using uh one of our partners Lighthouse that is a storage aggregator and that is in short because Falin is designed to store large amounts of data if you have small amounts of data um the storage providers are not interested in that they want large amounts of data so there's a number of storage aggregators that will take smaller piece of data bundle them up and then pass them on to the storage providers so it's likely you're going to be using some of like Lighthouse or web3 storage uh nft storage as part of your um uh submission if you're doing stuff with filecoin interplanetary consensus IPC that I mentioned this is uh the notion of okay how do we unlock uh truly Planet scale performance for web 3 so it's it's horizontal scalability for filecoin and ethereum as well it's actually uh chain agnostic but we're sort of focusing on filecoin initially and it allows you to create subnets off of the main Network that use a different consensus protocol but then submit up to the main chain for uh final uh validation there so you inherit the security of the main chain but you have a much faster consensus process so uh filecoin is proof of space time IPC is uh bft based and has a much faster block time so couple of seconds per block rather than 30 seconds per block on fvm it's also hierarchical you can actually create multiple networks off of each other so you could have a layer two a layer three a layer four all chained off of each other as well so this allows you to create these kind of hierarchies and they might be represented you might have a subnet specifically for say gaming you know a specific use case you might have a subnet based around a geographic region so if you need people within a particular region to have higher speed access as the block time gets down obviously it starts to get more and more important the actual latency within the network is kept low so IPC allows you to have these Regional subchains or custom subchains even private subchains as well um with that and it's you know very customizable as well that's one of the big things aiming for with with IPC that you could create a sub subnet with specific features enabled or disabled specific block times uh fee structures whatever it is you want on there there is a QR code that will take you through the documentation um about using IPC so IPC is something that's very very Cutting Edge at the moment we've been working on it I suggest you probably don't use it for any submissions that you're doing here today um you can have a go but there be dragons Okay so just a word of warning probably best go with the main filecoin Network just for the moment but this is stuff that is imminently um available so and there's a like I said QR code there that will take you to a tutorial on how to deploy um smart contracts to the test net uh we have now called melium which is test net on IPC you use exactly the same tooling hard hat remix that you do with the main Network it's just a case of configuring um to a different RPC endpoint so an example of something you can build on here is something like a data down this is what I'm going to give you a very quick run through demo of so the idea of this is to have some kind of smart contract that manages storage of data right so you might imagine that you have a um endowment or uh some sort of system in which you want to say we're going to manage the storage of a bunch of data um then that smart contract could actually perhaps manage the funds for that data you might have people contribute crowdfunding that then pay for the storage of that data you might have within the Dow some sort of voting mechanism so that people can vote on what needs to be stored maybe it could be validated by human before it is stored uh maybe the Dow could actually check certain things like um you know do kyc on the uploader of the data beforehand right to ensure that the data meets some particular Regional regulatory requirement before it is passed on to the storage providers so what we've got here is we have some data I have taken a quick photo out there I have then used the ipfs desktop client to upload that data and it is on ipfs you see there's a QR code you might be able to just see there starting with uh not a QR code a CID a Content identifier starting Q um that's actually slightly confusing in this demo that that's actually what's called a um version zero C that starts with a with a Q what you'll now see in a second of version the version one versions that start with a B it's the same thing it's just in a slightly different format I realized this just before the talk that there were the two different formats that it might be a little confusing but it is the same CID there so I've uploaded that that is now on the ipfs network via my laptop that is serving that up at the moment right um we have a governor smart contract that's taken from open zeppin it's a standard open Zeppelin Governor contract for a dow and we then have a uh small uh contract Lighthouse client contract that submits to the lighthouse um data aggregator that I mentioned to you there so we've pinned the copy on IBS goes through the Dow so we submit a proposal we're then going to vote on it we're then going to execute it and then Lighthouse will then store it on filecoin right so Judas running a little late on this I'm I'm going to walk through this um hopefully you can see this um that QR code will have taken you to a GitHub repository I've cloned the GitHub repository uh the FM data Dow GitHub repository I went in there um ran yarn install to install hard hat and the various dependencies I then then ran yarn hard hat deploy and it has deployed those contracts you see there's a a governor contract there there's Lighthouse client contract and even a data governance token contract so if we actually look in uh my metamask um I've actually got this data governance token token down here that has minted me as part of that deployment so I've got a bunch of them to use for voting in this uh Dow so that's it deployed right I can then run a proposal so at the very top there um oh actually that's that's the vote there there before that there's a proposal command um that you can run instead there so I can run yarn hard hat propose um and I give it a CID there which um oh yeah thank you i' hat propose so I can propose it um I can give it a a reason I've still got it wrong hard hat there we go live demos and typing um right so I could propose it that's a step I did just before but unfortunately I realized I cleared cleared my terminal just beforehand um it is now complaining because I've already just proposed that exact same CID so that's why it's complaining there uh proposal already exists uh so you'll have to just slightly take my word for it that in doing that you then get a proposal that you can vote on right so I then voted that's this Top Line very top line here I voted one which is yes in this case against The Proposal ID which comes back from when you do that proposed step it comes back with a proposal ID um and I gave it a reason for my vote which is hello Istanbul and that is then proposed right and we can see here proposed current proposal State one so this contract just needs one vote to approve it you could set a threshold or certain percentage number I've just said we just need one here and then once that's gone through um and the voting period is finished in this contract the voting period is just set to 3 minutes just for demo purposes um so You' actually uh propose it and then once that 3 minute time is up you have to vote within that 3 minutes you can then execute it so you then give it the CID again and the reason and it will execute right and so that then means it is now been passed onto the uh contract for liouse to then store it and I can actually look there's a a block Explorer uh called Phil Fox and if I look at the transaction and look at the logs we'll actually see for my transaction this submit aggregation request with Raz that's the event that has been admitted after everything has been executed that Lighthouse is looking out for so now when Lighthouse sees that they will fetch the CID the CID is actually encoded here within the uh within the data um that'll be the the hex representation of the CID takes that CID goes and fetches it from ipfs and then stores it on the filecoin network and the result will be at the end of that what's called a deal ID so when it gets picked up by a storage provider U which may be an amount of time later um I think it's about half an hour at the moment I think they're going at at the moment yes so it's about half an hour um you'll get back a deal ID and that is the bit that assures you that the data has been now stored on filecoin and then you'd be able to look in here and look at at the deals um and you can actually see um a deal here I'm just going to pick a random one um but you'll see the deals he says deal list or not if the Network's not going to let me load it but um you will get a a deal list no it doesn't want to show me deals okay yeah anyway you get a list of deals and from there you'd be able to see which deal okay so one of those deals then once it's been accepted you'll be able to see it here and see that it's been taken by a particular provider stored on the network okay so um I think that's it then right that's very Whistle Stop tour like I said you can come find us at the booth or chat to me after this if you want to find out more now going to hand over to Ally to talk about lilyan I'm allly you might have seen me before around the vcoin ecosystem as well uh super excited about this project um Richard is here as well uh to help on this project um quick overview uh we're creating kind of This Global permissionless distributed compute Network um which enables internet scale data processing so we're TR trying to especially in web 3 uh create a way for you to build these really web scale uh DS now and you can do this from Smart contracts or from a CA but uh you could call these functions from Smart contracts which really gives a lot more functionality to your daps as well um so yeah practical terms run Ai and other compute workloads I'm just conscious of time here and I want to get to the good stuff so basically uh we're aiming to enable you to run Ai and other Compu workload loads in this decentralized kind of crowd compute um that we're calling it or crowd Cloud that we're calling it a little bit um and you have access from the CLI or from Smart contracts or we've also got a web interface now uh which will eventually have an API key so you could use this like a web to project uh but it'll actually be a decentralized uh cloud in the background um so why are we doing this well if you have a look at the state of the compute at the moment uh it's pretty much controlled by a few handful of ianes uh at the moment uh which isn't really great like that creates an oligopoly that's not good for um outcomes of technology in society basically uh and it's the same for the state of AI at the moment these same powerful players that have access to like this vast amounts of data and this powerful compute Hardware also currently dominate uh this AI space and they're even pushing for regulations at the moment that essentially mean that all AI models should be closed source and proprietary which for all of us in this open source world is probably like a just what um so you know this open AI de day it was cool I watched it very Steve Jobs um and they they're creating some amazing stuff and I use chat GPT every day but we should probably be pretty wary about how vertically integrated this AI uh model is getting considering how much uh we are going to use it and rely on it or how much good it could do in the future as well um so given this immen immense potential we need to try and decentralize this AI stack as and that includes decentralizing the compute stack cuz that's currently a bottleneck to um creating good uh competitive AI models as well or running AI models so let's dig into how we're making this happen uh so lilypad combines this offchain compute implementation while providing onchain coordination uh it's built in go and solidity so it's fully evm compatible it uses its own ERC uh token called LP uh to pay for services and gas uh and it's deployed on IPC and we've also recently deployed to seoa and polygon as well if you want to try those out um so how do you use it you can use it via like I said before the lilipad CLI you could also use it via your smart contract so you can call a function directly from a smart contract and we've just released uh the lilipad AI Studio which is the web interface for this uh and it it's not available yet uh but you'll be able to use it with API keys so it'll be apis and sdks eventually So currently all jobs on the network are required to uh be deterministic um and we call them kind of modules so each module is like a packaged compute job um so it's either a Docker repo telling it what to do so run this stable def Fusion uh model or you can also use arbitrary wasm to create these so you can have a look at our docs to see more on how you can create your own modules as well um so you can add your own modules and in future you'll be able to like kind of charge a fee per job on your own module as well which should uh definitely uh TR to bootstrap like this ecosystem of AI Builders contributing to the project as well so we've got some already on there so you don't have to like do the hard work of creating your own module uh we've got things like sdxl which is like stable diffusion text to image the most recent release as well so it's like really really cool mid Journey like stable diff Fusion we've got mistol on there which is an llm so you can have a chat with this llm uh and there's also even fine tuning on there so you could do you could fine tune uh an image to oh sorry fine tune a model uh for your purpose for example you could pass it in a bunch of like docs on filecoin and fine tune an llm module to model to work uh with that which is pretty cool um so uh I'll show you how it works uh to get started you just have to add the lily pad Aurora network uh to your wallet usual flow get some test net tokens uh from the foret here um and then if you want to use the CLI uh so in your terminal or on your computer you just install it there's instructions in our docs to do this but it's just a couple of lines of code to install it uh and then you then put in your uh private key here into your CLI uh you're only telling your local machine this private key so don't worry uh and then you can go ahead and run different modules um so this is also a YouTube video of how to set up there so if you need some help on that and also how to run like stable diffusion uh text image if you want to like go back and have a look at that too and you're more of a visual learner uh next please slides right okay so after installing this is kind of our hello world uh this isn't really AI uh but this is like kind of our our hello world we've used cowfe for that this was our first ever module bit of fun uh and Rick even turns up in this module so it's pretty cool anyway this is just a tester so you can run something like cow say uh and see you just get a cow but it's a simple as like putting uh this one line of code in uh and then lilipad will run on this distributed network uh like it submits the job to the network a node will pick it up run the job and return the results as an ipfs CID and also to your local folder too um same with the stable diffusion text to image uh prompt so you can do Lily run sdxl uh and get a lovely uh unicorn here now because we're deterministic um you will get the same image if you put the same prompt in every time uh if you do want to change that you can change the seed so you'll be able to do prompt equals an astronaut writing a unicorn and then seed equals a different seed number and you'll get a different result there um so how about fine tuning a model uh this is pretty cool actually uh so we've just implemented fine tuning with sdxl uh you can pass it in uh a c so in this case uh there's an images CID getting passed in so perhaps 50 Monet images are passed into this uh ipfs CID and then a model can be fine-tuned to work on um this Monet images uh and then if you go this isn't a Monet image it's but as an example uh and then if you went and ran this with a prompt um so the next bit would be running the inference on it uh on your own mod module that you model that you just made sorry module model uh and you would get like kind of a Monee version of a dog I've seen enough cats so like I thought I'd do a dog today um you can also use it from Smart contracts uh so I won't do a demo because we're kind of a bit low on time today um but it this is all up in the docs as well um just use it from remix you put a couple of uh functions into your own smart contract and you'll be able to run the job and when it returns you'll get a result CID into your smart contract um heaps small modules as I kind of showed you earlier this is what the AI Studio web interface looks like um so just very web to flow for that one probably not useful for developers here but it's still cool uh anyway and then uh some things you could use it for um so I think web 3 is really good at unlocking Network effects um and as I said earlier like trying to create this actually open AI uh environment uh so I'd love to see uh what you could build around you know kind of where web 3 helps AI um U solve some of its problems that are cropping up like uh Providence or proof of humanity or attribution models as well and kind of speaking of attribution models uh we created a POC called water. which uh is a generative AI art platform that kind of addresses this attribution problem and under the hood this actually uses lily pads so what you do is uh an artist will upload their works um we'll train a model to it and then a user would come along and go hey I want some stable diffusion images based on Mon like I was saying earlier pay a small fee and that small fee some of that goes back to the original artist in the case of Monet because it's public works it goes to a charity but um as an example uh this is this is kind of a an interesting POC to think about um so some hack ideas as well we'd love to see some Dev and user tooling cuz we're really in beta stage here uh so it would be great to see some Devon user tooling uh get made for for Lily Pad uh and like I said I'd love to see the crossover between Ai and crypto uh some of your daps uh and end user projects as well if you need more inspiration have a look at our docs there's a bunch of past projects people have done at hackathons uh which will be interesting to look at as well um and otherwise get in touch with us um we'd love to see what you build we'll be around the booth as well so ask us questions and thanks for

Automatic transcript — names and jargon may be misspelled.