Filecoin 🛠Making Data Useful with Decentralised Compute - Ally Haire
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join Ally Haire of Filecoin for a workshop titled "Making Data Useful with Decentralised Compute". A hands on workshop on how to bridge FVM to powerful distributed compute for running AI, ML and more with Bacalhau & Lilypad & how these projects are building new paradigms for the data economy. We are incredibly excited to welcome back a community favorite: From June 2-21, 2023 we are joining forces for the fourth year in a row with Protocol Labs, one of the ecosystem's biggest open-source research, development, and deployment laboratories. Their projects include IPFS, Filecoin, libp2p, and many more. If you enjoyed last year's HackFS event, strap in—because this year will be even more phenomenal! For the first time, we will have prizes from The Filecoin Virtual Machine (FVM) for a HackFS, a runtime environment for smart contracts (also called actors) on the Filecoin network. FVM brings user programmability to Filecoin, unleashing the enormous potential of an open data economy. We are excited to respond to a highly requested community demand after our successful hacks FVM Space Warp in February of this year and Hack FEVM which took place in November of last year with this! ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
foreign [Music] and welcome to the hack FS filecoin Workshop making data useful with decentralized compute joining us today is Ali hair who will be taking us through the session and with that I'll pass it over to Ali to get the session started alrighty thank you so much and thank you for having me as well uh hello hack FS I'm really excited to be back and Champion decentralized data again this year at hack fs and also meeting with all the awesome folks building in this community so I did a workshop last year and I was just saying behind the scenes like how amazing it is just how much data uh how much content is available through the global channels and I can't imagine how many startups have been built out of some of the hats that have been facilitated by each Global so big clap to them as well but anyway I'm Ali I'm a developer relations engineer uh here at the PowerPoint foundation and I wanted to chat today about our vision at protocol labs and and filecoin for a truly open and Democratic internet and web which you probably heard a lot of but also why we're building out some of the foundational tooling to enable that and where we're going uh we're tooling for a decentralized trustless and kind of open compute networks which will help make data really useful in the fall coin ecosystem as well as kind of Usher in uh the ability to build more uh internet scale uh truly decentralized um apps which will kind of help maybe onboard the next billion people as well uh so firstly though uh a reminder on why we're doing this uh I always like to start off with this quote from Juan because I really didn't like it and to me it really encapsulates his vision and Mission uh and what both protocol labs and the filecoin foundation are aiming to achieve so the access uh that we have to data as well as kind of the restraints that we have on using it which depend on our geography our country and censorships or our resources or level of access to the internet are are incredibly kind of important parts of what really defines our modern our day human rights and it's also and it's it's only getting uh more pressing with the Advent of things like chat DBT and AI in my opinion but anyway this is also one of the reasons I went into Tech originally because it of just how fundamentally this Innovation and technological advancement can change and improve our lives as well and really we have a look back uh even just a hundred years we can see plenty of evidence of that so advances in healthcare inventions like the sewing machine washing machine and printing press and then even onto the more modern era of computers the Internet and mobile phones and in my lifetime I've seen that so you can probably guess my age from that but these things have really drastically improved the lives of millions um and they paved the way supports a major social changes and also a rethinking of the value and role of people in society as well I would say which is another societal challenge for us but while Tech creates some amazing New Frontiers for us and uh including it especially now with AI and chat gbt Rising into the mainstream and disrupting things as well it's incredibly important that we're kind of making sure that this Tech infrastructure we're building enables and even enforces the values that we need in it that of fairness trustlessness and openness uh we need from our Tech and that this Tech underpins the real goal for Tech and scientific breakthroughs which is to me that of improving The Human Condition anyway I will get off my soapbox but this is really some of the motivation well behind why I work at protocol labs and behind what we're trying to achieve here at protocol labs and filecoin so as we all know data is really essential to our daily lives but a majority of our data is kind of held in these centralized monopolies in the web 2 world and this leads to like some really um big engineering and social issues so much like the defy movement is aiming to democratize the financial industry and inject more trust and confidence into that our farcoin is aiming to democratize this data economy and the Internet by building out these purpose-built internet scale distributed Network for data so you know back with at the launch of filecoin uh this data storage blockchain in 2020 this was the first pillar of decentralizing starter infrastructure and we've done that and we're providing a robust and scalable market-driven Network for this decentralized storage as you'd already of course know uh probably we've since recently launched fbm uh the evm compatible layer one for barcoin and this has like opened up uh the bag a lot in it oh opened up the data economy anyway enabling smart contract functionality bringing you capabilities like Auto renewal filecoin deal making enabling tokenization of data sets which is a big one for me and kicking off the really exciting possibility for darted hours as well as of course enabling uh some like specific defy use cases for Lending and staking and filecoin in the filecoin network and like many many more use cases um and some that I will don't even know about yet which is uh exciting too so what's also really exciting for me is that in parallel we're also now working on bringing computation over data to filecoin uh with things like the back layer project so this is bringing the ability to really run complex and robust computations over all the useful data stored on filecoin or ipps already uh which is and this is where we can really start to see some of those web scale apps emerge that I mentioned earlier especially those that require kind of a massive amount of data processing in the background and yes that does include things like Ai and ml processing um so if we think about some of the data stored on the farcoin ecosystem though you can kind of get an idea of how expansive are all these pieces together could be and how they're how you know being able to make use of this data in complex and collaborative ways would be amazing so maybe things like analysis on cliver data action or collaborative academic research uh we CR we're starting to create an open education Library uh with Harvard or you know things like being able to run computation on livestrets of public government data or city data and expanding on this also thinking about creating more open and community-owned models for AI and ml so things like decentralized Ai and ml training and collaboration and uh also by the way check out uh the work done by the park going foundation for the decentralized web who are leading a lot of these initiatives that are showed on this slide uh they're a really inspiring Bunch over there um so anyway how do we go about all this uh let's dive into the actual technicals behind the compute over Data Network and how you would build on it uh so Baku yeah uh is a peer-to-peer open computation Network um which you might have kind of guessed from some of our rattlings already uh so it's a network of nodes which provides this platform for public transparent and optionally verifiable computation so fun fact the name actually comes from the abbreviation of compute over data cod cod which is kind of Portuguese which the Portuguese of is bakliar or a version of uh so bakaya was originally conceived to bring useful compute resources to data stored on the Ivan pheasant filecoin Network so it enables you to run arbitrary Docker containers or webassembly images as tasks against data and makes it really easy to analyze large data sets while bringing kind of these same benefits of open collaboration or data sets stored in ipfs and file to generic compute tasks and that's like a really big concept and really awesome so the too long didn't read is that battery hours are distributed off-chain computation Network um insert the run all the things Emoji here uh anyway uh if you do want to see more about what the impact might be I recommend this talk like one from uh last year as well uh so I'm gonna use cases or applications I it Buckley has kind of a really valuable tool for secure fast jump processing on large-scale data at the edge and it makes it really cheap as well so it takes the power of compute to where the data lives so some of the most exciting potential applications for baklio are for DSI as well as you know as potential for distributed machine learning and decentralized AI iot secure enclaves uh fraud detection and many many more that I can't even begin to imagine as well so if you want to dig further though into the design uh decentralized AI Vision I really recommend this uh recent Podcast chat with uh Wes Floyd who's amazing and has done a bunch of great work in this field Elon Musk did her talking about Elon what's the controversial anyway so uh back we are in practice let's dig into how we'd actually build on it so uh this example of how you can both make an open this this example is found in our docs uh so it's it's how you can make both an open source text to image script in Python and then run it on back the rgpo on a backward GPU enabled node uh with just a few lines of code so uh this is found in our docs and I've also got a video out on it if you want to dig even deeper so just for those of you that may not know stable diffusion is just a machine learning model which is used for creating images from a text prompt so it's like the model behind mid-journey or Dali um so let's see how we could uh get started with this so there's really only three steps involved in this process so firstly you would write your script so any script in any compatible Docker or uh wasn't language is allowable here uh so a lot of scope there so in this particular example there's a python script which uses an open source tensorflow implementation of stable diffusion and it has which has some pre-calculated weights and it uses these to generate the images from a given text prompt and then displays the image they like in practice you'd want to return that image not just display it so this is a basic version uh then to use this script on Battle you really just have to dockerize it and finally install the backyard clay in just what you know if you're going to use battery you've got to install it but it's just one line of command line code I swear super simple uh so you can then run this uh dockerai script anywhere using the backyard CLI as you can see here so this will send the job to the back of your public node Network which is currently all free to use but computation so this particular script is auridocaraz so you can try it out for yourself without any of the effort of actually making it as well so go ahead and uh you know try some stable diffusion images uh using this script in your command line if you like now the output of this once the job is run is that the results are returned to a folder one of the cool things about bapia is that it's able to save these results directly to ibfs and filecoin uh via Estuary so you can also Define different outputs for your configuration uh but you can get back this ipfs CID because these jobs are saved to estuary um so cool we have a verifiable computation Network and we have some idea of how to use it now um but how does this interact with fbm if I I wanted to build on the fbm well in terms of the filecoin and our fem Network as I kind of mentioned in the Falcon Vision a little earlier storage is really just a start so architecturally we can think of the storage layer 5. it's like layer zero uh and then this ability to perform on-chain computation uh or computation over state which comes from fvm brings these layer one capabilities to the filecoin stack so bakayale is then bringing this additional capability for off-chain verifiable compute loads on large data to the network so in order to bring the power of this compute directly to your smart contracts though we kind of developed this prototype for relaying backyard jobs directly from your fbm smart contracts so this early prototype is called lily pad and it acts as an initial connector for these Technologies so lilypad operates as this bridge for calling backyard off chain compute jobs from your smart contract and for the devs here it's also already deployed to the fbm calibration test net and to the fbm mainnet and you can check out the GitHub repo for me more details on how to use it there the architecture is fairly straightforward at the base layer Lily Pad acts um as a bridge as I mentioned but calling any of the backyard jobs uh that you want and receiving those results back directly uh from sorry receiving those results uh directly from a solidity smart contract so I use a contract would implement the lilypad caller interface and to call a job they then uh they make a function call to the deployed lilypad events contract with the docker spec that they want to use so this contract that emits an event which the lily pad Bridge Damon listens for and it forwards this onto the backyard Network for processing so once the job's complete the results are then returned back to the originating user contract from the beach bridge bridge sorry code so taking a look at this in practice we have an example in the GitHub which is the same stable diffusion example as we saw earlier but we have we are running this from the lily pad Bridge so calling it directly from a smart contract um so I'm just gonna show you an example of how this would work so you would implement it in the smart contract like I said we've already got an example on the GitHub that you can follow there has been a few recent changes but basically uh you would uh call this stable diffusion job and this is just in this video you can see uh this being called and you just saw the backyard logs accepting and are running the job sent so when the image results are returned in an ipfs CID we can take a look at those images and it is a rainbow unicorn that we are still just there and so you can then use this this kind of Lily Pad Bridge as the basis for all sorts of functionality on fbm including this kind of early concept app which was an AI art generated nft app on fbm which is also a video on if um on each Global if you want to check out the full details of that or you can find the full tutorial on my my blog at developeralley.com as well if you want to dig into that um so we're really hoping this like Lily Pad Bridge or there's a v0 of Lily Pad is an early prototype that can help like open up a lot of potential opportunities for things that maybe need to be built in the fbm and filecoin ecosystem uh so things like native Falcon and ipfs data applications uh you know maybe some file coin native oracle-like services and also kind of excitingly to me uh those decentralized Ai and ml applications and I think it could be a really good Tool uh to try out for this hackathon because it's fairly simple to use as well uh so in the future we're really hoping to evolve this uh lilypad v0 concept into a more robust and trustless platform for decentralized compute jobs and this includes ongoing work into the game theory of distributed computing and working with early adopters as well to identify their main use cases for the platform so if this is you or if this is something that you're like yes this is the future this is something I want to be involved in uh definitely get in touch with us we'd love to hear from you or you know build out a project uh in the hackathon uh that you know really blows our mind so we'd love to see that as well um so just as an example of what's possible when you can combine the features of blockchain uh with a decentralized off-chain compute Network I wanted to show you our Waterlily dot AI so this is based on the lilypad text so underlying uh this application we are using both baklia and lillipad um on a private network but uh still and there's a full blog on this as well you can go and have a look at that at developerally.com as well anyway what is it water lily is like kind of this first of a Kind user-facing app and we're kind of we aim to provide a more Equitable Paradigm for generative AI art platforms so when I built like kind of my AI art nft uh example utilizing you know Bacio and fbm I was a bit like oh is this a good thing should we really be you know marketizing marketizing I don't know like making money uh out of things that you know we didn't even really create I don't know something about it didn't really really sit right for me so one of the main Concepts here was to provide this generative AI art platform that addressed some of these issues and kind of gave royalties uh back to original artwork creators which is like a really cool thing uh that you can do with blockchain networks so this was the main concept uh giving control back to creators and adding as potential new Revenue stream for them to opt into and explore while still giving a user an easy way to create these generative AI art and even nfts uh that you know I I still are kind of more ethical than the original versions perhaps so as a user you can navigate to water lily you enter a text prompt for an image you'd like to generate you can then like kind of browse through a selection of both private artist and public domain artists and you can choose a style that you'd like to generate your image in um so you can see down the bottom there there's kind of some uh generated images that have a text prompt and you know a famous artist that you've probably heard of Salvador Dali or silly Kandinsky um Claude Monet um and what we've done is really fine-tune this artist model based on some import art uh using drain booth and by the way there's uh a uh there's kind of in the docks in the backyard docks you can find out how to do that for yourself as well if that's something you're interested in um and we fine-tuned this model to this particular artist and then each time our user chooses this artist this um the artist is paid a certain amount of money uh for the images that are generated so for private artists they are paid directly to their wallet for some of the public artists we are donating those funds uh to our art foundations one of which is our gray area which is an amazing art community and Foundation based in San Francisco anyway the point of this is I just wanted to show you what maybe is possible with kind of some of this underlying technology um I'll move on and give you some more awesome hackathon ideas on what to build because it doesn't have to directly be fbm and back we are you can build anything you like with the backyard Tech without interacting directly with a smart contract that's just one way to do it uh so some some more ideas for back here and lurk by the way which is the ZK uh snark language uh and lily pads so you can combine the power of compute with data Downs that's something I'm really interested in seeing um I think data towers are a really powerful uh tool in the Far Point ecosystem are really unique to our ecosystem too so I I'd love to see them getting built out even further with like kind of this backyard compute power um then there's also using these trustless features of blockchain combined with backyard compute and or lurk to solve unique challenges emerging in the AI space uh you know kind of similar to what we did with water lily but um you know I'm sure there is like many many more ideas uh for which way you could go with that or different Industries you could do that with as well uh you know as some of these people are mention in these tweets um there's other example ideas we've come up with as well decentralized research framework there's broad detection systems or you know something that's kind of been really interesting to me um you know could we use kind of AI compute to analyze solidity contracts for you know security vulnerabilities uh that could be something that might be of interest to you as well um decentralized data aggregation potentially decentralized gaming now I think for the decentralized gaming use case what um will be really cool in the future is IPC which and I think IPC crew did a lecture here at Eve Global so IPC is kind of this subnet interplanetary connection um consensus sorry not connection but it could be implemented interplanetary consensus uh layer for uh filecoin and it's gonna work at whatever speed you like because it's got a bunch of subnets under filecoin so basically a file coin layout to is an easy way to talk about that but it can create provide really fast transaction speeds which you know would be great for decentralized gaining gaming but in the meantime there's still plenty of applications you could do there and just to offline to charge it anyway decentralized data analysis obviously uh with bakio and fbm for data analysis and insides generation our decentralized asset management it could be cool to leverage baklio and fbm with some of the uh stock that's happening in the D5 ecosystem on filecoin uh there's decentralized lending platform or you know even analytics for Lending platforms which is you know kind of a super important part of the filecoin market ecosystem and data ecosystem uh so doing something like that could be really cool there's decentralized Insurance marketplaces and so many more ideas uh in fact if you do want even more inspirational or recently just held a compute over data Summit in Boston uh and there is a bunch of talks from so many smart people I was just sitting in the room going oh my God hopefully like I get smarter from all these talks so I recommend checking out the uh channel uh and uh seeing what's going on in this space because honestly there's some real stars and some really cool projects Happening Here uh and not just from back yeah but splitting a painful across the ecosystem as well uh even more examples obviously go and check out the docks that could be like the spark that you need to get started and otherwise I am pretty much going to leave it there I think I'm just on time which is awesome because I didn't time that uh so get in touch with us uh being bold join us on our slack we've got our own slack there a bitly slash Buckle our project slack uh or you know follow our Twitter's or just get in touch with me on the global Discord um and I'll be happy to chat with you if you do have questions exactly I think Rory is just putting the chat there please uh feel free to drop them here and I'll be happy to answer them as well oh yeah I just wanted to show you we've got some awesome chats happening on ethical AI discussions in the backyard Channel which I've like really been uh following as well like there's some really great people in there talking about some uh you know really interesting subject matter as well so come and have a look at that or if you're interested just you know come and join in or look um all right otherwise thank you very much everyone yeah cheers thank you Ali yeah if there are no questions so thanks for the great presentation and thank you everybody for attending and we will see you all tomorrow for more workshops so cheers thank you I'm happy building bye bye
Automatic transcript — names and jargon may be misspelled.