Mathias 00:00:00.000 Peer to peer reminds me a lot of that kind like discussion where today people will say, why does it matter that you authenticate where the data comes from and that you can authenticate it at rest And I feel like in 20 years we're gonna be like, why did we not always do that? 'cause it's just. Even though it takes a bit more compute, it opens up a bunch of interesting security avenues and also just distribution avenues.
Darin 00:01:23.743 In this world, we've been used to putting applications on servers and running them. I mean, heck, Viktor. How would you even run Kubernetes without servers?
Viktor 00:01:33.372 I mean, depends what you mean by service on how would they run Kubernetes on thin air? I cannot. I need to run it on something.
Darin 00:01:43.223 need to run it on something. Well, today we have Mattias Bus, Matson Mattias Bus, Mattias. How you doing?
Mathias 00:01:50.153 I am good. How are you?
Darin 00:01:51.503 Good, Does this conversation make any sense? Can you run applications without servers?
Mathias 00:01:56.470 yeah, of course. Uh, we obviously need some sort of computing device. I'll concede that one immediately,
Viktor 00:02:02.395 a server
Mathias 00:02:04.300 well, it depends on, my personal litmus test is like, what would my parents call it? And they would definitely say something in a data center is different than the device they're using. So I think it's like less about running things on servers and more about running things on end user devices, let's put it that way.
Darin 00:02:22.290 Hmm. Okay, so if you don't know who Matias is, we typically don't do bios, but this one, I'm gonna go ahead and throw in there. Uh, you've written over a thousand NPM modules. Uh, I'm so sorry that you've written a thousand NPM modules,
Mathias 00:02:38.123 It
Darin 00:02:39.017 and you've been doing peer-to-peer stuff. You're currently a co-founder of Bayer. You also created the pair runtime, which is, it's all about peer-to-peer. Now, to me, peer to peer was cool in 2000.
Viktor 00:02:53.367 It was cool because that's how we were watching all the movies back in the day and listening to all the music, right.
Darin 00:02:58.892 This was Napster, right? That's, that's where I'm going to is, is Napster. but since then, it's like, it's a, so what technology to me, am I wrong in that thinking?
Mathias 00:03:08.043 I think, the public perception and what you said from like a, a end user point of view is definitely peer-to-peer peaked around that time. I find it very interesting why it peaked around that time. It's basically because it was a time when we used technology to work around. A problem, for end users. The problem was lack of content available online and there was a big movement towards that, obviously with a bunch of legal implications for other people involved. that's a whole different discussion, but. It showed in that period of time the power of making software again, that that just runs at end. User devices can't be controlled by any like entity. And it also for me showed the power of, to some degree open source and like open technology in terms of just making simple stacks that users can run and kind of like turn into this like network of many, and. Solve a problem for the user, and do that with like so much force that it couldn't be stopped. I'll be the first one to totally concede your point. I think, you know, that's also like pop public perception that kind of peaked there. Maybe not two thousands, but like around that time. And it's also around that time I got personally started in, intense peer-to-peer work. I'm from a small country. I'm from Denmark, and uh, we definitely had a lack of content availability in a small, small market there. And that was like part of why these kind of things were very big in the Nordics. I think. I got involved on a technical level back then writing again, like I said, I wrote a ton of, ton of modules, but also writing just tons of software to work with. BitTorrent back then, which was my introduction to that. I'm a little bit too young. I'm not very young, but I'm a little bit too young for Napster. I'm just around the time when Napster died off and BitTorrent took over. I find Bitcoin a very interesting technology my whole career has been around. How can we take those components that proved so powerful for file distribution in the BitTorrent error and so unstoppable and everybody tried to stop it. I say this all the time, everybody and their mother who was in charge of anything, tried to stop it, including governments, including, you know, serious business. and they couldn't, the only thing that actually tapered off the man was other apps tried to appear to do more centralized approach to kind of like lu people back, like Netflix and stuff. Um. But how can we take that technology and those ideas and apply on a much broader scale than just file sharing, but like to disrupt any kind of application out there with like normal data flows, um, like chat, like social networks, from a technical point of view, and obviously allow users to build applications like that. that's basically my mission and my company's mission today.
Darin 00:05:40.554 So I'm trying to figure out, you said data flows. I'm gonna think a little bit higher. It's like a, a typical flow for me is user hits an end point with a browser, server processes, it does whatever hits the database, comes back through the server, gives it to me. I mean, what is, what is flow in a peer-to-peer? World because again, to me, and I, I almost started crying when you said you're too young to remember Napster. my daughter was already in her mid-teens by the time Napster was starting to die off. you know, I'm just trying to think. I mean, I get it right. I understand. And I really didn't use Napster a lot either. But the BitTorrent, when again, bringing up BitTorrent, 'cause I actually forgotten the phrasing. It makes a big deal for things that are, let's call it legal for the moment. It's a big deal for the illegal things too, but legal things, it can save a lot of cost. Perceived cost though, because it still costs somebody something. So anyway, let's talk about the flow first because it's like, I don't really understand, again, typical web, back to the back, back to me, if that makes sense. How does it work in peer to peer?
Mathias 00:06:51.895 Yeah. Um, you're bringing up a lot of good points. I gotta first say, I'm also not very young. I'm just a little bit older than Napster, so, uh, younger than Napster. So, so just before somebody thinks I'm a young hip guy, Yeah, it's a very good point. It is Kyle. I think it's like, there used to be a thinking and that's also, uh, it was very dominant when I, took it like in slightly formal education in computer science and things like that about data flows being point to point driven, meaning that data flows is something that, happens when you call an ip. You know, today we use host names, but like some sort of endpoint that points to something very specific and it's that specific entity that gives you the data, and that's how you work with the data. Peer to peer is all about saying. It doesn't matter who has the data as long as we can verify it. So it's a much more, to some degree, even though it's a very old idea, it's like a very modern take. about, doesn't matter where data is served from as long as we can authenticate it from our point of view, that it came from the right source originally. Anybody can help us host it and host piecemeals of it and stuff like that. And that's like the fundamental difference. And it sounds maybe like a small difference, but that's the, thing that makes. Everything different. And that's why in the PP network, like in BitTorrent, I can go to my worst enemy and I can have them serve me content or a bit torrent and they can try to trick me, but I can always verify on my end if that content is correct through a very, once you understand it's simple protocol of. like cryptography and stuff. And that's the big difference. and I think we've been, we've, we've been through a lot of cycles like this, especially in computer science. I remind myself often, um, when I started out doing serious computer science and that was around that time and that was before we had widespread encryption on the web. And 'cause the web, you know, as you say is, is much more based around this point to point communication. Obviously there's data centers and low balance will try to route, but at the end of the day it's point to point. When I started out in that, encryption on the connections was kind of saw thought of as a, let's see, kind of thing. 'cause it's gonna create a bunch of costs and infrastructure is not ready for it, and do we really need it? And you had to have all these trade offs about like, maybe this thing needs encryption, maybe this thing doesn't, to kind of like help run these things. And today, based on all. We know today, we're like, why would you ever, ever run anything unencrypted on the web, just in the current climate? And looking back at those decisions today, even though it's only like 15, 20 years ago, I, how many watches? I'm thinking like, wow, we didn't know anything. And then Peer to peer reminds me a lot of that kind like discussion where today people will say, why does it matter that you authenticate where the data comes from and that you can authenticate it at rest And I feel like in 20 years we're gonna be like, why did we not always do that? 'cause it's just. Even though it takes a bit more compute, it opens up a bunch of interesting security avenues and also just distribution avenues.
Darin 00:09:46.701 Well, in this context, it doesn't appear that people care about having more compute because with the AI craziness that's going on, it's like compute is going through the roof.
Mathias 00:09:57.632 well, some computers going through. I also, I mean, computer computers has always been going through the roof, right? It's kind of like the devices we have today. That's that, that comparison, you know, with how much power we needed to go to the moon compared to how much we have in a random smartwatch today, or even just rendering this podcast, I'm pure, we're magnitudes over, right? So. Compute has this nice way of scaling well, and obviously for ai there's different challenges and stuff. I think it's more about using the compute we have today to unlock these things. 'cause there's no reason why the compute we have today is not enough to run these P two P networks. And that's what we're trying to do and, and are doing with with our technology. So I don't think it's necessarily like we need to have more compute out there, it's just that we need to be a bit smarter. And that's kind of like what I meant with. Like the encryption analogy, like we have the technology available already. the upsides are insanely strong. The downsides is it's new and scary. and also obviously there's like with anything else like there was with the encryption push back then unknowns here and there, but like it's what we need to do.
Viktor 00:10:53.162 So am am am I wrong in saying that the whole premise of peer to peer, uh, lies in among others on, on an assumption that people are willing to share their compute for the common benefit in a way, right, including their own.
Mathias 00:11:10.357 I think that's in a very interesting phrasing and I think that's like, depends on how you look at it. I think at the core point of view, P two peer actually doesn't require that because peer-to-peer, like I said, it's just about sovereignty of data. It's about having systems where you can always prove that the data came from some source originally. Like it's verifiable on my end, not just like I trust that I got it by some server saying this is correct, or I can always, you know, run an audit on my end whether or not a user. And that network wants to share that data to other people. That's actually just like a side feature that obviously unlocks tons of possibilities and makes the network better. But you can easily build peer-to-peer systems where that, that's not a use case. because the peer-to-peer aspect just almost by your name, just says, there's no difference between me as a peer and you as a peer. So like the trust I need to put in you as a provider of data to me is the same as the trust, uh, I put in anybody else. so it's just a very, very powerful. Idea of around building these insanely trustworthy and like scalable applications and you can kind of like tweak the rest of the metrics I think.
Viktor 00:12:11.272 But if I'm a company and I build for my storage replications or whatever needs peer to peer, how is that different? And I'm saying now build it on my hardware, not your hardware. Right. How is that different from non peer to peer?
Mathias 00:12:29.019 it obviously, you know, depends on what you're building and stuff, but it basically just means that like, kinda like what I meant with encryption. Also, when I said earlier, there's no really thinking about it. Like the systems are inherently built this way to be defensive and like self verifiable and self-healing. So if you wanted to build a data distribution network just in your data center and guard that with some endpoint, which. I'm sure a lot of people wanna do today for various reasons. you would just make that with normal P to p primitives, there's tons of stuff for like data sensors you can do to build these kind of things yourself, you said Kubernetes earlier and Kubernetes does something of that sort also, I think for the distribution aspects. they tend to also fall down to like, I don't mean this in a bad way, but like a, a weak version of peer-to-peer where they probably don't do as many, consistency checks and like, Defensive things because they're like, you know, you're running in a, in a trusted environment, but peer-to-peer. For me, kinda like going back to that, the encryption discussion. Also, it's just this, fundamentally the superior version of that because it just gives you that defense in depth. even in a system like that, what if you have sensitive data in there and somebody breaches your firewall, which is how we normally defend these things, then you have much fewer options about defense in depth and the classic systems where peer-to-peer system is always. Trying to guard against everybody, right? So like it doesn't treat peers differently. The only thing you can kind of do in a peer-to-peer system to be nice is have, like you said, longer uptime on your notes or like share more data with your notes. And that's kind of like the model you would run inside a data center. I think honestly, like not even trying to be super biased. I think it's just a superior model in these kind of ways. Obviously there's like tons of tooling and existing tech that needs to adapt, but the ideas are are very, very powerful in that way, and I don't think super controversial.
Darin 00:14:02.997 One of the things that I think could be controversial is, I'm gonna put on a CTO hat for a minute, and I'm thinking about reliability. how would you even sleep at night knowing that there wasn't a server you could go hug and flip the switch on?
Viktor 00:14:17.867 But we kind of did, I misunderstood earlier conversation that basically it could be on your own hardware. Right? And is that what we're talking about? Right. And then it's not conceptually much different than, let's say, Kubernetes, just because we mentioned it before, kind of like you cannot switch off the application because you don't even know where it's running. I mean, it's not peer to peer, but it's somewhere.
Mathias 00:14:41.627 it's because both systems are distributed, right? So like a Kubernetes system is also distributed. Peer to peer system is also distributed, and then peer-to-peer adds a ton of stuff. Extra like security and just kind of like pureness of it. But both system are distributed and Kubernetes is a very, very good distributor system. Also, first of all, like. By design, but it's like, and I haven't used this in a while, but I don't know if I would download a container from my worst enemy and trust that that worked. I don't know what kind of, you know, checks. It does. Maybe it actually does, like checks like that, and that's fine. But it's kind of like, it's the different kind of mindset with these kind of like, trust systems in a way. Maybe it does all that stuff together. But like to peer again, is about doing this on an infrastructural level where you don't have to think about it on the level above. So like any application that Build on top gets this nicety. answer your question. About like sleeping at night. I actually have the opposite. having worked with peer-to-peer in a while now, and like obviously, you know, it's, it's novel technology and, and, um, with any like novel technology, there's like an iteration phase with like, you know, a box and stuff that we've been working out. but outside that, Peer to peer means that as long as somebody in the network, if you build your app that way, has a copy of the data you're trying to do, the system can kind of survive. And like Rebootstrap and Rebootstrap and Rebootstrap, the more peers edited system, the better it tends to scale. now you probably wanna run a couple of notes yourself if you're doing something to like, keep that initial spark alive in case everybody's offline for some reason. Like the bootstrapping problem is definitely real. For our app, we make a chat app called Key. it's like chat app where people in the chat, everybody has, these copies and they, they share them encrypted and stuff like that. I run a couple of notes myself to help, encrypted seed some of that data. And I have many times where all that went off because I don't know what I'm doing infrastructure wise. And the whole network just keeps going. so it actually helps me sleep a lot at night because it's like that kind of infrastructure all of a sudden doesn't matter in terms of like uptime anymore. Obviously you can, you can run things to make the network better and subsidize the network, but uh, you don't have to think about it so much in terms of like a binary level 'cause it's trustless.
Viktor 00:16:37.419 In case peer-to-peer, which I assume that the last examples were more focused on consumer hardware, right? In case peer-to-peer is based on consumer hardware, there is obvious limitations Still, you still need to have more capacity than collective capacity. Than demand. Right? What is the, now, if you go back to 2000 that I mentioned before, right? I understand perfectly why I was sharing movies with others and the reason was because I was downloading movies from others. It was kind of mutual benefits, right? What is the motivation today? Kind of like, why would I right now share my compute with you?
Mathias 00:17:20.169 that's a really good question. and I think like having like a general computer sharing thing. If it's, if that was the, the premise of peer to peer where I would tell you, Hey, run this program. You don't know what it's gonna do and it's gonna sit there crunching 50% CPU, and your, your bandwidth is gonna go high and you don't really know what it's doing. I think. That's a very interesting discussion where some people would, would be willing to do it, but a lot of people would be like, why would I ever do that? For me, that's actually not what peer-to-peer is about. I think it's actually very similar. I think you almost answered it yourself with like when people ran Bit turned in the early two thousands, I don't think the normal people ever thought about it as like something that would be helping resharing to other things. They were just like, I want to get this content and I use this app to get this content and I don't really know what it's doing, but it's not doing it. So much on the, like, outside me getting the content that I care. and that's the sweet spot because the thing you bring into the network resources wise is much, much higher than what the network needs. Like our computers in terms of like compute, we need to run apps. For normal apps like a chat app. It's much, much higher than, per device than what the network needs when you add a new device, if that makes sense. So you can easily add these apps where the peer to peer is. It's just something that the app uses to, like we said before, reduce cost and create reliability, but where the user doesn't really need to care and also doesn't necessarily need to know in terms of like a UX point of view. Like the user just wants to send messages or like download content. Now it gives you like an interesting aspect, I think. just thinking about real world stuff that we hit, like so in our chat app for example. Like any other chat app, you can share content. and when you share content in the app, like, you know, in the, in the chat, we don't have a limit on that content because we don't host it anywhere, and it's just between the peers in that chat context. But they tend to have a aligned a sense of like, if I'm talking to my wife in a chat, I have a aligned incentive with my wife and stuff. So chat is a really good use case, I think, to both like share those files and make them available for the people in there. obviously as those. Incentives get bigger. If this was like a public, public thing, maybe it's different, but like again, you can kind of like build it like you want, the infrastructure doesn't really care in that way. really good point. Uh, I think it's kind of like. Uh, per app, it becomes less of an issue, like with BitTorrent, but obviously something to think about. Uh, we also, like, I think also this is a really important point, like something like peer to peer doesn't need like a token or anything like that because you don't really have those like incentive hooks you need to do, like if you run like a blockchain. So it can just be like actual open free infrastructure.
Viktor 00:19:42.921 Is there a major. Service kind of a normal person, like my mom knows that he's using peer to peer, like, because what you're describing sounds like that. My follow up question should be, why isn't Netflix bad peer-to-peer?
Mathias 00:19:58.911 That's a really good question. I mean, it's actually hard to know, obviously, right? 'cause like, also, how do you define peer to peer on, like, is it like all on the end user? Are they doing it behind the scenes? A lot of apps. Done things and then changed things and stuff like that. I know Spotify used to do a lot of peer-to-peer with distribution and their bootstrapping days. I know, from my youth playing all of Warcraft, the installer would like peer-to-peer also those things to reduce a ton of stuff. So p apps changed and, and do it differently. Right. And apps do it differently based on, on their model. some apps try to not do peer to peer explicitly. I actually don't think peer Netflix necessarily would wanna do it because they probably wanna have very, very tight control of their user base. They, they're in the business of. slightly biased squeezing money out of us to watch content. Right?
Viktor 00:20:37.913 Yeah, but that, isn't that the reason to do peer to peer kind? Oh, my users have Netflix application. I'm inventing use cases. Just to be clear, they have Netflix application. That application is doing whatever it is doing right. Uh, they use it to watch movies, and it is lowering our cost of infrastructure because without even users knowing they're actually streaming to other users.
Mathias 00:21:00.083 And I think they are doing that. Like again, like, you know, I'm not inside the data center, but they probably have a bajillion endpoints, edge notes around the world where they do like this kind of like in data center distribution between each other, but they're not getting it to the end user because if they get it to the end user, they would probably be very afraid of losing their control over the content, which I think, would hurt their business model. 'cause their business model again, is about controlling access to content. Like Netec for me is one of my pain points a lot about. Not so much the technical discussion of peer-to-peer, but just more like also the philosophical. Um, like I'm, again from a small country. I move between small countries. Netflix controls what I can see in every country because of some arbitrary rules that I don't have access to. My sovereignty and my data is basically zero there. so I think they would, they would be like, we, we wanna keep it very, very tight for, for that, and then eat that cost themself because they try to make it back elsewhere.
Viktor 00:21:49.769 Isn't it the other way around? Uh, in a specific case of your example of Netflix, that actually Netflix would, would be very happy to serve you the whole catalog. It just that the country you are in right now, prevents it from doing that because they don't have us legal rights to date.
Mathias 00:22:05.579 I think both yes and no. Obviously there's like a lot of legalese in this, but like they do a lot of things I'm sure where. They based, the experience are based on what they think I want versus what I can do because I don't have access to the data and stuff. Like, again, obviously there's a lot of legal complexity in this stuff and I think that's to some degree, a little bit uninteresting. And that obviously it's a good use case and I think they should do it, but like for me. It's more about making that technology and allow other people to make like a Netflix competitor that technically can compete with a big network like that. Like Netflix has raised bajillion dollars, right? So they're like one of the most funded startups in the world. I'm sure they make ton of money now. I can't remember the last what I saw, but like. What peer, peer is more about is saying, I don't really appreciate that Netflix model of doing this, but me as an individual can compete with that because I don't have a bajillion dollars. But if I make an app where all that cost can be distributed among users, I can compete with that also in a legal aspect. there's no reason why we need to burn all the kind of money on infrastructure. Like you said, it's a very good use case and still be like a legal app, obviously. and then compete with them and, and, and do like different kind of targets on that. Now that's, that's. For me, like the long term of peer-to-peer, where once we get that ball rolling, it's like very hard to stop.
Darin 00:23:18.065 What does deployment mean? When there's no server to deploy to.
Mathias 00:23:22.410 That's a very good question. Uh, it doesn't mean a lot, deployment in, uh, in our networks. 'cause like, so we, our chat app is distributed P to P also. and instead of deploying it, we sign the data, right? So it's kinda like I said, like. Data authentic authenticity is, key in a peer to P network. Like where does it come from? Can we rapidly verify that this came from somebody. Similar to how when you connect to somebody over HT PS you verify that that endpoint is correct, but don't verify the data, but you verify the endpoint. and peer-to-peer. You do that with the data. So for us, making a new update, uh. Is literally make producing a cryptographic signature for that content and distribution, distributing that to a couple of peers who will then distribute it to a couple of peers and kind of spreads out from there. And it's the same flow in our app when you make like a chat message. The f signed that message, boom, done, et cetera, et cetera. So like there is really no deployment, but as, but obviously there isn't that way. Like, you know, that's like and we have a similar kind of like process around that internally, as you probably do with like a deployment. First we would test it and have other people test it and like. And then instead of just deploying it to sort of resign it and have it spread out, I actually do it all for my laptop. That last part, just my laptop. I'm doing this call on now, which is I think, really cool point. All you need is your laptop to distribute our app to like thousands, thousands of users. and I've done that from like my bedroom or my office, like I have that signature, it's been tested, it's multis multi-site. I paste that into like our little command line tool that puts it into the data structure. It best out, put my little computer to somebody else and do the, and then it's always cool to see.
Viktor 00:24:52.751 isn't that? Conceptually very dangerous. let's say that China just kind of Tencent installs an application on your phone, is doing some kind of peer to peer and they promise that they're good guys.
Mathias 00:25:09.586 Yeah.
Viktor 00:25:10.021 That the how, how do we distinguish good from bad? Because I guess that it can easily be abused, right? Theoretically,
Mathias 00:25:17.431 I don't think there's any abuse here that's different than a normal app. Like, you know, if you want to, distribute data in a normal app, first of all, like a client can choose not to update to the new version, like in NP two P system, right? 'cause it's P two P also means that they have the data already so they can just be like, I don't wanna do it. that's up to the end client to the site. Obviously there's an app developer that, that builds some rules around it. if I have an Chinese app or American app or European app on my phone and that developer of that app decides to do something that I don't like, I don't think there's any difference in the peer to peer system than this. I think that the, somebody said that earlier, and this is probably similar to, I can't remember, was the Kubernetes thing. It kind of like, once you have an update out there, you try to stop it. It can be hard, right? 'cause it's kinda like some people would always be like, I have it. That's for me, like always interesting to think about and also like in terms of like, you know, these like sci-fi movies with unstoppable AI technology in the future, pairing these things is potentially slightly dangerous, I think. But, at the end of the day right now, that's like more of a developer human concern.
Darin 00:26:21.084 My mind is being bent right now. I'm trying to understand.
Viktor 00:26:25.404 permanently.
Darin 00:26:28.229 Uh, okay. Maybe permanently. I'm trying to get my head around. Okay. So I get the signing thing and then you get, you basically inject it in and off it goes. Great. But how do I get to that point? It seems like the development process of, Hey, I'm gonna add this new feature
Mathias 00:26:49.184 Mm-hmm.
Darin 00:26:50.184 for the chat app, just because that's what we're talking about. How would, I mean, okay. I think about as, as a, I'm gonna quote unquote normal developer. I know that I'm creating something that's gonna be running with multiple replicas and, you know, there's things that I can think about that way that seems to be a good parallel to peer to peer until it's not. So where's the, until it's not falling in because I, I can't figure out where that barrier is.
Mathias 00:27:20.769 No, I think it's actually, I think you're, you strike a very interesting point and I think. It's also pretty close, like honestly, to, obviously it took a lot of tooling to get here and there's a lot of tooling involved in this. Like, you know, with, with like, we have a runtime, the pair run time that, that tries to help you do these things. It's not, I'm not, you know, when I say sign a signature, I don't mean like that. We get it and then I paste it in somewhere and stuff like that. It's kind of like you need a, a bunch of flows, but basically you just make an app like you do with anything else. for us in the chat app, just to stay on that one, it means that you have. An app is written with JavaScript and a bunch of modules and, um. We do like a embedded web UI and stuff like that. but you can do whatever you want. we just make an app and it's like something that's just runnable locally. Now, the big difference in a peer-to-peer app, actually, I think the first big conceptual difference is that, you know how in a normal app when you make something and you start to get a little bit serious? You'll always have that config file where you put in like your database config, right? Your, J file with like, here's my database and my token, and maybe I'm running it locally or maybe I'm running it on unhosted something, and you have different environments. Immediately you'll notice a difference in a P two peer system is that you don't really have these environments. You can if you want to, but you don't need to because everything is just local software. So like a database in a peer-to-peer system is just system software that runs embedded in your app. and obviously you can talk to other people if you want to, but like when you're doing development flows, you're just making a local app. Everything is local. you wanted to talk to other people, you will have some, some flow where add them in, in, in our chat app, it means send them a link to join to a room and then there's some, PP magic there. But you just make a normal app. You run it, you test it, you, you have a normal software flow, you do normal sprints. Um. You have normal QA people testing it, it can be a bit harder to test honestly, because conceptually we've all been educated in centralized systems here. You have to more test, like I always get this question like, how can we offline test? And I'm always like, what does offline mean to you? Like offline? From what? In a peer-to-peer system. Every peer. Is online with themself Like, like what does that mean in like a classic binary, offline, online context? It doesn't mean much. It's just like, obviously it's better if you connect with other people, but maybe US three are on a plane and we wanna talk to each other. That's still a valid use case. so testing can be a little bit tricky there, something we're working on making more tooling for. But then you just make the app and when you're happy with it, you just run another command that just takes that app. They sit with the previous version of the app, makes an update, puts it into this peer to peer container, kinda like a KU container to some degree, and, sends that off to like whoever wants it. Uh, whoever connects to you based on this protocol. so everything is really simple and straightforward and I get so you get to that last point, I actually would, would dare to say slightly biased again, that it's easier than normal development. 'cause you don't have those intense external dependencies that you need to worry about, like connecting to databases and stuff. Slightly biased,
Darin 00:30:07.795 It's because the data's local. Always local.
Mathias 00:30:10.225 always local, and, distributed or like, you know, you're querying it from somebody else who's just a peer, but like running the same software.
Darin 00:30:16.329 Oh, so it doesn't have to be local. It could be a query off to somebody else that has the data that I don't actually sink in.
Mathias 00:30:22.299 Yeah. So then, in a peer-to-peer system, what that means is that, you know, kinda like you and I are chatting, right? So in a peer-to-peer system, I would, when I write a message, I just append it to my local database. Then when you write a message. My local database says there's an update and then I can query it, but querying, it just means replicate your peer to peer data to my local instance and then read it locally. So it's kinda like you're always reading it in and reading it locally. just to continue on that, like maybe you have situations where you have thousands and thousands and thousands and thousands of chat messages. So the P Twop network. technologically wise, tech wise, has to also offer, again, within this framework of like everything can be verified yourself abilities to just get the last message and stuff. Or like some query or some index that we're used to with databases. And we, we've done a ton of work on that and now we have a ton of, r and d and, and, and software available for that. but that's like actually a very hard problem if you started from scratch.
Darin 00:31:13.797 I'm gonna go back to the CTO hat again. How do I back it up? All this data, do you not there? It seems like there would have to be at least one node, preferably. At least two that has everything. I mean, everything.
Mathias 00:31:28.405 it's an interesting question, right? 'cause like, what does the backup need mean in a P two P network? Kind of like if I was being slightly trollish, I guess that is the wrong word. I don't know what the positive word for that is, but like what does a backup mean in a P two P system? Because like in a chat, like in our chat app key, there is no global backup because there is no global system. Like a chat backup can be maybe yours and iChat chat is very important to me. but we also both have a local copy, right? So like there is two local copies available. I can also link another device at home. Then I have another copy. Because it's all just peer to peer data that's running on the same protocol. We have some tooling for running, kinda like we talked about in the beginning, a general instance that just only deals with, with syncing peer to peer data, not really running the applications. Now I'm okay running that myself or using somebody else's, uh, if they're okay with it because it's like, this data is very valuable to me. so there's, tons of tooling. but conceptually I totally can understand why also that can be. Honestly, hard to wrap your head around. It's still hard for me to wrap my head around sometimes. because there's not one global system, you don't need to think about backups in this global way, but you want to have a bunch of small ones. and in key, our chat app, the most important thing we back up is like. Probably call your own profile, which basically just like, who am I? What's my name, what's my avatar, what's my list of chat rooms I'm in for myself? I only share that everywhere with myself, but every device I have have a copy of that so they can also always bootstrap from others. And then we have options where, again, you can offload that to some other peer if they're willing, because that's all at the end of the day, entering encrypted. so we don't really, uh, leak much in that sense.
Viktor 00:33:01.306 backup is, uh, feels like a wrong ask from Darin. The better one would be how do make sure the data is not lost.
Mathias 00:33:10.241 Yeah, it's like a mirror, right? That's kinda like, or like a replica is what we, what we call it. And you just do that by adding more peers to the system and have those peers be willing to host your data if they want to. I think. The hard thing, in the peer-to-peer system with this also is kinda like there's levels of this, right? And in the chat app, I think that's again, 'cause the chat app chat up is just fun 'cause it actually ends up doing everything in the world. in a chat app like ours, I can go into a DM right now and I can add a terabyte of data to somebody if I wanted to. cause it's just between me and them. Do I care about me begging that terabyte of data up? Maybe not. Then I can choose to like. On LinkedIn, one from the, the P two P network and like not have that sync between my devices. 'cause I would probably cripple some devices, right? Maybe I, I wouldn't wanna run that on, on my smart watch. And the technology allows you to do that.
Viktor 00:33:54.775 It feels that the question is wrong. Do do you care or no? You as a user, you have, you use an application, you use a system, you expect that the data is there. And if I follow your example with one terabyte data, how do you ensure that that one terabyte is not lost the moment I close my computer? Right. Is there some kind of guarantee? Okay, so we guarantee that this will be propagated and I'm probably speaking in terms that are inadequate for peer two p. So, so correct me at any moment, like kind of do we somehow ensure that that terabyte data is at least three devices or something like that?
Mathias 00:34:31.240 so, first of all, it's actually, it's a very interesting problem and also in general because if you think about it, and especially in a peer to P network network, it's very opposite because again, every peer has the ability to help you create a copy of that. Let's just make it simpler and not say the terabyte file, but let's just, let's just say the chat, just 'cause it's easier concept to think about. So if you and I have a chat. I'm a peer in Europe peer, and we don't have any other devices. It's just one device. It's actually the weakest peer-to-peer network, if you think about it, because it's a peer peer network where if one of us goes offline, 50% of the capacity of the network is lost, like it's a very, very high churn network, percentage wise. Now why is that interesting? It's interesting because then we add somebody else and all of a sudden that percentage goes down and we add somebody else and that percentage goes down. So like the more people we add, the more resilient the network becomes. and the more on the peer-to-peer side, scalable becomes, because there's more available capacity in that network. not necessarily for hosting everything, but like ensuring at least that the data can be spread around. in a centralized network. It tends to be the opposite, right? Like the more people you add to it, the more it tends to struggle and the more you need to scale something else. Because like, there's a difference between consumers and producers.
Viktor 00:35:38.645 Yeah, but you're scaling something. You control. Right In peer to peer, you don't control it. Kind of like, I dunno, 50% of my users just stopped using that application. Kind of, I lost 50% of the, of the network. Right. How does, how does it ensure that that actually all the data that ever existed is in the other 50% in a way. Right. If it doesn't know which 50% is gonna gonna choose to leave in a way,
Mathias 00:36:01.225 so so my point is like, the small networks are very hard. The big networks are very easy. It's a nice problem to have because the small. is simpler. The way you solve that is you just add more peers to the small ones. So you can have, uh, other peers help you with the small ones to reduce that. You could also, I guess, an app developer subsidize that if you wanted to. The very small cases where have other peers help hold the data for a little bit. That's what we do in Keet. Um, we have, again, this like generic 'cause it's all just generic, encrypted peer-to-peer data, so nobody cares. and that's how you, you solve that from a user's point of view. again, all the data, data is on the devices. Every, every data you ever seen is on your device, so you can always sync between devices if you wanted to. I think that's a very nice guarantee. you can also, again, if you wanted to, if it was very important to you, you can always add an another peer that just mirrors everything like you do in a normal, centralized app. You don't have to exclude that option. Nobody says that's like an option you're not allowed to do. Just that. The peer to peer system gives you more possibilities. So, you know how like Facebook and all these apps are always like very aggressive about, I think it's compliance actually now, but like they always wanna give you this like data export option. Like let's have a data export option, which is kind of like bullshit. You get some static copy or whatever. 'cause, ' in a PP network that's just always can be aligned to like, well what's your public key that's here, here? Can you get the data? And you can have it be like, live and live thinking.
Viktor 00:37:16.538 I was thinking more from the perspective of the Facebook users, who, which is probably 99%, who never actually realize that there is an export option. Uh, and the system should work for them. Like when you tell me, Hey, you can add another device to that for the sake of your data being more secure, what's or not? Kind of like. That's not the user. Right. That's a, that's a very specific power user. You know, that's a what my daughter would call, that's a nerd.
Mathias 00:37:45.316 I'm not talking about power users. I think phenomenal users, this kind of requirement is fine 'cause they don't have to use anything. 'cause again, the Facebook chat would scale with this. Normally, again, the app would add more peers to kind of like subsidize these small things. That's what Key does. In Key in Key the app. There's never a point in that app other than in the initial page where we say it's peer to peer. 'cause we, we we're proud of it. But like the, the app will just be like, it's about chatting. The app is about chatting and the rest is just like something that happens and you tend not to lose anything. 'cause there there's always capacity somewhere. But it's like, to consider, to your point, there's like obviously more probabilistic things in a network like that. I'll be happy to say that at the upside is that everything is free forever.
Darin 00:38:24.517 forever
Mathias 00:38:25.762 On the, on the, yeah. Like, I mean, it doesn't cost us anything to run it. Right? Like, uh, because peers don't do, the only thing I always say, we're in the business
Viktor 00:38:33.347 it does, it does. It does. You, you eat food, I, I'm
Mathias 00:38:36.767 Oh, sorry, that was my next point. I was just gonna say, we're always in the business of ins,
Viktor 00:38:40.482 a cost.
Mathias 00:38:41.297 we're always in the business of like, if we go bankrupt, the apps will still work, right? So it's kind of like if we, if I've stopped working tomorrow, the apps needs to still work, obviously. Like there's development costs and stuff like that. Be the first person to concede that. But like, that's cost where I put it in, into my like budget spreadsheet and I can be like, what's my development cost today? What's my development cost tomorrow? How many users do I have today? How many users do I have tomorrow? That's a flat line, like in any kind of other app. It's like, well, depends if we get like overnight growth like this, we gotta start worrying about that budget. Maybe we should start raising some money. I have like, you know, I do budgets like probably we did in the nineties. You know, I have like a four, five year budget that's like, I know what I'm, what I'm paying today and I know what I'm paying tomorrow. And that's, I think that's like combined with this other stuff like. Potentially a big Game changer for this, because it also allows you, as an app developer to just focus around features. Like, we never do a feature in our chat app that's like, based around costs. there's some features were like, kill me now. That's really hard in terms of like p to pureness, which is like, very fun sometimes. But like in terms of like features, it's, actually really relatively straightforward. Is this good for the user or not?
Darin 00:39:48.387 This seems like the ultimate, it runs on my machine. What happens when it doesn't run on my machine? I mean, as a developer, I'm sitting there, I'm doing it. It's like, okay, great. It runs on my machine, and then everything gets seated. I go and install it on my machine. And um, now it's me as a different person and then it doesn't work. How do we debug that?
Mathias 00:40:11.730 So now this is a great question 'cause like, I think actually you touched now on, I said a lot of very good things. I think that's actually one of the hard things in peer-to-peer, like debugging in terms of these things. And there's something we're also still, um, figuring out. I had, I had the pleasure of talking to one of the co-founders of Skype, a couple of weeks ago and I asked him this exact question 'cause Skype, was very big on being Peter Peer. And I was like, how? Do you debug these things when it's running everywhere? People have different versions and stuff, and he's, he was like, we, you know, you just go with the flow. And I was like, oh, that's kinda like this. that is a very, very good question and I think like, I don't have like the ultimate answer for that yet. What we are doing right now is we're trying to make that as. Seamless, job as possible. And that's why, for example, we did this thing recently with our JavaScript Runtime Bear, which is kind of like this foundational piece that runs on every device that kinda like abstracts, the interaction with the system, not so much just kinda like this, like a JavaScript runtime. So, 'cause we we're JavaScript developers, but just so you have a consistent interface we can test on all devices. It's very simple, it does very little, it's very modular. So when we write code. Kind of like the promise of Java back in the day. Uh, you rewrite code for desktop. It runs on the phone, it runs on the smartwatch, it runs on anywhere else, because it's just running against this like single JavaScript runtime layer. And that definitely makes it a lot, lot easier. deploying stuff in the PP network is obviously, but, but honestly I wouldn't say it's probably not that different than deploying today in our world, like in that world of apps, phone apps, just tons of software to tons of different phone apps because it's kind of like the same, obviously the apps do more in a PP network a hundred percent, but you say still have the same challenges of like, somebody's on a fricking 14 inch screen and somebody's on a 12 inch screen and somebody's holding a this and somebody's holding it upside down. And, Support can be hard, like in a peer to peer network, we get the support request sometimes where they'll be like, it didn't work, and we'll be like, oh, I don't know. And then they'll come back and be like, oh, it turns out, oh, I didn't have any connectivity, so they didn't get my message. I'm like, okay, well sure then, then it won't work. and things like that. Right. So it's kind of like, because, and then, and then peer to peer is also very self-healing, which means that if something goes wrong, it tends to then. correct itself because it's still verifiable and stuff. so there's definitely a lot of challenges that we are consistently working on in our company of making better a lot of tooling. Peer to P also right now. Um, and that's for our chat up. We feel this, definitely focused a lot around like privacy and, and sovereignty, like holding your own data. don't talk into anybody being private, being your own citizen in this digital world, which also means that. Collecting logs and collecting stats from these apps is basically like a very big no-go for most users. and also for myself in that sense. 'cause you don't wanna have that centralized entry. Um, so that can also be a challenge. And so you need to rely more on, classic support and stuff like that.
Darin 00:42:57.077 going back to the logging, couldn't you still log locally?
Mathias 00:42:59.767 Yeah.
Darin 00:43:00.677 In the app outside of, 'cause to me it's still, I've, I've got a desktop app. I've got a mobile app that's then connecting up to a data store that is peer to peer. Right. That's, that's the effective architecture it seems like. Yeah. I mean, but then you still don't want to pass, even if you, correct, even if you collect a bundle, a support bundle, for lack of a better term, uh, you necessarily wouldn't wanna submit it. But you could, right? I mean, you, you as the author, would love to be able to get a whole bundle of, okay, this is the state, because we're seeing this weird thing with, you know, Debbie and 10 to Debbie and 12 to Debbie and 14. It's like, okay, what happened?
Mathias 00:43:43.802 that's, exactly what we're doing. Uh, so we have a bunch of local locking we, and we also lock, like nonsensitive stuff to like a P two P data structure that is fully locked down to the device that a user can then give us access to if they want, which we only use for. mainly internal testing and stuff like that. But like, so you can do this for just locking like very strange events like you said there. So you have a bunch of options. We have a bunch of open source software for that. I won't deny that. That's definitely like a challenge. That's, more unique to peer to peer because you didn't have just like an explosion of different devices. That's definitely true. so it's something, uh, you need to think about from day one. I think also in that like, but like, like you said, in any real world system, you need to do that anyway.
Darin 00:44:20.031 You just said something there, you sort of glossed over it a separate private peer-to-peer structure. So that's something I hadn't considered is you can have multiple peer-to-peer data structures running underneath the app at the same time.
Mathias 00:44:32.571 Yeah, I like our chat app, for example, because it just uses this one primitive. We made open source. core foundational building piece called the hyper core, which is just a very simple peer-to-peer data structure. that's like the, unit of operation in the peer-to-peer world is like, this is one stream of data that you can then randomly access and stuff like. And I think for like, uh, one of our bigger active chat rooms, we have, there's like around 6,000 people in that one, uh, like our community room The amount of P two P data structures that has around 30, 40,000, something like that. So like a lot of their small modular pieces that each can be shared on an individual level if you want to. cause these are very, very small and very efficient. so you have a lot of possibilities. It's very, very modular. It's very, very not like configuration heavy. It's very low configuration, but it's more like composing. You know, it's kind like I, I'm from Denmark, so I like to say Legos. 'cause Legos are from Denmark. You built your little thing up, which can also, I think, be a little bit overwhelming for somebody starting just to be transparent. 'cause you have all these different options that's like do, do, do, but you can basically compose things very, very differently. So if you think about it in terms of like a chat app, I think that's interesting. So the chat app itself is in the PP network, so that's obviously a very, very public data structure that is available for everybody. And I actually don't even think we encrypt that one 'cause we're like, why, why at rest? obviously in traffic, but at rest because why we need to is like a public thing that just spreads around. But then you have the chats, which is obviously very, very sensitive from the user's point of view. So they were like mega encrypted at rest also. So if, if they ever somebody ever got access, like this defense and dev thinking somebody ever got access from the device is still encrypted. you're ever mirrored where somebody else is still encrypted. but it's the same peer-to-peer building blocks. So like the Stack doesn't care about any of this, it's just one peer-to-peer Stack, kind of like how TCP IP and the normal internet doesn't really care what you're doing on top. It just has one job, which is delivering that stream of data. and that definitely makes our life easier.
Darin 00:46:26.033 If somebody wanted to get started, you sort of lean into this. If somebody wanted to get started developing a peer-to-peer app, what would be the first thing? What is the hello world of peer-to-peer?
Mathias 00:46:37.050 that's a great question. I think the hello world of peer-to-peer that I like to do is actually just having, 'cause this is the demo that I got me introduced in peer-to-peer. Originally, you just have two devices you install our software on both. One of them you make a little note that has a server we call it, but it's actually just like a public. That you can connect to. And then the other one, you connect to it. And then no matter what find on firewall stuff they're on, they'll find a way to penetrate those networks and connect and do like a secure stream. And then just send Hello World. I love that one because it's like five lines of code on each device and it really tells you the power of like utilizing your end user devices as. as any kind of device. we've done a big push on trying to make this consumable for users. We have a ton of stuff. I work with Italians and um, they like to, when I first started, they always mispronounce peers as, as pairs as the same word, like pure and pairs. So we, we use the pairs, our go to emoji, and we have the domain. There's the one domain we have pairs.com, where we try to document all of this and like. If you go to there, there's like ways to get started. All open source, and also links to our, we have a bunch of active rooms on our chat app key where we are test developers and stakeholders very active and trying to help people build 'cause we love people who build, again, it's all free. there's no token, there's no like, no catch. We just building out this infrastructure for everybody and for ourself it's definitely really, really fun to try out maybe. you have a lot of feedback. We want to hear that. but it's like, it's, it can be very consuming, as you can tell from me.
Darin 00:48:05.246 If it just wasn't JavaScript, it would be so much nicer, but that, that's fine.
Mathias 00:48:10.210 Uh, so we have a, we have a Knative layer that we're working on also, and, uh, like our Js engine is exposing everything as, as this Knative building blocks. And, and obviously we do all our, all our encryption in, in, uh, CCC plus plus. That's the only real way. And we do all our networking and CC plus plus. So we have a ton of stuff. We're always exposing that stuff JavaScript for us, it's a good language because it's very, very good at moving data around with that good at this composing layer and it runs everywhere. can be very, very fast when done correctly, but I, I hear you. I'm all for like, more support what's your language of, choice?
Darin 00:48:39.957 Me is Java Viktor Rigo, uh,
Mathias 00:48:44.832 I, I,
Darin 00:48:45.657 other people listening that it's gonna be languages all over the place.
Mathias 00:48:48.492 I grew up on Java, uh, that was like very big when I hit school. I'm, uh, a big fan and, uh, goal for me was always like. Somehow like a spiritual continuation of Java, I think in some degree is kind of Like,
Viktor 00:49:01.342 Uh, more like a spiritual continuation of C
Mathias 00:49:05.472 yeah, I was, I was, I was gonna say like a hybrid of ' Viktor: 'cause it's, it's the only language I know that is as simple as C Right? Every, all other languages are gonna overload. Right? Go is, uh, c simplicity, you can explain, go in a, in the same number of pages as. What was the book, Richie yeah, I am. Yeah. I am a big fan of JavaScript because JavaScript is kind of oddly, so it kind of like, it's a language about getting stuff done for me and not so much about making, like programming art, but I'm, I'm a big fan of, of like programming languages in general.
Viktor 00:49:37.572 why you're so interesting peer to peer. Since you need to download whole internet through libraries for your application, you need extra storage. That must be it.
Mathias 00:49:49.242 Um, but JavaScript like is also very, very good at interfacing with like Knative stuff, as I'm sure all the other stuff is, but so, so it's like, it's, it's a good choice, but like, again, the stuff is agnostic. It's just protocols. I think. Uh, we're definitely looking into a future where there's gonna be very strong bindings for all kinds of languages, and it'll keep you guys' choices in mind. It's good choices.
Darin 00:50:07.124 All of Matthias's information will be down in the episode description, and again, it's at pears.com. Pear, like the fruit pear, like apple pear, PEAR s.com. And if you're curious about the company bear, it's bear.pears.com because you probably couldn't get bear.com.
Mathias 00:50:23.699 Now I
Darin 00:50:24.104 know that you would want to have gotten bearer.com.
Mathias 00:50:25.904 And, and there is our JS engine. And, uh, our company is actually called Whole Punch, but it's fine. Uh, it's too many words, but like, go to paris do.com. We have links for everything there.
Darin 00:50:35.724 Mattias, thanks for coming on today.
Mathias 00:50:36.834 Thanks for having me.