Perspectives on the Portal Network and P2P
EDCON 2023 · 21 May 2023 · 20:10
Vitalik Buterin and Ethereum Foundation researcher Piper Merriam discuss the Portal Network and peer-to-peer access to Ethereum. They consider how lightweight devices such as phones, laptops and Raspberry Pis could interact with the network without depending on a centralized intermediary.
Speakers
Topics
From EDCON 2023, hosted by EDCON.
Transcript
maybe um so Piper you're um to start off how about you uh you know introduce yourself what are you um you know what do you what do you do for ethereum are you even in ethereum maybe you're in Solana you know what have you what have you been up to recently uh some of you guys just heard me talk uh let's see um I've been around for quite a while um I got lucky and was in a spot right when the network launched built a bunch of stuff uh went and worked for consensus when the EF had no money took some of theirs for a while and then switched over to the AF when the EF did have money and I was pretty sure consensus would make me do business
things at some point um have really this is the most amazing career um I could have imagined for myself and I couldn't have imagined it [Music] um there's like a trilemma of like Get Paid decent do something you like and do something that matters and I get to do all three it's pretty neat um I've worked my way as deep into the protocol as I could find and found my Niche I really have enjoyed learning about centralization and peer-to-peer networking and cryptography and all of that stuff from an engineering perspective I mean Piper also has the honor that he killed part
of my job I used to maintain pi ethereum and then he wrote Pi evm which is better I I uh I'm really worried that I'd step on some toes there and I'm glad vitalik has small toes you've also been doing this thing called the portal Network right so uh you know I think we'd love to know you know what is the portal Network like what what is the vision here um some of you just heard me talk about it a bunch but the aim here is actually delivery of lightweight protocol access the ability for lightweight devices laptops Raspberry Pi's phones things like that to interact
with the ethereum network in a first class way that doesn't require a central intermediary so like if the portable Network worked well my metamask wallet or Brave wallet would be able to access ethereum and do ethereum things without having to trust in fira would that be correct yeah that's the theory um the goal is really really lightweight clients in theory you could have two or three of them running on your machine at any given time embedded in a wallet that you use or as a system Daemon or something like that that metamask connects to and yes being able to get at whatever data in the ethereum network
and protocol you want from that kind of lightweight device okay so I uh the one light clients thing that I know exists right is like there's Helios from a16z and there's some similar things we are basically they sit on your computer and my understanding is that you kind of RPC over to them as a local host and they actually verify ethereum block headers using sync committees and then they actually yeah like and then they actually verify Merkel briefs right so what what's the difference between what we have with things like that and what what an ideal portal Network would offer um am I getting Helios right that it's
still sourcing data from centralized providers but it's just doing it in a provable way yes um I think that they serve similar use cases something like Helios is going to be more performant from the get-go because you're still pulling data from centralized sources and just verifying it um I think that those are really nice Solutions I wish that had been what we built kind of the RPC like Json RBC API with to begin with you know it's one thing that if we could use our time machine and go back and change some of the things we did that might be one of the good ones um but it still depends on centralized sources and those centralized sources
can still do things like correlate IP addresses to to your chain activity and things like that um I think there's lots of use cases where that's just totally okay but for that to be the best option we have and for there not to be an option that is decentralized in some ways more privacy preserving because of that um we supposedly care a lot about decentralization so what are the concerns with centralization you're seeing like is it privacy are there other risks here uh privacy there's some fragility issues right like what happens when Alchemy goes down or inferior goes down right
how many applications stop working how many wallets have to run their own infrastructure or how nice would it be to be able to decouple the wallet from the infrastructure and to not you know need to have those two things be so tightly coupled um I mean it centers around that stuff it's not an absolute hard requirement there are plenty of use cases where a centralized source is okay I just think that we want need should have um decentralized Alternatives as well yeah well maybe just to get it get a bit into like what portal does and how it works right so let's say yeah I am a user and
I'm using adap and the first thing that my dap wants is to like let's say query my current balance right so if this is all done through portal like what happens what the sport will do um so let's say that you're opening your laptop up and it's been offline for a while um so the first thing it's going to do is bootstrap into the network um probably with a hard-coded list of of of nodes that it knows to trust that are shipped with the client it learns about the topology of the DHT pretty quickly DHT is a really neat peer-to-peer networks that have kind of this concept of topology or shape um as soon as it's bootstrapped into there it's going to use the Beacon Light protocol to jump uh straight to the
front of the chain as fast as it can pulling a little bit of data to figure out what the latest block header is um at that point it has anchors to what the state routes are and at that point it reaches into the state Network to pull out your erc20 token balance out of the state from whichever node in the network is essentially tasked with storing that yeah so this sustained Network so who is tasked with storing things so we take all of the state and we essentially map it onto the address space of the DHT and so you can kind of um
I can imagine I don't know if you can imagine it's really hard for me to figure out what other people see and don't because I've been in this stuff for so long but nonetheless you take that 250 gigs of ethereum State data and you map it onto that address space any of the nodes that are close to where that piece of data ends up getting mapped are likely to be storing it and the DHT has these really nice mechanisms for traversing to that spot in the network finding the nodes that are there and then you can ask them for it and essentially it's not one node that has it but it's any conglomeration of them that are nearby right okay so this is uh basically one
of those things where like if I joined the portal Network as a node then like I would be tasked with like taking some slice of uh the state and uh holding it and maintaining it yeah and and I and I wanted it's a subtle distinction but tasked versus implicit responsibility okay nobody it's a it's a everything in portal and kind of the DHT mechanics that we've built is is emergent Behavior rather than um assigned Behavior there's a bunch of rules and everybody just follows them and the emergent thing is that nodes that are close to where where a piece of data is mapped to end up storing that
data right I see it so and then when you say are close that says like based on the address that I get like randomly assigned some kind of a hash when I join the thing yeah I've been playing around with how to talk to people about this because there's a there's layers and layers um but one way to think about it is if you were trying to find a random Starbucks in the other side of the world and you didn't have Google Maps and all you had was your network of people that you knew you would probably look through your address book and figure out the person that you knew who was the closest who lived closest to France and you call them up and you say hey I'm looking for
a Starbucks in Paris and they go well I don't live in Paris but I know somebody who does and they give you their phone number and then you call them and they're like yeah I don't live in that neighborhood but I know somebody who does you call them and each step you get closer and each step you get quite a bit closer right because if we if we do this kind of seven degrees of Kevin Bacon thing we can get to Kevin Bacon pretty fast which means we can get to that Starbucks pretty fast it's roughly how it works is is this sort of incremental look up through through all the nodes storing a little bit of information about what's far away and a lot of information about what's close by you have a very small amount of information about places that are far
away from your home and you know pretty much everything that's on the Block where you live who do you expect would be running these nodes my hope if we want to go like pie in the sky end game is that every execution client ends up running one of these nodes I think that it's going to be a better sync strategy and a and a way for execution clients to lighten what they do without sacrificing anything in terms of security I also see them being embedded things so when you download that Wallet app that you use there are probably going to be some versions that still sit on
centralized infrastructure and call out to Alchemy or whatever but my hope is that some of them embed portal network portal clients in them and use that for for for grabbing data if we're going kind of pie in the sky it'd be really cool to see iPads at proof of a point of sale not proof of sale point of sale that are able to do crypto payments without going through any Central um uh intermediary and who are able to actually just take payments right there and run the client on the iPad um
I like that all right we have like 10 000 nodes in the dev P2P eth Network and this is a thing where I think that we could easily see in the hundreds of thousands or millions of nodes assuming certain versions of success over the coming years lightweight nodes that give you access to the ethereum data like there's a lot you can do with that absolutely so you mentioned uh privacy before as like one of the reasons to not do everything through inferior or whatever other like single provider peer-to-peer networks might sometimes have like an even harder time guaranteeing privacy right because someone who wants to infringe on privacy
they can just like insert themselves into the middle of a network in a bunch of ways so how do you fight against that we don't directly is one of the things um but I think that there's two models of of privacy to think about here one is targeting and the other is like Dragnet um right Alchemy has access to correlate every single RPC request with an IP address right they can they can do that on every single request that comes in it's a bit more difficult to do it in our networks and it's definitely a bit more difficult to do it in a targeted way towards a specific node um it doesn't say that there aren't ways that you could
eat away at or infringe privacy in the current designs of our network but I will say that the current designs of our Network are very much aimed at a absolute minimal what do we need to be useful and to be able to start iterating from there what do you think is the functionality that'll be available first uh it's available today you can go fetch arbitrary history from our Network blocks receipts bodies that sort of thing up next is the ability to follow the beacon chain using only portal protocols mm-hmm well congratulations it's a lot of progress already um do you intend us to be just for like
clients or do you also see other kinds of ethereum nodes also using this I'm trying to encourage my team to build towards um what is essentially kind of r d space in execution client land um I think that there are major improvements to execution clients ux and functionality that could be realized using portal protocols one of them is statesync the state is evenly spread over all of the nodes in our Network which effectively means that if you wanted to sync a full copy of the state out of our Network you could pull at whatever level of parallel parallelization and concurrency
from all of those nodes as much as you can handle um you know drinking from that fire hose in the existing Dev P2P Network you're limited to how fast a single full node can throw data at you and how many of them you can get to throw data at you you have a much larger peer set that's able to in theory throw this stuff at you concurrently um so I think just as one specific example statesync is something that we might be able to do faster so maybe yes going a bit uh beyond the portal Network for a bid right like a lot of these things touch on group like
greater themes of the ethereum peer-to-peer Network and uh you know the stability of the protocol in general um so what do you what do ucos being the greatest uh challenge in making sure that those parts of the ethereum infrastructure will be able to withstands the pressure that will enable inevitably put on them over the next 10 or 20 years so my hope is that there's a really nice Synergy between the existing Dev P2P eth protocol that execution clients use today and the portal protocols that we're building there are things that Dev P2P eth does incredibly well and I don't want to get rid of those I just want
there to be some other options and Dev P2P eth has been battle tested for many years and has those many years of battle testing kind of security confidence under its belt it'll be a long time before the portal protocols even get to come close to that and they are known dhts themselves are known to be attackable in certain ways that are more difficult to attack to FP to PE so in terms of like the most critical core infrastructure I think Dev P2P still has a large role to play um I think portal can augment that in some significant ways to improve things like sync times and general client ux
while execution clients can still hold that um High degree of security and confidence of the devpdp eth network mm-hmm no that makes sense um so you mentioned the tax are you worried at all about attacks on Portal uh no but I'm kind of excited about them okay because it means that we're doing something that's worth attacking and that's great um uh who here has built something worth attacking I mean like it's fun right who here has built something that's been attacked who here had fun defending against the attack
um yeah it like we could be in the orange I've thought about this a lot and and I answer this question pretty similarly every time but um I I struggled with these questions about security and possible attacks and things and for a while I kind of tried to oh we'll deal with it this way ultimately the answer is it's okay if what we're building gets attacked we are not currently Mission critical infrastructure and um it getting attacked will be a really nice demonstration of which areas we need to look at and fix and address I guess people can connect to both portal and inferior for a while right
that makes sense um so what's the uh I mean what's the future for you guys like what's the team currently focusing on and like you know what are the things that are preoccupying developers Minds right now and what if things look further into the future I think I tell them every week to do it worse and do it faster because I believe that's the the fastest routes or the best route to us building the thing that needs to get built um we turned a corner in the last three months there's there had been a lot of of kind of building software into the void without knowing if it was working or doing what it was supposed to be
doing and things like that um and then in the last three months or so we turned a corner from I think they're doing I think it's working I think it's doing what it's supposed to do we've built a lot of monitoring and infrastructure and kind of this other stuff to be able to look into it and see what's going on and that closed the development Loop cycle and made things start going a lot faster hence the delivery of History Network functionality and I am really excited to have all of the you know this is a project that I I kind of came into it with this like I've looked at this I've learned about it I've studied it and I think I have a solution and it's
big and I wrote it all down and looked it's really big I'm sorry um and then I had to help get all of these new developers up to speed on all of that past work and past knowledge that's what last year was and what I'm really excited about is having a group of peers now that I can work with on this stuff that understand it at a at a lower deeper level and who are kind of there with me working on these problems um I think that's the thing I'm most excited about that's amazing thank you so much Piper welcome thanks vitality [Applause]