📣 FEVM Summit — The EVM-compatibility of FVM aka FEVM - Sarah Thiam
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join Sarah Thiam of Protocol Labs for a talk titled "The EVM-compatibility of FVM aka FEVM". What use is computing without storage? For too long, blockchains have been defined by a frustrating tradeoff—should my decentralized network focus on compute, or on storage? We've seen incredible innovation on both sides—Ethereum the world's largest computer—and IPFS & Filecoin, the world's largest decentralized storage networks. While we've seen thousands of groundbreaking DApps developed harnessing the power of these technologies, under the hood, they require complex scaffolding, disjointed layers, or complicated developer patterns. Sometimes even, decentralized storage is disregarded, opting instead to return to the "easier" centralized methods. A small team of builders at Protocol Labs set out to change that, and with the Filecoin Virtual Machine (FVM), have turned the Filecoin blockchain into a programmable platform that developers can deploy programs to, finally uniting compute and data on a single network. But they did not stop there... The FEVM creates a runtime within the FVM which simulates the Ethereum Virtual Machine, making all smart contracts which compile to EVM bytecode, such as Solidity contracts, executable on the Filecoin blockchain. With completely decentralized compute and storage united once more—we're more excited than ever for this new frontier—and for what you'll build. ------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com #ethereum #web3 #blockchain #eth
Transcript
foreign [Applause] [Music] this gets us right into our next talk which is you know you learned about the surface area but let's go directly deep into what is the evm compatibility piece means here so to talk about that I want to welcome Sarah uh here and uh I'll let her take over welcome Sarah hey hi Karthik thanks for welcoming me um thanks Molly for that great introduction to the vision of um fvm as a whole I'm just going to start sharing my slides in a second hang on oh yeah so um yeah I think Molly has painted a really good vision of what we hope to achieve with fbm and where we're at right now on the fevm um so what I'll do for my talk is kind of go a little bit deeper into um the architecture of how the fvm is set up and also specifically um the evm compatibility piece of the fbm which then constitutes the word fevm uh yeah so and then for the rest of the day we'll have all my other teammates coming on as well as some of our partners to share a little bit about some tutorials on how you can build certain scenarios these are just ideas that you can have so Zach's gonna come on and talk a little bit about that and then we're going to have Zandex glyph come on to talk about the really important important tooling that you can use to build in your project as well so I hope my session kind of gives you a sense of the underlying concepts of what you'll be building on Okay cool so a little bit about myself um nice to meet all of you my name is Sarah I'm an fem deaf Advocate I'm on the developer experience team I've been at protocol labs for a few months now I am supported by a really amazing team um you know we have a few faces here that are not on the board um that are still joining our team and so on um but these are like product engineering um strategy DX ecosystem yeah so we all work really well together and a lot of the content I'm sharing today is just me sharing of what what's been built but you know it really owing to a lot of good work that has been done with my team um before this so yeah we'll all be on the chats answering questions um I think we're all kind of on standby through this through this weekend just to kind of be able to support your projects so really looking forward to getting all the questions from all of you and and that's already started right I've seen some of you on the brainstorming on the Twitter spaces so that's been great um also a few of our partners that we work really closely with we operate in a very open source way and there's also no way that we could build um to the point that we've built at without the help of all these great Partners yeah and definitely more that are not featured here so I'll get a little bit into X I know you've seen this slide a little bit earlier on but let me touch um a little bit deeper on it so um this one talks a little bit about how the fbm itself was inspired this was of course um started way before I joined the team um the the founding engineering team for the fvm they were really inspired by hypervisors the active model and the Unix kernel um I think what we envisioned was a system that could host multiple runtimes and serve as a seamless connector between them this was really important as well because blockchain runtimes are developing really rapidly and harboring many different developer communities and so we want to make sure that we're able to accommodate them as they come in and I think it's the general ethos of the pl the protocol Labs Network to be able to build things that complement the ecosystem and allow people to build on top of that whichever tooling or systems or preference preference or languages that they have and I'll talk a little bit more about that and you'll understand the features of that with the fvm and how we've really worked towards implementing that um so we uh for the fall hypervisors piece um it is the underlying machine that allows multiple machines to run on top of it and so we're thinking you know today might be evm but in the future it might be other user-defined VMS as well um for the active model it acts very much as the interaction Paradigm between runtimes and the contracts or the workloads that they interact with um so you can so that's also why we call um the smart contract equivalent but not exactly an equivalent I'll talk about that in a second we refer to them as actors so you'll see the world appear a lot in our documentation and that's what we're really referring to over here um the unit's kernel itself was was a point of inspiration because of the isolation memory environment storage abstractions and so on um all of which are really accessible through a system calls or assist calls um so to kind of explain the difference between smart contracts and actors um the way you can think about it is that on the Falcon Network the fvm and fevm functionality is carried out by actors so when you deploy an evm smart contract to the filecoin network an actor is created that contains the ethereum byte code and executes that code on the evm yeah so right now it's more on the evm deploying to the Falcon Network through the fvm we hope that in the future we can think a little bit more about our Engineers right now thinking about things like parallelism how can we use you know I'll talk about the architecture later on but the way that we've built it allows us to see um to maybe be able to build um parallel ways of functioning across foreign runtime as well as the fvm itself so that these do like um you know title coordination things can move faster it's more performant so these are things that we're thinking about right now um you've also seen this slide but let me go into each of the points because I know Molly was was like going through the paint Division and so let me explain a little bit about each of these points um so these are different features that we considered when we were building out the fvm um I'll talk about the architecture in a second but let me also talk about um some of the features here and what we've considered so first of all it's based off on webassembly um using wasn't wasn't time under the hood in its reference implementation uh you can think of what I'm running at the hypervisor level which we talked about a hypervisor layer which talked a little bit about earlier on um as I mentioned it can power multiple runtimes like evm secure agma script and so on and because it compiles the native bytecode it really leads to great performance so for those of you who have used webassembly you know how efficient it is maybe in a web browser but here we're trying to use it within a VM instead and you know as you can see like it has really led to um the outcomes that we wanted um Watson gives a high-level language as a compilation Target so then devs will be able to use their preferred language to write their actors um so you could use languages that you're comfortable with such as like python JavaScript assembly script well we actually have a few sdks out um for Native actors and I'll talk about that a little bit later but you can see on the on the architecture diagram over here you have native actors in your foreign runtimes and so for Native actors we actually have developed sdks such as technical assembly script high-level rest and these are developed by our partners um so yeah we look forward to the community building out more sdks for the languages that they prefer or the communities that they are part of um and so it was a muscle surprise uh also imparts this calls and declares them which makes it easy to order and start to analyze in the fbm so especially if it's the wrong sys call that you are able to you are then able to identify and isolate it whereas in other VMS typically you kind of have to like scan the code and identify that yourself so we think that that allows a lot more control for us um Watson also provides a Sandbox environment that assumes zero trust that again makes it easy to analyze the instrument so what that allows is that the fvm will then you know we can then have things like built-in resource metering for guest estimation and accounting and we and each Act also runs in isolation and can escape its sandbox through this calls which is once again very much inspired by the Linux model um around low level system calls that's also a feature that we've considered again that gives a lot more control around this discourse than we want to make ipld Native so for those of you who are new to ipld it stands for um I think it's interplanetary link data um but it's then uh might be wrong on that but it basically links to like content addressable data structures that are linked through hashing so why we've chosen to make this make the fvm ipld native is because all data is managed in exchange to ibld which means that all content is addressed and linked through hashing and that makes us free it makes it really efficient in building the fvm or for devs like yourself to build on top of it because it makes it really easy to snap Local 3 data structures for historical State checks for example and so this allows you to build much more efficiently you will also be able to account for state of not just the accounts itself but also state of the actors within it really getting to like more Atomic pieces that you can then account for which then makes it easier for you to have control over what you want to build and better coordination amongst actors for example and lastly you also get to Define your data layout so if you want to choose you know having this piece of data to sit next to another piece of data that's up to you to choose if you think that's more efficient for what you're trying to build so yeah we're trying to give as much control as possible to the developer and so that's a lot of the thought that has gone into building the fvm um it also supports foreign addressing and foreign signature schemes and we'll get to that a bit in the next section uh where I talk about how the evm is is made compatible for the fbm this really very much ties into it and so let me touch a little bit on the on the diagram over here you can see on so as a whole you can see that the fvm to be clear for those that are new to the fbm the fvm sits on top of a filecoin node and so everything I just described sits within what the FM is able to execute and then on top of that you have two categories of actors so you have native actors in your foreign runtime actors I normally talked a little bit around the foreign run times there right now we're talking about evm and in the future we hope to build for other um other VMS as well or have the community build that out um for the native actors two subcategories in here one is the building system actors and one is the user-defined was a Magnus so for built-in system actors um that's something that is hard coded into the network and in the fvm and then onto the network itself so these are actors that you will interact with like a market actor or minor actor that then allows you to do all the storage and retrieval capabilities and Primitives that you want to do and on the other subcategory you have to use the Define wasm actors um I think if you were to write native actors within the fvm it would usually be um you know writing in rest C plus C plus plus and also we are developing either sdks as well but those three languages are the most recommended but then that's for you to Define you can write your actors and it should run within the fvm itself so as a whole that is how the FM architecture works and so right now we'll jump into the foreign active piece which is around the you know the evm phase that we're at right now um we talked a little bit about the roadmap earlier um earlier in July this year we actually so fbm is actually live on the the Falcon Network as of today um the portion here the subcategory around building system actors is what's available on the main net so you might not see it or experience it and you also can't program it as of today but where we're at right now is around fevm and so when that launches in February next year you will be when it goes live to the mainnet main filecoin Network you would then be able to program actors there and then later on probably mid-year 2023 is what we're looking at um always subject to change but it's something that we're focusing on is to then allow for that subcategory of user-defined native actors to be um to be launched into mainnet so for developers to use and so I think that's the point where it will really unlock a lot of the capabilities not just for the ethereum ecosystem but for many developers out there as well so yeah so this is the question around how does the evm deploy to fvm out of the box we talk a big game about making sure that it is seamless and it's a seamless deployment for evm developers again you all are like one of the first you know early Builders first few early Builders to be touching this piece of technology it is um we have not launched yet we are pre-launched so a lot of this I think as of probably two days ago our Json our ethereum Json RPC API is now fully feature complete so you have a lot of new capabilities really hot fresh out of the oven for you to use so we really look forward to testing and all the feedback that's going to come but let me talk a little bit about how that is achieved so um so I'll run through a few of these considerations um no considerations these are more like factors or or ways in which the evm can then seamlessly deploy to Fem um first step is around how evm runtime is compatible ASM so the fvm supports evm smart contracts out of the box um the evm runtime is always compiled to wasm as I mentioned earlier with the fvm architecture and so the fbm emulates evm by code at a low level supporting contracts written in solidity Viper and you very much focusing focused on solidity right now um there is no special evm support per se and this once again is plays to the ethos of how we hope that the fvm is something that can support um different blockchains and different VMS out there um we want to you know evm is the first one that we're building for but we want to make sure that when we build for it um it's not that we have to have a lot of bridging or um special features a special support marked out just for the evm so that it becomes a general purpose hypervisor and when other VMS are coming on it makes it much easier to accommodate and integrate them into the fvm ecosystem um we talk about familiar tooling so you know the I think right as of right now um you'll see when I want to share a little bit about it later and in the tutorials that you'll see you can use metamask you can use hard hat um we're testing for a few other Frameworks like Foundry and so on um the reason why this can happen is that we are um we actually have to we actually point the evm to link to the Lotus node um via the ethereum Json RPC API so that allows you to use the tooling that you're familiar with and deploy pretty much seamlessly to the fbm itself um and then I'm better addressing was something that we talked a little bit about earlier but let me get into it because I think it's something that um not sure if other blockchains have this today um but something that was was um started like built by our engineering team and it's it's a really interesting concept um it's a concept of a new class of effort dressing um basically taking the evm addressing and embedding it within the fbm addressing so right now there are existing but prior to this there are existing F0 to F3 address classes for building actors users and miners um the F4 address class is for foreign runtime addresses like evm itself it is intended to keep account addressing consistent to have them all operate in the same network and so F4 addressing is enabled by an address management actor so we've actually written one of the built-in actors itself to to deal with this you can deploy your evm with an ethereum address into fbm and then it gets encrypted and converted into a consistent address on the Falcon Network and so the Falcon network will then be able to recognize it and then it allows it to compute overstate and you on your side continue to access your account via the ethereum address um we're also building out support for blog explorers that will be able to pass this so that when you see you technically wouldn't see all the translation of addresses and the multiple addresses that you would get you would just focus on seeing looking at your EP room address itself so again adding to that seamless experience um yeah and so um again how it works is you can deploy your evm with an ethereum address into an fpm encrypt it it gets encrypted and converted into a consistent address um yeah and I think the way the the way that the equation looks I didn't actually put it into the slide but it's really interesting we have a whole GitHub written about it a good a whole GitHub fit written about it and I think it's really something that you should look into but it basically it's a compilation of the transaction address and then the ethereum address as well as a falcon address and then that makes up the FR address that is then recognized within the Falcon Network so yeah when I when I learned about the concept I was like that's really cool so something to look into um okay abstraction so iconic fraction basically allows a user program actor to be at the top level entry point um that initiates a transaction in psvs it allows the user to use Smart contracts while smart contract wallets containing arbitrary verification logic instead of externally owned accounts as their primary account and so what that means for you is that a transaction can start from a smart contract and not only an externally owned account which is much faster and much easier from the user's point of view um account of Attraction itself decouples the ownership of assets which is the wallet from the authority to transfer them into like a wallet specific via wallet specific policy you can then submit that your ethereum transaction exposing The Ether images on RPC API on Lotus and then it makes a falcon transaction and then you have an ethereum account on chain it validates the signature and then your native ethereum transaction works so that's how like this this all the thinking that has been built on the back end but then what if that means for you is that you're just you're just working on your negativity theorem transaction and it works within the falcoin network yep and then on uh custom account types um so this one will basically allow the Falcon chain to include ethereum transactions we talked a little bit about that as well um and then I didn't add this in but in just I think a day or two days ago we had ethereum event system now um within we've created a new fvm event system to accommodate for ethereum Event Systems um so events and lots now now works within your evm fevm deployment yeah um this is pretty Bare Bones because we've just created it um a lot more optimization will happen and more under the hood so you won't really see it um it's not so it can write events but it's not too much indexed yet um and yeah we're still working on tracking the active and so on okay so I'll talk a little bit about tools that we have available um so this is wallaby you'll see in the quick start resources um this is very much where you're all going to be building your projects on the wallabies operating Edge testnet it will not be Leading Edge for the period of this hackathon so don't worry about it um yeah it will stay consistent your code will not disappear it is for the ethereum Json RPC compatible um again not reset on a weekly basis and we have maintainers that uh will be around so um that is the wallaby bleeding edge test net um it's pretty we have Quick Start guides on how you can get your wallet connected and I'll show you a quick demo or a short video GIF on how you can do that through chain lists just in one click later on yep so as you can see over here um you can just go to chain list it's it's really easy it's one click make sure you turn on test Nets look for the wallaby test net at the metamask it should pop up if you click at yeah you can see the steps here but if you click add wallet and your main wallet is for example a coinbase wallet or something else it should pop up as well so once you've connected it you can then go to the wallaby faucet and get your funds it should take a minute or two for you to get some of the t-fill then you can start building your project on it um Falcon metamask um this is to show you the capabilities that are now enabled today so this is something that we've tested multiple times it works really well we're still doing testing with various other wallets um if you have a wallet of your preference that you're using and you let's say you hit a snack and you want to let us know um definitely put it in this card we'll see how we can work on that but yeah we've tested it with wallet connect Ledger metamask and these are fuel wallets that I think are good to go um so yeah open to any feedback there but for metamask itself you know you can really do value transfers you can deploy erc20 token and you can do contract calls and these are all the things all the capabilities that are available today with Minima so it's pretty much seamless at this point um and yeah for wallets um and then remix ID I'm sure all of you are familiar with this this works really well um as well um as you can see we've we've tried it out with a few template contracts we have early Builders also testing it out and it seems to work so far um so yeah I think pretty good on remix as well so another another tool that you know you should all really be familiar with to be to be able to build a project on really quickly and deploy to the fvm um for the hard hat itself um if heart has something that you use this is a very popular tool for development um again we have hard hat starter kits that are actually ready today um you can see in the link below but it's also included within your quick style resources so you should be able to go in and build your project via hard hat as well if that's your preference the other framework that we're trying right now is Foundry so looking for feedback on that it's worked for a few users we haven't hit a snack um but yes that's something that we're looking on building out for as well so falcon.sol is a library that we're looking to build um right now we're still prototyping and building out the library but for the hack itself we create the mock version so let me talk a little bit about falcon.solve first um what we're trying to build here is really um a library that makes it easier for you to access all The Primitives within the Falcon network via fvm and we want to make it as easy as possible so it will look like an open Zeppelin type kind of utilities that you can then access so be something that you're familiar with and um so for the hack itself what I mean by the falcon.mog.sol you will also get links to this within the quick start resource we have built a few more built-in actor apis for you to play around with um to build your project with and these are the two main ones around the market actor and the minor actor you will see that within the QuickStart documentation we have documentation on how you can access these and use it as well as the functional the features that have been enabled and the features that have not yet although those that have not yet are typically not so much used within the the scenarios that most people will be building on but if there's anything that you really really need again reach on Discord and let us know um so talking a little bit about block explorers um these are these are a few other blog explorers that have been built out we're also working in Partners to develop them further um so you have a filming uh film and Explorer glyphs on decks these are the different ways that you can use again these are in the quick start guides but if you want to check out your transactions and all your storage deals that you have built out of your projects you can always use these explorers um yeah they're pretty actually really easy to use there's also sonnext also has a product API that you can use to then um yeah to then query and find out information about your transactions um they'll be talking a little bit more about that tooling later on and also all these different explorers have docs for them as well so you can understand how to use them better and talk a little bit about evolving wallabies or things you can look forward to um really soon is that um so I said evolving wallaby because wallaby is like a young kangaroo I think um we've played around many names the name is not decided obviously it's not going to be kangaroo um but we'll have a much more stable test net um around that is not beating Edge and reset every single week um I think what what we're thinking of some activities to come on top of this things like build-a-thons hackathons um acceleration programs things to support Builders to actually build out a lot of these projects it will roughly run between early early December and to mainnet launch in February 2023 so if you're starting on this hike today and you think that your project is something that can go further um look forward to this we're going to have a lot of programs coming out here and a lot more resources to support your project all the way into main launch so the moment it launches you can immediately deploy your project onto it and I wanted to do a quick shout out to other quick start resources that you should not snooze on um we have the team has prepared a few cookbooks and idea forums for you um so if you're looking for ideas around data dials lending pools um what the specific bounties are for as well you can check out these um these links on the quick start that will bring you to discussions around how you can think about designing your projects built on top of it adapt it use it up to you we also have two cookbooks that we built out one for landing pools and one for data dials um it's not just a forum article it actually links up to GitHub and then you can use use it as a guide to then build your project during the weekend and of course again always looking for feedback on all these cookbooks and yeah um lastly again sharing the fem Foundry early Builders program um I know some of you here might be in the early Builders program itself I run it on a weekly basis so you'll see me every single week um but I promise it'll be fun um but yeah what we talk about mostly is like technical support for the project You're Building um resources updates we do work really closely with our Builders um in a two-way relationship so they do a lot of testing as well for us and gives us feedback on what we should be focusing on and what we should be building the fvm out for the Fe VM out for um so if you want to have a scene how it's built out sign up for the early Builders we're looking for developers who are um solidity devs um ready to build and yeah being able to build together with them or to create content out of it as well so yeah um that's mostly it for me I know it's a mouthful um I hope it was useful and we'll see you on the discard
Automatic transcript — names and jargon may be misspelled.