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

Loading player…

Filecoin 🛠 DataDAOs on the FVM

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join us for a workshop titled, "DataDAOs on the FVM". This workshop is part of ETHGlobal's flagship online event: ETHOnline 2023! ETHOnline 2023 has grown into one of the most exciting events on our calendar, anticipated by hackers all over the world. ETHOnline is a three week long online hackathon with over $200,000 USD in prizes as well as a series of curated summits, celebrating some of the most significant happenings & learnings from the past 12 months in web3. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] my name is Zach if you already know me I'm a developer relations engineer at protocol Labs specifically within the FM file virtual machine team and uh you know today I'm want to talk to you about what the filecoin virtual machine is uh kind of the basics of filecoin and we'll go into some specific applications you can build on the FM um specifically data DS right uh so the file coin master plan um if you're not familiar Step One is build the world's largest decentralized storage Network and that is already checked off step two onboard and Safeguard humanties data and I think this is a mission um that goes on forever right um we won't have all of humani data on file coin at any one time uh but we want to get as close as we possibly can right instead step three is bring compute to the data to enable webscale apps and this is where the filecoin virtual machine comes into play right so the filecoin virtual machine uh project delivers onchain programmability to the file cord Network and uh we'll talk about what that means specifically here in a second so some of the most common questions that uh we still continuously get um and misconceptions we get is you know what's the difference between filecoin and ipfs what do they sit how are the two related a lot of people seem to know that they're interconnected um so um filecoin and ipfs are actually two separate networks right um You have ipfs it's got its network of nodes and computers where you can pin data um and you have file coin where we can think of it as layers where we have a layer zero which is file coin uh the the storage layer this is the storage providers who are running the file coin nodes layer one you can kind of think of like a 0.5 is really what I think about uh the FM because it's built into the node software it's not like another chain or another compute environment plugging into filecoin it is in filecoin um and you have the layer twos uh where you can program actual daps on um the file coin virtual machine right so um on ipfs uh you can run your own node and uh or run a bunch of your own nodes and pin data to it uh you can run nodes with the community and uh you know if the community really likes a specific piece of data they can run nodes and keep that data alive or um you can run your own node and pay for a pinning service to keep data live right so ipfs is all about uh getting data stored and retrieving it through its uh content identifier uh but you know this does um not give you guarantees that the data will stay up and live um and uh you know we're paying for a pinning service this might introduce like a centralization vector uh into the DAP which not all daps want to accept right so this is where file coin comes in right uh so you have uh the storage provider Network here at the bottom they're all running their nodes um in the middle uh you see the filecoin blockchain uh this is actually being run uh within the storage provider Network here uh in each of the nodes uh so this is kind of like a logical thing and um this is kind of uh acting as a middle layer between these storage providers and clients who want to store data with these storage providers right um so uh a storage deal is made on chain and this kind of cryptoeconomic um incentivize these storage providers to store data um and uh gives clients a way to store data in this more decentralized environment right and now make things a little bit add another layer of complexity uh within this uh blockchain being again run by all these storage providers uh is the file coin virtual machine right which allows compute to happen within the blockchain and uh in this case uh the file coin virtual machine is actually running the ethereum virtual machine within it um and this allows us to make a custom logic around storage Shield metadata uh for like storage or retrieval um you can make for instance data Dows and we'll talk a lot more about the other types of applications you can build so to get an idea of um the actual architecture of what the fcoin virtual machine looks like and in the fcoin node so if you were to zoom in on one of those storage providers in the earlier uh slide and look at the software they're running uh they'll run a filecoin note the most popular is a Lotus node and within that again lives the fvm and it is actually built uh using wasm time so it's actually built uh with wasum and within the uh fvm uh is a virtualized evm right so kind of like how you can run a hypervisor on your computer and if you're running a Windows you could virtualize a Mac OS on there or vice versa if you're running Mac OS you could virtualize Windows Within These nodes you know the wasm time is a virtualized uh ethereum virtual machine right and this is the first runtime that uh is actually live and um in the future uh you could have um actual native we call native actors you could program smart contracts and anything that compiles to wasm and deploy those to the chain uh but that isn't live yet right in the future there is the possibility of services such as renew as a service uh planetary consensus subnets um Native userdefined wasm actors new Forum blockchain run times right so this is one of the advantages of this design Paradigm is that um we don't have to settle for just a single runtime right if another uh um virtual machine takes off in the web 3D space and that's the one that uh most projects are building around um the FM can be adapted to use a new for runtime right and it could even be a non-blockchain run time right so for instance the na of wasm itself um and uh you know possibly any other runtime that you may uh find useful to run uh in a web3 space but since the evm is the first uh runtime live the fvm is compatible with all of your favorite evm tools and this is why the evm was the first run time um to be virtualized then the fvm right so you can use remix you can use hard hat Foundry metamask uh all your your favorite kind of tools that you used to building with in the in the web 3D space um slide so why should you use fbm over all these other evm compatible chains uh around uh and the deal uh the answer is storage deals right this is a unique uh feature that isn't available um on any other chain because remember filecoin is based natively around uh getting data archivally stored a long-term storage and uh with that comes this idea of storage deals right so what is a storage deal right so we talked about how the Falone blockchain uh kind of sits in between clients and storage providers and storage providers actually store this large data um and on chain um and this this distinction um is often confused but on chain the data that we're storing with the storage proage does not live on chain anyway right that'd be incredibly expensive that's the reason why uh blockchains tend not to store large data sets in the first place right like nft images are often stored on ipfs and increasingly so on filecoin and so filecoin um is around for what what's actually stored on chain is the deal right so it's like the metadata of the data being stored with the storage providers right it's um it's all of the data around how long that data is going to be stored you know when it was created who the client is who the provider is how big the pie size is which is ultimately the data that's being stored with the storage provider is it verified on Phil Plus or not um and what are the fees being paid to that uh storage provider over the time right this is what governs the actual data being stored with the storage provider right and this is what crypto economically guarantees that data storage so if uh every provider uh needs to put up stake and um with that stake they need to provide proofs on chain that they actually have your data stored right so we call them proof of replication and proof in SpaceTime and um if they do not provide these proofs Pro proof of SpaceTime like every day then they get slashed right um and they do not get paid so they have all these cryptoeconomic incentives to keep your data stored um and if not uh suffer the consequences so again uh just to make this distinction Crystal Clear what is it a storage deal so what can't I access in the fvm uh the actual data stored with storage providers right um again that would be way too heavy way too expensive to actually use an FM and that's why F was created in the first place to kind of create the infrastructure to maintain this data in a decentralized way but not actually keep it all on chain um so we have the file Corin virtual machine we have these storage deals which are native Primitives to file coin the the evm doesn't know about storage shelds though right it doesn't know about file coin in for the for that matter right knows about ethereum addresses it knows about you know how much uh you know in the case of ethereum how much eth in the case of file coin how much Phill is in every account but it doesn't know um what a storage deal is right and so um in conjunction with um a team called Zandex we created uh these file coin. solidity libraries which is called filecoin doou right and these act as abstraction layers between you the solidity Dev and the low-level Primitives that you need to access these storage deals in your dabs right um so if you were to go in there you could go into contracts you would find a contract called market. soul and that provides some getter functions that you can use to get um you know live deals uh structures into your adaps and write logic around it so um again um storing data is really what filecoin is all about and so if you want to store data you have three kind of paths you can take um perhaps you don't need programmatic storage you don't need to use the virtual machine for anything you just need to get data stored uh you can always store data like you always could on filecoin outside of the filecoin virtual machine and um just make a deal with a storage provider and this can actually happen offchain um you know you can go to a storage provider Marketplace find one offering a good deal you want or find one you think you can negotiate with negotiate a deal parameter and what you actually do is you sign that deal uh that deal goes to the storage provider they'll also check up on it and say okay this is actually good they'll check that the data that you're actually storing with them hashes to that PCI ID which represents the data and if everything checks out they'll call a method on chain with your signature and um the storage deal will become active right but perhaps you want to do this in a programmatic way right um You Want to somehow use the file coin virtual machine uh for instance making a dow like we'll see later around these like uh making storage deals right well if you actually want to store small data which most most hackathon participants do and they're not like have these giant uh data sets you we actually recommend we go with um what we call Deal aggregation right uh or using an aggregator a big aggregator I we recommend is lighthouse. storage uh they've been great at taking the latest features being available in the file C virtual machine and integrating them in with their aggregator and they'll abstract away the pain of making a deal for you right so you can call them through an SDK or you can call them through a smart contract on chain and they'll take your data they'll put pair to be stored and then they'll aggregate it with a bunch of other people who want data to be stored and they'll make a deal um together um on Shain with a storage provider for you now where this gets all all Ultra convenient and what uh what we really like about lighthous test storage and what they've done is they'll actually provide you what's called a proof of data inclusion um data segment inclusion or Podi right and and remember they're aggregating data among uh not just your data set but they're combining with all this other data then making a deal right so how do you know what deal your data sits with uh you know so you could possibly contact on storage provid yourself and get it back well they'll provide you a proof of data inclusion on chain uh that says hey um your data is aggregated in with this other data and stored with this storage provider and here's the proof right um so thus the advantage of using the data aggregator but if you're feeling a little bit more Savvy you want to make deals yourself you can use uh what we call Direct deal making on chain with something called the client contract and there's actually a deal making starter kit and you'll have a link to that uh at the end of the presentation um but that allows you to make deals directly with Boost storage providers um on chain and uh you can do so by calling a function that admits an event that these boost storage providers listen to but this can be a lot more complicated as you have to know the precise uh ways to make a deal and if not uh that deal might not go through and that could be a whole round of troubleshooting right yep we have those three paths um and again for most people uh I I would really recommend the aggregator out especially if you're going to be hacking and a hack Capon so what can that FM solve um you know it can do what like many other web 3 virtual machines can do it can do governance tokenomics do management we're seeing DFI projects launch um uh just traditional Dows but also we can build uh specific infrastructure around these storage deals like repair workers that uh repair renew workers that will find deals that are faulty are um about to expire and automatically renew them for you uh and generate new storage deals as I talked about in those three pathways through the client contract right so the FM kind of super charges uh the file coin ecosystem for storing data and so you saw that you know part of the label of the talk is data Dows um and if you're not familiar a dow stands for a decentralized autonomous organization um it really is just adding a governance process to smart contracts so some smart contracts need things like upgradeability um and decision making that just can't be logic Away by simp by ones and zeros in math and in this case we'll want to add a governance structure to our smart contracts to try to keep them as decentralized as possible right um and this is kind of factiously put in here about what is data you know data is a collection of discret values blah blah blah blah blah I'm not I believe you all know what data is um but you know data Dows are combining these two things and specifically what I mean is and what we mean at protocol Labs is um Dows for storing data on filecoin right you may hear the term use in other ways in other ecosystems uh but when we're using it in filecoin uh context this is what we mean right so a dow that governs uh data being stored with those storage providers so as an example uh my colleague Sarah came up with this idea of biscuit Dow right uh the biscuit data da it's a community of Corgi owners that want to better understand their corgis and so maybe you can think of biscuit Dow as having um ZK verified contributor to access the storage contracts right so we could have some kind of uh did decentralized identity to verify who's uh doing what in the Dow but these contributors either way they can upload data to the Dow uh so the week and um they should be admitted tokens to reward uh Corgi owners right and so this Dow could collect crowd fund money like Phill or they canm their own token for the Dow um and reward people as they upload data to the file cour network data that the Dow finds particularly useful in this case maybe Health Data on corgis right so as Corgi owners participate in the Dow they can get more tokens and further participating Dow uh voting and what can they do with this vote right so they can choose to train uh for instance AI with the data that's being stored in the uh with the storage providers right U there's a project called lilypad being built on top of filecoin which um also seamlessly is trying to have a bridge between filecoin and heavy compute AI so you could kind of combine these two things and train AI models based on the data the Dow is storing um the Dow could vote to access control the data set um that is uh that is offchain uh for specific users and of course the Dow can vote on how to use the rest of the funds in the treasury right uh maybe they want to get more data stored maybe they want to um have access to dexes and uh trade across currencies that they may find interesting or fund these renew repair replicate deals I was talking about earlier uh this infrastructure to keep the deals alive right so you can have this data that lives with storage providers and the Dow can kind of perpetually fund um that data to be stored permanently uh with their tracery and in the end you get healthier and happier corgis who doesn't love happy corgis this little fell looks pretty happy if I do say so myself um and so I think you know everyone kind of gets a happy end to the story and while this is like a fun example uh just to kind of make uh data Dows real um I see a lot of personal use cases I see a lot of people coming in and doing with uh cool ideas like scientific data there was a project that wanted to take like oceanographic data uh that they were collecting in University and storing it in and using a dow to kind of uh decentralize ownership of this data um you can actually find an MVP repo of biscuit Dow that I built uh for fun uh at this link uh check it out uh again it's just a demo for you to kind of go through see some of the scripts that have been made um see some of the sdks that were used uh frontend is on the way but um yeah so you can you know when you're brainstorming a data da uh this can maybe give you something concrete to start off with right and uh again I want to shout out to Lighthouse aggregator which I talked about and they've really been building out some really cool stuff uh they have really good docs I highly suggest you check it out um uh and you know they take advantage of all the latest technology like that pod size you see here like how do you upload your data and get a proof that your up data has been uploaded on chain um well extremely uh easy to use and um you know keeping up to date with all the latest tech in the filecoin ecosystem uh and for something as more of a launching point if you're thinking about building a data Dow you know B Dow is just kind of a concrete example we have a data Dow kit which uh kind of has all of the building blocks that are like not opinionated that are just kind of there uh to show you some important building blocks you may need to use with some scripts right so govern op Ze Lin Governor contract erc20 votes contract all op upin standards uh here ready for you to use and uh take advantage of and uh for some more General fvm resources you can check out this link tree which has everything before and uh links to the gith help forums uh docs use case ideas and uh all their Community discussions you may find uh useful so yeah um thank you for listening

Automatic transcript — names and jargon may be misspelled.