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

Loading player…

Consensus Lab 🛠️ Introducing InterPlanetary Consensus (IPC) - Jorge Soares, Alfonso de la Rocha

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Jorge Soares and Alfonso de la Rocha for a workshop titled "Introducing InterPlanetary Consensus (IPC)". 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 consensus lab Workshop introducing interplanetary consensus IPC joining us today is Alfonso de la Rocha who will be taking us through the session and with that I'll pass it up to Alfonso to get the session started thank you much Maria thank you for having me here so today hopefully I will do a high level overview of IPC so that you get a sense of what is this framework how you can use it and finally I will do a quick demo uh where I will deploy a smart contract in one subnet something that I have running but in any case I will point to all of the instructions and the getting started guides docs and so on so that you can uh Tinker with it your own okay so I I don't know if we all agree but I guess that everyone is aware of how consensus algorithms in blockchains um are a bottleneck so if we want massive adoption in web 3 being blocked in one of the key models of web 3 we really need to scale um the consensus algorithm of our blockchain networks and if we see that what the two most used um networks which are Bitcoin and ethereum there we see that the throughput is around the the thousand of transactions per second and in order to to scale them um different Layer Two Solutions are coming into these ecosystems but if we look at more like next Generation we can call it like that uh blockchain Technologies we see that all of the technologies that try to scale vertically uh they are limited by the validator aspect so in the end we are the the consist algorithm we are limited the throughput is limited by the specifications of the validators that are running that concept so we see that we can have a whatever transaction hold but in the end like the the sequentializing uh stage of the consensus is limiting the amount of of throughput that we can get in our blockchain Networks after these realizations with IPC what we are trying to do is to horizontally scale blockchain so seeing that we have this limit of vertical um scaling where there's a maximum transaction throughput that we can get at a consensus layer we with IPC what we want to propose is a framework that allows us to horizontally scale the same way that we personally scale right now in Cloud infrastructure and these are the kind of targets like when we were designing an IPC and like as we deploy as we are deploying and we're developing IPC these are the kind of targets and the kind of features that we are that we are targeting as goals first of all like as I've said if we really want a massive adoption of web3 we should be able to uh tackle and to adopt uh with our substrate with our infrastructure web to scale throughput and this is not the case right now um I mean there are some attempts to deploy social networks to deploy other high throughput applications but so far um the moment we go through the blockchain uh we have a scalability limit there but then there are other interesting features that currently we don't see in blockchains and that by horizontally scaling we could achieve like for instance secure Global finality fast optimistic local finality which means that depending on our use case we may want a really fast local finality and like then slower and more secure um finality in in other levels according to the use case and right now we don't have a way of fine-tuning the substrate on fine-tuning the consistency and the finality of our blockchain Network in order to fit the needs of our application blockchains generally they are not partition tolerance so if we are running a use case on a blockchain and part of our Network or the network where we're interacting with loses connections with the rest of the network so there's a partition in the blockchain network there's no way to make progress uh make the use case like our application to run and uh potentially like keep catch up in the future so the idea is that with IPC we're gonna build subnets that are will that will be partition torrent so we're building an isolated um instance of a network where we can run our application and we will be able to interact with the rest of the networks in this ecosystem meaning that even if our for some reason our network is running locally and loses connection to the rest of the hierarchy we would still be able to operate locally and eventually settle our changes to the rest of the network and finally like what I was mentioning it would be great if we can have horizontal scalability the same way that we have it in Cloud infrastructure these days and it would be great if this can be demand demand based so instead of like the protocol enforcing like in sharding or any other um horizontal horizontal scaling proposals out there where partitioning is explicit unlike the storage is partition explicitly it would be great if users could play with the substrate play with the infrastructure to fine-tune it to their there it is and this is basically what we're aiming with with IPC so in IPC in the end what we have is an on-demand horizontal scalability framework in order to horizontally scale initially five by so obvious easily we are focusing on filecoin initially but like the design is General enough to allow us in the future to Port the solution to other networks and how IPC works is in the following way like we start from the Falcon mainnet and um whenever a user sees that for for some reason like for instance in Pokemon we have 30 second block times and for their use case this is not good enough they will be able to deploy a new subnet so deploy a new network instance that has still uh by Design connectivity so so by Design interoperability so the ability to interact uh with the Falcon magnet in from this isolated Network that it spawns and uh it will also anchor its security to that of the upper layers of the hearing so in this way whenever a user needs and I'm going to show a figure in a minute to to illustrate this but whenever a user deploys a new instantiation of a network it will um in a new layer it will still be able to interact with the rest of the network and Anchorage security to upper layer um upper layers of the hierarchy that potentially will be more secure than than the the subnet and right now these subnets they they run a PFT consensus so it's a BFD based consensus kind of a BFD with weighted consensus where where there's like the voting power is weighted by the by the stake and the collateral that a validator has in in a subnet and another interesting property that this sadness have is that they enforce so IPC enforces a firewall property which means that whatever happens in the subnet so if something wrong goes in in us in a subnet because there's an attack because there's a misconfiguration or whatever the impact that this has over the upper layers on the rest of the networks in the hierarchy it is limited as I said like initially the subnets they all run a single consensus that is a brt like consensus but in the future we're trying to make this as modular as and as as configurable as possible to enable other kind of consensus algorithms and how is this implemented like in the end all of the operations and the logic of of IPC are um are implemented through a set of on-chain a VM scdm contracts in each of these networks that we run so in the Falcon magnet and from there to in the different subnets so to illustrate a bit how IPC Works let's imagine that here in the root where this is our Falcon mainnet we have a 30 second block times we deploy our super cool D5 application and it doesn't have the kind of of um like finality or the features that we need users will be able from The Faculty magnet with IPC to deploy their own subnets in this way so they will be able to spawn in a new level and each of these subnets they are independent networks in in itself and they are all running so validating transactions in parallel subnet will be running this PFT like consensus they each will have their own State and they will be they will be able to run independently with the caveat that through IPC these each of these networks they will still be able to interact with other subnets in the hierarchy so root t01 will be able to interact with root t02 and also um we have a periodic checkpointing from subnets to the upper layers of the hierarchy so that we can keep some pieces of the state of the Subnet in the upper layers in case something goes wrong so that we can build fur proofs or we can build any other um kind of of security enforcement and protocol so the idea is that we right now the the ux as you'll see in a moment it's a bit rough but the idea is that we want to expose all these interfaces to the users so that they can fine tune the the substrate to their own needs and this is recursive so meaning that the same way that from Falcon mainnet you a set of users uh were able to deploy their own subnet and start operating over there and interacting with the rest of the hierarchy if at some point we see that there's a subnet that it's reaching capacity or it doesn't have the kind of substrate uh of features that we need um they can also deploy a new level um of subnets from a child Sumner so we could have layer 3 and so on and in this way building a IPC builds a hierarchy recursive hierarchy of different subnets that interact with each other and like run the protocols um run the APC protocol and coming like going back uh moving into like more of the implementation of the protocol how does this look like uh from a system perspective so let's imagine that we have this root pad and these two child subnets what we have is a set of on-chain contracts um specifically and mainly the Gateway actor and the subnet actor the Gateway actor is the main like the common actor that all subnets have and that implement the core logic of IPC and then the subnet actor which is a user defined actor that subnet operators uh can deploy uh in order like with the specification of all the policy for their subnets so the collateral the kind of requirements in order to join as a validator in the subnet so all the the policies that you can think of and that you want to implement in your subnet this subnet actor right now we have a reference implementation but in the future like we're looking into all users to come up with their own Southern actors they play this on their own certain actors and in this way have an ecosystem of subnet operators and subnet um Developers so we have these actors that are all around um like in the different subnets and that implemented the on-chained logic for the protocol and then we have the APC agent which in the end like we can think of this as the um as an orchestrator so a process that we run locally in order to interact so it abstracts from all of the interactions that need to be done uh for IPC with the different networks and finally we have the last piece of the puzzle which is um the peer implementation for the subnets so in the end we have like these subnets what they're running is the same exact um at this point it's running the same exact stack as the Falco Network because what we have like subnets they run uh modified a fork of lotus that we call eudico that has been modified to run a different consensus algorithm and this consensus algorithm is the high throughput DST protocol that I've been talking about that is sorry that that it's called The Mirror transfer um consensus algorithm um so yeah and the IPC agents in the end like it's your entry point for IPC so in the end like if you want to to run an application that interacts with FICO and mainnet for some storage stuff then you have some application in in a layer 2 subnet and then a layer 3 subnet and do you want your application to be able to interact with all of these subnets usually you don't interact with each of these subnets individually especially when you want to do IPC specific features but you use the IPC agent which is the same instance and interacts with all of these networks and it's abstract for you all of the low level interactions that need to be done IPC wise in order for your application to be able to to use IPC and finally like to wrap up these these high level overview um okay IPC is really cool but I don't know when to use it here I I share a few questions that you can ask yourself to see if IPC fits your use case or not um like you can think of IPC ASA let's call it chip and and lightweight um way of deploying um a full blockchain stack so you whenever you have to agree and share information between different parties and you want to have fast consensus with flash finality it may be a good option um to deploy an IPC subnet uh if you are used to interacting with fevm smart contracts but the file domain that may not have the high throughput and faster finality that you need but you still want to be able to interact with storage that leaks in the program this may be a good case as I said like it is an easy way of deploying our full-fledged blockchain uh you have some features to interact with other blockchain like other subnets in the in the hierarchy but you don't need to to use it you just spawn your Lotus with some um with these flat screen sensors invite a bunch of validators and you will be able to run this blockchain with all of the rpcs and the semantics that you're used to from the Falcon ecosystem and the Falcon set and of course like if you have a uh an application that needs an incentive mechanism but you don't want to figure out like all of the blockchain all of the crypto token and so on it may be a good option and also for verifiable computation right now we have like the amount of features that we have of course it's uh limited but we're growing um in the number of features and like we want to be able to switch runtimes to configure the cast costs so in the future you will be able to do more stuff and configure and fine tune the substrate of this subnets to fit better the needs of your applications and moving to more practical matters um if you want to start like tinkering with IPC here I share a few and and I can share it at the end the slides so that you have um you can navigate all of these links but we have already a test net where you can interact with IPC and that runs the IPC protocol um this is called I mean this supplement is called spacenet and if you go to to fastest space and IPC space you will get the you will be able to get some some test icon for the space net Network all of the instructions of how to connect to spacenet and how to use spacenet can be found in these report and then if you want to learn more about IPC what is the mere transfer protocol what is mirror how IPC works and so on I highly recommend going into this ipc.space um link where hopefully you will have references to all the the basic knowledge that you need on the basic uh reference to start using IPC than for the technical implementation all of IPC runs on four different code bases so actually three different code bases but uh one is replicated because we initially like subnets right now run through a set of fvm contracts that are native actors so they are bundled with the built-in actors this has um historical reasons but yeah like the reference implementation is written in Rust and it's bundled in uh in the built-in actors when you deploy a subnet but we're working on a on a set of ips of on an implementation of the IPC contracts for solidity so that they can be deployed in calibration net in the even the Falcon mainnet and so in that way we are able to deploy subnets from from these networks and finally the other two so that's why I said that there are three main code bases this could be one like the on-chain logic implemented through a solidity contracts and a set of native actors and then we have um aod which is our Fork of lotus with the modified consensus and other IPC related features and the IPC agent which is the central point and this abstraction uh that you can run in order to orchestrate all of the low level interactions with the different subnets and what your application will potentially use to to interact with IPC finally like before I move into the demo um there's uh so if you want to know more about consensus lab and what we're doing so IPC is one of the projects that we're doing but we're also like figuring out ways of scaling uh five coin through the consensus library and so on I leave you here A bunch of uh links if you want to learn more about what our team does and finally like if you have questions if you have like even suggestions bug fixes like whatever you wanna if you want to interact with the team uh these are religions like and in the five cons like and these have some of the interesting uh channels where you can interact with us the consensus for more of uh General consensus algorithm related or scalability related topics the IPC specific channels and finally the spacenet uh specific channel for when for those of you that are interacting with space net and you have questions box suggestions any other thing that may come up uh and yeah and like what I would recommend there's a lot of information here and it may be hard to grasp initially but my recommendation would be to initially just uh go to the ipc.space um website that I mentioned and then um reading a bit the this IPC agent um the ipch and documentation the in the APC agent repo that I just shared and the spacenet uh like skimming through the space net replay would give you a sense of what is the state of the technology and how you can start uh attracting using IPC and building application on top of the spacenet and IPC testing and finally let's start with the demo so what I'm gonna do for this demo I already deployed the summit I'm going to show you briefly how to deploy a subnet but whatever works so I'm going to show you how to deploy a contract in a subnet and it's not as exciting as it sounds because in the end the fact that we're using Lotus means that everything that you see in the file conducts and that's why I link it here regarding smart contracts um not storage specific features but all of the like smart contracts interaction with sevm all those um the CLI commands and RPC endpoints that we have learned to love all of them are exposed for subnets because we are affordable photos so in the end anything that you want to do in a subnet ideally should start should work from scratch so you just have to follow the Falcon dots just that the subs like the blockchain step that you're interacting with is different I mentioned this because if you see that there's something that is not supported or you follow the Falcon dots and something fails come to the pipeline slack start ranting about it so that we are aware that this is the case and with this I'm gonna start sharing briefly my terminal to show you something and then I'm gonna come back to my browser all right so I guess that I mean I hope everyone can see now my my terminal right now what I'm showing is in the just to show you how what is the subnet running so in the top um screen you can see my IPC agent um connected to a different subnets that I'm running and then in the bottom screen you see uh one of my subnets running at just showing you how it's generating blocks every second because we're running these these first consensus so I'm going to show you briefly like the IPC agent um CLI to show you some of the of the commands that we support so you see that you can run the demon there's a bunch of subnet specific operations config operations wallet cross messages checkpoints so there are a bunch of operations there's that allow you to interact with uh and and use APC through the through the sublets and the most interesting ones of course are the ABC 18 subnet that gives us like all of the things that we can do related to sublets right now you can see here in in subnet list um that I'm running just one subnet that is this root t01002 that with is running with a collateral of two file client and that it has this 192 circulating Supply inside so this is the amount of Falcon that has gone from the root net so from uh space net to uh from spacenet rootnet to the subnet so that it can be used there um if we want to deploy a subnet it's quite straightforward so the the steps are the following first we deploy our subnet actors that is going to govern the is going to govern the policies for our subnet that this lives in the pan so if we let's do this subnet create so I'm saying I'm going to create a subnet um with uh from the root I put some random name and I'd say the minimum number of validators the checkpointing period and so on like potentially once you read the documentation all of this uh this we don't have a lot of time all of these flags will make sense but what we do with this is that we deploy something actor that is going to be the one that governs uh the policy alerts on this so we see that here we created something like that with ID t01003 if we list the subnets now um we see that the subnet the new subnet is not there yet because no one has joined um and now we're gonna join the subnet so that we register and we can start well so I'm enjoying oh so I'm joining the wrong one uh so I was joining this one I want to join the three we should see threshold so that you see a different number and then again like the flags will make sense once you read the documentation and you see that with this we were able to deploy a new subnet and with three fibers of cloud of Circle of collateral and no circulating Supply because there has no there has no big there hasn't been any kind of interaction with that subnet yet and from here you will be able to deploy like your validator deploy your subnet and start running this independent Network that I was mentioning um with this like this is just to give you uh a brief overview of the end to end of operating a subnet and now I'm going to move into the running and subnet like being a user of a subnet side of things and for this I'm gonna do this subnet uh RPC I'm gonna so to interact to make easy the fetching all of the data to interact with um with a subnet we have this command line that gives us the if we are running like now I'm running the the um the aps the IPC agent is interacting locally with the nodes that are running the subnet but uh you could be running the Subnet in some remote endpoint and with this uh command that where we're getting all of the information that we need in order to connect to this Summit because um the subnet ID the chain ID will change according to the subnet ID and then like um we may be interacting with subnet either to gleef or through other endpoints that is not necessarily our local peer in our case it's the local peer but that way we don't have to even remember how to connect and how to interact with the sublet so this is a the the end point of the of the peer running the subnet and the 10 ID and now what I'm gonna do is configure my metamask and deploy a evm smart contract over this subnet to show you that the interaction is exactly the same but it goes way faster due to the consensus algorithm that that we have so I'm gonna change again my what I'm sharing here so I'm just copying um yeah here I I'm just connected to my my IPC red net and what we're gonna do is at uh in metamask the network the new network stacks the subnet that we want to interact with this is a chain ID uh we hopefully I know it by heart if not I will have to look at the I will actually look through something else so sorry about that again you'll see it slightly yeah yeah we copy here our IPC address uh the symbol is stick file like you all of the instructions again I'm doing those instructions that you can find in the fileco index to show you how you can interact with the subnet using the same kind of tools that you're already using to interact with any of the test Nets that run at vvm or click on magnet so now we switch to root t01002 in this case you see that I already have some Falcon there because I was doing some testing but like we could um I'm gonna send a bit yeah actually you don't see my terminal so that makes no sense and we have three minutes almost in the top of the hour so I'm just gonna show you how to deploy a subnet like you see that metamask is integrated directly to the child subnet and we're able to deploy a contract with remix or any other of any of the of the tools you're used to and uh you'll see that this is gonna be really fast because the fact that we have one second block times makes it really fast to to interact with these child subnets so we're gonna compile this simple stress sorry contract and let's get the injected provider and now if we deploy it I mean you don't see the prompt from metamask asking for to take for the transaction that's in the transaction but you'll see that it should appear here almost immediately the deployment of the contract um yeah so I hope like this has been useful I don't know if there are questions sorry um I would have loved to get a full hour to explain you all of the nitty-gritty details of IPC but uh happy to to answer any questions serious or help you with anything thank you very much yeah if you have any questions please feel free to type them in the chat or take yourself off mute and ask Alfonso currently there are no questions in the uh in the chat but foreign one then please don't hesitate to reach out to buy a Discord or the partner channels or uh any other uh method and check out the um I mean the partner prices and the partner pages on the hiker dashboard as well but yeah if there are no questions um oh make ask what is this useful for again so if you face some kind of congestion or limitation in the in this case Parkland but eventually other blockchains where for instance you have 30 second block times and uh it goes too slow it is a good way of deploying any instance of uh subnet and getting the kind of throughput that you need for your application so it's a way of scaling uh as a proposal to scale or simply uh blocks in frame like boxing metals thank you and yeah if there are no other questions uh thank you Alfonso for the presentation today and thank you all the participants for attending and we have a few more workshops there today and yeah if you have any questions please don't hesitate to reach out to the partners on the Discord channels so thank you everybody have a good rest of the day thank you cheers

Automatic transcript — names and jargon may be misspelled.