ZKPodcast: IPFS, Libp2p & Filecoin with Juan Benet
4 Dec 2019 · 1:10:48
Protocol Labs founder Juan Benet joins Zero Knowledge host Anna Rose to trace the history of IPFS, Libp2p, and Filecoin, the incentivized decentralized storage protocol his team built. They discuss the gap in decentralized storage Filecoin was designed to fill, the technical challenges encountered while building the protocol, and the newer technology Protocol Labs was exploring at the time.
Speakers
Topics
Transcript
welcome to your knowledge a podcast where we explore the latest in blockchain technology and the decentralized web the show is hosted by me Anna and me Fredrik [Music] in this week's episode we catch up with Juan Bonet to chat about the history of ipfs live p2p and protocol labs incentivize decentralized storage protocol file coin before we start off I want to let you know once again about our listener feedback forum a number of
you have already given us some great feedback so thank you but if you haven't yet please do weigh in this feedback is so helpful to inform what the next year the podcast should look like so do keep it coming I've added the link in the show notes it's a short anonymous questionnaire so if you're a long-standing listener or if you're pretty new to the show we'd really like to hear from you of course you can also always keep in touch with us on telegram Twitter or check out our very small but growing YouTube channel you can subscribe where you get your podcast to zero knowledge we share a new episode every week so now here's our interview with Juan Bonet from protocol labs all right so in this week's episode we have
a very special episode because it's the pick up of a series that we started like two years ago it feels like two years ago which is decentralized storage and we have one of the main people in the decentralized storage story in my opinion Quan Bonet of protocol labs welcome to the show thank you thanks for having me it's not her and we have Anna with this as usual as well hello so let's talk about decentralized storage ipfs file coin there's a bunch of stuff to get into and maybe to start out talk a little bit about you how you got involved in the space what your history
this story is yeah so it's not a computer science and in that period I've been a admirer of a lot of the peer-to-peer technology of the kind of first wave therapy so this is everything like BitTorrent and Skype and things like that and instead a computer science and history systems it was fair to mean that there wasn't enough attention paid to these peer-to-peer distributed systems that achieve massive scale with relatively few resources and there was something off always about them in that they were able to achieve this great scale out of these you know ad hoc networks but never really were able to get past certain thresholds of reliability in some cases or I would rely on on kind of freeloading on a
bunch of resources from from peers in very well-connected environments but without kind of compensating that that usage at all right so you think about things like Skype is using the bandwidth of of a bunch of people around the planet especially people with really good connections that kind of like what went sort of uncompensated and so it always seems to me that if you could actually apply the market its to the problem that could be a much better better set up and so that was early on this was kind of before Bitcoin and then after a Bitcoin and the crypto currency movement started that's sort of coincided with some other work I was doing around data set distribution and things like that and I started thinking through I was kind of designing fastest on the that on was been to work kind of like BitTorrent and get so it's imagined
kind of hatchling purple trees and being able to distribute that in a peer-to-peer way and at the time it now that Bitcoin was out and and we're finally getting cryptocurrencies because computers have been trying to be a thing for a very long time and not being able to break through and actually become adopted and be kind was finally reaching that that scale something became possible to say hey what if you could just use the same kind of incentive structures to do power in network network like this those sort of the the genesis of ipfs and powerpoint is kind of sister projects and there was a very explicit choice to separate the two because they layer very cleanly and that one should be kind of the mode of addressing and distributing the actual data and the other should be the way to
actually incentivize the distribution and and have all the mechanisms work for doing that yeah and I think ipfs came way earlier too right like that's that's many years in the making yeah so I just started in and you're kind of like late a 13 2014 and yeah and then you know proper angels in sixteen seventeen the idea for it was was around in 2014 and the first version of of the design was was out then but kind of took a detour and building out all of likely fuss and and then the therapy and things like that before kind of coming back to the point I think people forget just how difficult the entire peer-to-peer spaces and so we've been yeah just creating a whole stack of
systems that's actually able to compete in performance and quality with normal centralized services right there's there's about a decade and a half of optimization apply to centralized cloud systems that all of this world has to compete against and that is incredibly difficult work to do for the entire the entire ecosystem and so that's reaching that level of quality requires solving a whole bunch of problems across the stack everything from how do you do better connectivity how do you do more efficient encryption of the move to transports like quick to you know all the way to how do you do better content routing and distribution of content to then you know how do you better address all those information and you duplicate
to them how do you provide solid mechanisms or sound mechanisms for incentivizing the people to actually store your data and and the creation of ipfs was that done like it the way you described it is more like a decentralized space but was it also done with blockchain projects in mind or was it a more general project was it was it really for everybody yeah it's a more general project I mean the center based on the same similar data structure here right so it's it was much more get inspired than say blockchain inspired okay but I was it was these are the same ultimately the same primitive gives you both so being able to link two data structures with a hash as soon as a link gives you the ability to have
authenticated data and and essentially allows you to kind of chain these data structures and into these long very large large tree structures that then give you verify ability across the entire thing so that's an extremely valuable powerful property and to the same kind of thing so this content addressing thing give us things like BitTorrent and get-and and Bitcoin and then now look the entire crypto decentralisation with it this is a very incredibly powerful primitive and so that's because it's based on you know building a traditional computer science oriented file system with us with that idea I want to talk a little bit about ipfs and a little bit what it is where
it came from maybe talks about some use cases before we move on to some other stuff so ipfs interplanetary file system if I'm correct yeah beats me fossil assume you just described it a little bit its contents addressed it's p2p distributed but there's also like a bunch of other things that you can do you can pin content which means like I'm responsible or like I say I'm going to Rijos whatever someone else is hosting but at the end of the day it's still like hosted by a person it's not uploaded to a cloud or anything anywhere so if we just break it down a little bit how how does ipfs work on you know starting from a networking layer yeah so the the
compton model are confess is something often yes it's the business under said it's follows that model similar to get in that if you have some content and you add it to your I profess note luckily you've now just have it in your node and that's it but you're now making it available to other people in the in the network to request from you if other people are interested in it and you give a link to other people with the the hash to this content then they'll be able to fetch it from you and in the future we'll have some kind of policy structure to be able to decide whether or not you give it to it as from person but so far that hasn't been kind of high in the priority request list and then at that point once you've distribute the content
to another party now they have it as well and so you could leave the network and that same exact content would continue to be shared so the big thing here is say what if you had the web but where the address that you go to to find the content it's not a location like it's not a specific computer that somebody runs but it's actually just the identity of the file right so this the content address of the the file and then anybody any computer that has the content could serve it to you and so the you know at the beginning you add constitute your note it says locally once other people started crossing it and then it starts spreading through the network now people could decide to keep it around or delete
it and so on and so if nobody's interested in the content it'll disappear if people are interested in the content and interesting giving it around then it'll just naturally stick around and people will serve it what what is the default config here because I remember that it's like a caching structure almost like it once I requested it once my system just by default keeps around for whatever two days and then and it's automatically deleted yeah I think that default right now are that if you pull it you cache it but it's not pinned so in pinning here means I'm flagging this content to stick around with my in my node and I want to keep it through kind of garbage collection right so when you definitely view something you download it you have it locally if you don't pin it
explicitly then the next time the garbage collection happens it'll get deleted and then that garbage collection happens it's physically triggered by running out of space there's like seven space allocation okay then the node has and so it just keeps things around it caches them until you you need to get rid of them I see but I mean even this can even if you said that you know the conda's is only run for 24 hours if we're talking about a website like Facebook that's requested thousands of times per second then it's basically never going to be allowed to leave the cache yeah exactly in just six on and all of those times is requests don't have to go out to some other machines like you can just operate locally and potentially
offline right so you could one of the benefits here is that once you have the content if you have all of the content related to a website or an application or something like that you can actually disconnect from the rest of the network and continue operating on one content just the same right so the experience is a little bit it's pretty cool where you can be looking at a web page on your browser like a like an actual app like normal html5 web app and be just working with and disconnect from the rest of the world and continue working it just fine incoming thanks again right that's that's had that whole distribution model works going back to this like earlier decentralized series we had talked about like BitTorrent and this like I'm we might have even answered this question
or asked this question but it was this idea of like breaking down content or storage data into smaller pieces and sharing them across ipfs doesn't do that right like I think it does so oh it does okay yeah so the way it works is that we call this chunking so whenever you have files or a large database or something that usually is represented by some internal data structure and so in the case of normal files which are kind of this long sequence of bytes your operating system is splitting that up into little chunks and then there's some tree structure around it now when you upload that's somewhere that tree structure doesn't go along with a file it just goes it's just a large long
sequence of bytes most most in in if that's what we do is we chunk that and create this tree around it and with its index and so each chunk is some fixed size some small size and all of all of these little bits are put into a tree and that's full tree now represents your file so when you request a file for me you first look at the at the root you might link to this file we'd like the root of this whole tree structure and when you start trying to view it you'll first request that node and then you'll go down and traverse down to the first block get that and now you can start viewing the file and then you fetch the rest so this lets you do things like immediately get the first few bites and start displaying those in an
authenticated way and then send the rest because a problem with with only sending a large thing is that if you only send like a large file then you can't view it on until you download the whole thing and you've been authenticated though because you have to verify the hash right so if you if you only have one hash for like say a gigabyte file or even a megabyte you had to download that megabyte or gigabyte before you can check the hash and then you can you can display it so if you truncate instead you can start doing it incrementally it does it gives you fast seek so like you you could that's the first part of the file in the middle or porcelain specific spot without having to get everything but is it still like would all of this data still sit with one quote/unquote
client like one person one computer yeah I mean so I guess the question here is like in BitTorrent the way this gets downloaded is each you can fetch each chunk from individual peers like if you have a hundred chunks you can connect 100 pairs and download one off each person yeah and would that be faster you also have so we tend to think of this as random access so um a lot of the ipfs work has moved us into data structure land and programming language land I'd like to dive into that a bit but you can think of each of these chunks as having a hash associate with it we call it a CID so a Content identifier because it's a hashing a little bit extra information and so each of these chunks whether it's like a tiny little leaf or one of these intermediate nodes
in the tree or in the root or something like that all of those chunks are individually addressable and so you can have random access into any part of all of the data so what this means is that if I have say a large directory with a lot of files in it and I have enough of us and I share a single file with you now you copy that one file over and you can have a different directory with a bunch of files but that sub part is the same and so we are both distributing that sub part together so some if another person tries to get that pilus well then it can they can get them from either you or me so then is it very very similar to like a BitTorrent like structure or is there a difference like the chunks that you describe are they different than
whatever the breakdown would be in a bit torn yeah they're different so BitTorrent chunks things kind of it takes a large file and it then chunks it in with the same size and then it treats all of these little things as pieces and then you can move around these pieces and then kind of assemble the whole thing in that because we think of it much more as a as the tree structure of a file inside of a file system and that data structure gives you the ability to have like seek into that so you don't have to download the whole thing you can just seek into a part of it and it also gives you the ability to update this thing so you can think of how a file mutates over time so you can have one version of the file and
then you go and change the middle or something and so the new data structure is only gonna have a few parts that we change only the middle block and then the the path the nose all the way going up to the roof if you can have these different versions and you can think of a test sort of bergeon controlling all of this data where this gets really cool is when you start applying this to other things on files so for example if we could we go look at other kinds of things that are not files for a moment and we think of say CRD T's or or just any kind of database where you have some set of objects that I linked to each other and you start applying this hash linking to them then you can distribute all that stuff with IP of us and so including
blockchain so for example we have you can move around block chains with ipfs with an address all of those individual blocks or transactions or you know all that stuff with the same kind of links so you can have native browsing of a blockchain I mean kind of like a file system path oriented notation and look at it through your web browser just natively what you just mentioned CR dt I'd actually don't know what that stands for security is a conflict-free replicated data type out or a convergent replicated effect a couple names right it says for a series these are these data structures that give you the ability to have to represent data in multiple devices so multiple computers and allow updates to
both in both places that converge over time so for example say if you if you're editing a document in something like Google Docs and you're making some edits and somebody else is making some edits at the same time you can both have a consistent view of the document and then send your updates to each other and the data structure backing in the document is designed to converge so all of the updates are going to be applied in the exact same way if there's not gonna be a conflict and so if we can both type at the same time and we're both gonna arrive at the exact same thing so Google Glasses and you see are duties they use had an older thing called an operational transform but Syria teas are effectively like the next generation version of that line of work so you can take these data
structures that can be used for for these cancers like real-time collaborative applications and just put all of those on top of IP FS so like an ether pad something that's cool this is something that like a user would actually notice like you you as a sort of maybe even non-technical user if something like this would actually see the benefits of this thing you just started to talk about like the way that ipfs and blockchains are used together so you you gave this one example but are there other examples like cuz I I mean IP fesses I hear it cause I hear constantly being cited as like the thing that's being used to deal with storage but I bet there's so many ways in which it could be used there are bunch of
different ways to use it so one way is broadly this is one of the number one uses for things surrounding blockchains people will have some application that relies on a contractor to share with a blockchain and it'll need to address some data and that data might be a file or it might be a website or something like that and so they'll take that file or that website or whatever and put it into ipfs generate a single hash for that because it represents some tree and then now they can put that hash into a contract and so you can provides at the ability that kind of accumulate information and make it accessible or be able to operate on it instead of a contract now a contract right now today can't pull data out of IP FS and and operate on it and that's what kind of
where poppin is headed but that's kind of one of the use cases at the moment just being able to kind of address information the other use case is if you have a web app this way you can then put the code that interacts with the blockchain inside of that application in ipfs so now you can have add app that moves around the IP fast Network that interacts with the blockchain through some kind of API interesting but this would be like the front end code this wouldn't be the yes anything it's just sort of interacting like you said interacting with they could be the front leg code or I mean when you think of something like a chat application you don't need more much of a back-end you only need to distribute the information so if you as long as we can both find the log of content then then that's all
we need so I can have a chat application which is just a front-end you can have a chat application which Joseph found that presen we can find each other in the network and once you find each other and are in tracking then we replicate the content to each other and that's it and it's all we need now of course if we both delete our applications then then we've lost the data I want to talk a little bit about networking so ipfs as far as I know uses Kedah melia to find content I guess it uses a DHT to find peers yeah but all of this is kind of tied together in something called lit b2b where did the p2p start did it start before ipfs or like through through ie PFS or something else
yeah so i'm livin' if he was extracted out of IP offense notes for the lower level networking stack from a profess and gonna be MDF where I started very early on so as I was starting to make ipfs it was pretty clear that all of the problems in the networking side that we were going to have to solve we're pretty general and pretty applicable to a lot of other peer-to-peer systems and there wasn't a really solid peer to peer library out there that we could just rely on and use there's a we said hey we'll just have to build it oops not to write this thing and then eventually kind of turn this into a library and aim dozen 14 nurses in 14 maybe 15 I was talking to Gavin and Vitaly when
they were building aetherium and this was like before a theorem had launched and they were running into it like going to have to write all the peer-to-peer code another time we talked about like hey maybe you should just look at extracting this stuff and kind of form some common standards and then write the same library and that way we can just reuse the same stuff and they sort of hand in this problem off to somebody who was working on the networking stack at the time and then it due to like I think time lines and so on just didn't match up and if the end up using that idea to then form dev p2p at the beginning they were calling it Limpy TPS well I was like wait pulled that like now we have a name complex it's on the same library
anymore and they're not gonna interrupt and now we have a name conflict so they renamed it to death Peter P but he was kind of a missed opportunity and we all saw that as a big loss in that we should have just made that the same thing from the get-go I think it was pretty recognized at the time too that the PHP was a trade-off exactly like you say to ship something faster where they kind of went we don't need to be completely generic we don't need to be completely backwards compatible or forwards compatible like we'll just ship something and kind of make it specific yeah the pressures to ship something on time are aren't strong and so anything was probably the right the right whole lot of time but the good news is now with the theorem to a theorem is now on liquid appear right so
and the thing the needs of a theorem 2 are much broader and greater than than 4 theorem 1 so they're gonna need a lot of the facilities that Livia P now has and of course there's been years of maturing for liberty as well so probably the fact that was there at dozen 14 was a shadow of what we have now and and now we have something like he's actively used in a whole bunch of projects like law change and so on lib Peter P is a library is it finished is it something that's constantly still being worked on how does like how does a library like this exist yeah so it is definitely constantly being worked on and there's a lot that we have left to do there in that um it's a library
designed to be super modular where it kind of breaks down components my problem so one problem might be transports and so there's a whole bunch of different networking transports that you might want to use and ideally your application shouldn't be dependent than any one of them it should be should all be pluggable and so things like TCP and UDP and quick and WebSockets like all these things Bluetooth and so on should all be full kind of similar interfaces and you should be able to like running the application over any of these so that you can sort of sharks out all of the transfer code there's other stuff like peer route we probably kind of peer routing which is I'm part of a network and I'm gonna maintain some information about other parties in the network and
I'd like to be able to find a specific party in the network and so having the ability to search for a party and find them and then be able to establish a direct connection that's sort of a peer routing problem and there's a few different solutions for that one of them is Scalia which is a yet a particularly DHT that gives you sort of log n steps to find another another peer we also have things like your discovery which is a similar problem but different where I just want to find out about ambien Pierce in the network where I may not be interested in finding specific there I just want to find peers that are maybe interested in the same content that I'm interested in or interested in or Emilia in the same location so maybe they're around my device and so being
able to discover it appears like that it's a useful thing and the thing about peer-to-peer systems is that usually there's a whole bunch of different ways of doing these things like finding peers or connecting to them or finding content so content routing is another one of these problems what happens is people will build an application and they'll try to solve like all these problems on one so they have to do peer discovery and peer rallying and countenance program content routing and the because of time they'll pick like one solution that works fairly well for their application but kind of breaks whenever you take that application in to some other contacts at it and what's going on really so you need to break that apart and say no really like pending on how you want to use an application you might have to use different systems and
different solutions to solve each of these problems so for example idfc is not a great peer routing and content routing solution at certain scales it's just too slow you might want to use something else orson only won't work inside of say a data center there you would really want something much faster like pub/sub or something like that and so liberty allows you to write your application against these kind of problem interfaces and then be able to swap out the underlying logic modules to fit the problem and the domain in which you're deploying application it's definitely not a project that's ever done as he said like there there's an infinite work there's also like currently even quite a lot of problems with repeats B and just
in terms of also like not even technical problems but like misuse problems like I'm substrate uses Lib p2p we wrote the Russell it b2b library and then in in writing that we definitely accidentally merged test net DHT with ipfs DHT sometimes and then and like this is a common thing where like when you deal with networking normally you kind of go if I can connect to you I have to like be your peer and be able to talk to you so you kind of make that assumption really early on that if I can connect then you're my peer button I in lipids B I can very well connect to you
because everything is like generic and I can connect to anyone for any block chain network or any other network but you may not be my peer because you're you live on on different blockchain or you live in on different system entirely yeah and one of the things here is when I work on is how do you make it easy to make those kinds of connections across these systems in a way that's not gonna be problematic right so for example if you connect up here in it's an IFSP ER right now that peer is gonna like try to connect on a number of protocols that you might not speak so for example a an application on substrate or election substrate connecting to an IP past here the investor will like try to run this
pitstop protocol and it just will break and then the connection will break but for example the atmosphere can be smarter and say and first inquire and I call do you run this thing and if not then don't try that but then they could be stay connected and the cool thing there is that we might be able to share things like peer routing or other subsets of the of the architecture we're running into this very much in in five point lands so we're looking at having a whole bunch of different set of appears like ipfs spheres and Falcone peers where so I think of five flame here as being an IPF uh sphere that also runs the pathways suite of protocols but not all ipfs peers are going to run run those so a falcon pair needs to be able to connect to any any random I profess
fear but it might not speedball of the protocols at some point speaks if you're able to now connect these like different heterogeneous groups together but but you have to be as you say like much learner about they use their because otherwise it's gonna like the kind of a bad theory situation would be like connecting bit trying to I profess randomly or things like that but this this kind of thing could make inter up a cross block chains much easier because you could start sharing things like blocks and it started writing protocols that are cross block chaining in a pretty simple way yeah for sure I mean one the sort of ideal bridge between lock chains if you're talking in a bridging model is that each of the block chains has a light client to the other but that
obviously then requires that they can connect as a light client to that other network so yeah currently I don't think anyone really attempts to do that in in a proper networking style they just kind of rely on some relayer to relay information into kind of a shell of a like lines on the other side yeah I think right now there's yeah there's these shells and then they use them yeah or sometimes I've seen people run programs that just run two full nodes completely independently and it's just this really silly thing where like they're connecting I've seen applications that makes two different chains and they have the same set of peers I'm now running two different full nodes and they're maintaining the same similar sets of connections is a totally
duplicated work over the place yeah just because that's easier to do today we've just talked about ipfs we've talked about lib p2p both of these live under some kind of overarching structure or company and organization and we actually haven't talked about that organization is it is it a company protocol labs yes the company had started starts and supports this projects but the project's themselves are sort of beyond the company innocence that they're completely open source well the EPI anybody can use any of it and they have pretty open communities where there's a lot of contributors to these projects that are not not proper protocol house in fact most of them have more contributors outside of for a
collapse than inside right now the core teams are so in NPL so I think a lot of the contribution to these happens there but for example DP infects sense parody built the rust implementation at that point there was a go team in NPL a JavaScript demon PL and then a Russ team and parody and that was suddenly you know a third of the project it was not in a different organization and then now with a theorem to that I think there's five more implementations somewhere I know in a bunch of different languages and so now those are all different organizations and so we're we're taking right now through how to steward the protocol over time there's a protocol to review where what kind of like what is like the right
structure for this long term in that you know people want to make changes and so on whether it should be a foundation or something like that like some kind of light structure to kind of keep changes on it separately but yeah the the kind of the company that funds of this work and Gross has been growing these these protocols is to come and I started proto collapse and we're any will have a number of different projects in in the web through space and so we we are looking at a number of different things from networking to follow the tribution to you know instead device cloud storage to just broader research into the into the underlying cryptography so now we have three full research themes looking
at different parts of the whole stack so we are now kind of driving some of the work in and some of the the cryptography like the underlying low-level cryptography and use the crosswalk chains both in in some of the share knowledge proof work and in these proofs or replication which are which is a type of proving system that we invented a couple years ago and have been and that feels sort of took off and has been developing with a number of other other groups contributing constructions and we do a bunch of consensus work so consensus one of these things where right now all of the block chains are heavily rate limited by the consensus to put and we see that as a major area of
exploration and so the tackling consensus for example is something that's gonna be pretty like very similar to other kinds of protocols but pretty different in a bunch of key ways and you know we're pretty excited to put that up like right now you can look at the evidence that we have running and it's it's a protocol that has for example many blocks in the same round so so different from other block chains we have on yeah we have different like linking structure and so all of that work is all of this research around all this crypto initial resistance is done yeah well within clubs I think it's a very aptly named company thanks for the call yeah what do you do well we we experimental protocols you
seem to like you kind of add the seed and then let it grow outward yeah exactly the the long-term goal is to is to be a place where we can just drive a bunch of breakthrough same computing and maybe start and grow projects that over time kind of take on the life of their own and and are gonna go larger we as a company are super collaborative we work with a number of other other groups we have a number of things we worked on with parity and and other people in in other organizations in the web free space and also other or exams side of the earth free space and we all the stuff we make is is open-source and we have like this this strong we call it the default open pledge so we we did
some legal work here to create a structure by which all of the stuff we make is by default open-source and so if you and we have like a different IP agreement with with people where we either guarantee we like either filed no patents or the only defensive things that are guaranteed to be defensive only and so it's a very like different IP structure than most side companies and so uh a lot of people come to work with cool well let's talk now about like kind of a flagship project I don't know if you'd call it that but something that you're definitely very well known for file Queen great you mentioned it a few times but I think we should totally jump into it we've never really talked about this on the podcast we hinted at it back when we did this decentralized storage
series but we really didn't dig into it so I'd love to hear from you how you describe it today yeah when I say decentralized storage network and it mixes a storage power based consensus with a decentralized market so the way it works is that it's a blockchain we're just think of it as a proof-of-work blockchain where the work involved it's not hashing but it's storing useful data so that's a really important difference it means that the incentive structure for for having power in the network and producing blocks is directly tied to how useful the network is and how much useful storage plant work is providing
and so that lets us then use a useful storage and kind of provided in in a market and kind of let clients and miners interact and have data stored so clients come to the network and ask miners to store their data and then I agree on a fee structure and then you know send the data over the miners now holds on to the data and it keeps it over time and the protocol is designed to prove that over over the direction of the deal so say a client makes a deal with a miner for a particular duration of time say six months or a year or something like that and then the miner is now holding on to that data for the duration of time and if I stop sorting it and then parkland will detect that
and and be able to get penalized miner see how many incentive structure that that way and it certainly stopped paying the remainder of the of the fee and then we're also working on on things like repair on top of this we're able to detect the failure and corrected but that's sort of gonna come from that later going back to time pressures than shipping and so on this is repairs and extremely interesting part of the whole equation that's we're gonna be shipping the network first and then kind of bring down repair online after the fact but yeah it's a it's a really exciting project project we have been we probably ended up pushing the frontier of blockchains in a bunch of different ways so River application as I mentioned earlier it's like a this proving system to verify that you actually have the
content and you're not cheating there's a very hard problem there with in these systems where you know how do you prove to the network that you're indeed storing something and not just lying about about that and this especially it gets hard if you can pretend to be the client - right so if there's an incentive for for storing data then I can pretend to be a client hire myself and then to store nothing or like and so how do you how do you actually solve that problem it's a very interesting question that that took a long time it says one of the interesting problems all the rest include things like this hire super consensus and so on but the end of the day it's all about taking all of the unused storage on that planet and
organizing it with incentives to build the largest most powerful computing storage network and you know kind of drive the prices for it's down I mean you I think you've heard this concern many times before and I'm curious to hear your thoughts on and so when you say useful storage a red flag is raised in my mind because the point of consensus and like the difficulty in a consensus system is to increase the cost of attack but if what you're doing is useful then you can like amortize the cost of that so like let's take that that prototypical example in this world of like saying that proof of work should be calculating molecules to cure cancer
then if I actually find the cure for cancer while doing that then I can sell that and make tons of money which means that my the cost of attack on the network is zero or even profitable so there's this inherent problem that like consensus should be hard and difficult and useless so that it's costly to attack it but you're kind of subverting that a bit by making the thing useful I disagree with that if you worry about framing so I think what you want to say is a system that makes it extremely expensive to reverse something where at the end of a where you want is it's kind of like a very specific consensus
systems like formalized consensus system question which is how do you agree on a value and the kind of proof of work that come out of consensus answer is you commit power that you spent on top of a value so think of it like I'm gonna agree and commit to value X and in order to do that I take value X and then I turn to a bunch of Hatter's and up with it and then after I've done that enough time and I fix spend it enough work then I produce some other value and then send it out to that network but the important thing here is the consensus is achieved when you spend that work on top of that candidate value but you could be using this work to do something else and so
there are some concerns here around oh well like like you mentioned you could do that anyway but also kind of reuse this value separately elsewhere yeah I don't I don't think we've seen an attack like that ever in any of these networks the thing changes entirely if the if that values within the network itself meaning that that data that you're storing is useful in the context of our coin itself meaning it's useful to store data within PowerPoint it really key question here is so for example if I just wanted to make sure that you were storing a specific file and again you could either cheat about what the file is or say that you can't cheat about the specific file but you could reuse that storage and kind of pretend to another network that you're storing the same
file like now you could be reusing reusing power right it's a key question here is making sure that it's unique storage spent meaning and this is sort of known as a proof of space so prove our application is approved storage and approve the space these are looks totally different how did it go into defining the differences here but but but the point is the the space spent is uniquely spent on the papua network in the particular chain that you're on when you sort of seal a sector so that there's these units of data in fact we call sectors and so when you seal a sector and it committed to the chain you're you're committing all of that work and it's a huge amount of work spent on that particular value and that adds that in order to like go against and you would have to do that particular
work there's just one decided added layer here which is it's not just any Hashem's now now you have to have that specific data so so this this potentially makes it harder in in other ways which is that if you can't like if you want write a long range attack the network so in the proof side you would have to like go and buy keys and proof of work you could you would you could always do it because it's just hashes but in Falco and you would actually have to get that specific data and and go and replicate the specific same sectors and that's way harder so not only do you have to buy keys you have like acquire the specific bits of information so you had to replicate a huge vast amount of of storage I guess the the and the short answer to the question is it's proof of
useful work but you've taken steps to ensure that it is only useful to file coins yeah before it when it comes to ensuring the consensus as used for the consensus yeah only only for that particular chain so if I'll go in Forks for example over time your search will have to be committed to one of the chains and not the other there's also another back to this I suppose which when we talk about proof of useful work in the proof of work context of like you running an AI model or whatever people propose it's this idea of like you you grind out more power on top of something to like and back that thing and you have to do that in perpetuity because there is no finality and Nakamoto consensus
but you do have finality if I understand correctly yeah we basically declare finality at a particular height so and so this is this is a space not like unlike a different opinion about what's really going on with work so anybody start with by saying first off if a proof of Network backed chain forked massively meaning like a like imagine that with Bitcoin tomorrow somebody produced a chain that went all the way back to Genesis but it was completely different like a completely different trace of transactions that had more work on it now the proof work in a maximalist camp would say take that chain that's like the one true chain forget this other chain that we've been using for 10
years now the like rational economy maximus would say absolutely not we are gonna keep the Bitcoin chain that represents all our transaction history for the last ten years because the proof work is only securing an economy it's not like special on to itself like we're not interested in the proof work we're interested in the economy so there's like a deeper level consensus vertical that's kind of a social matter consensus there that is agreeing on what the the real thing is and and the proof work is only giving you kind of intermediate security when you don't want to invoke this like deeper harder more expensive social consensus layer and so kind of
describe is is like Twitter Byzantine agreement in that if people disagree on the chain I can like yell about it on Twitter until they'd now agree on the new chain and then we're going to switch all their code to point to the new chain as if you take a look the baseline backdrop to all of these protocols that at the end of the day there's parties agreeing on what economies that represent and agreeing to set certain parameters to kind of choose a particular chain and we'll ignore other chains that are kind of by protocol more powerful or longer or whatever then you actually get to define rules that work very well within those constraints and say hey you can come up with a reasonable bound and say something like two weeks or even a month or potentially
three months is a timeline after which the economy will not want to change its its history and so you can declare finality at that point and and have a UX that says if you find another chain that's longer and more powerful that's that's four came from further back you don't want to be on it you actually want to stick to this one and it's kind of a very explicit choice and against is protocol the other thing is like you can also calculate like the probability of that outcome being happening and it can be you know you can also draw finality at a particular height where you could sort of declare it an extremely unlikely event and so you're gonna apply both of these these mechanisms and sort of force finality now it could be that due to a hard fork or some problem like maybe you're your
country shuts down the internet on you for five days or something like that you get you fork out for some reason and you might need to kind of recover manually and that's totally okay I think in those circumstances you do want to know that you for you do want to get the user to decide what economy they want to hook back into this so it's so different this way of thinking about the just going back to this proof of useful work or useful unique work somehow so what is it exactly what is the like it's not proof of work it's not proof of stake like what is you sort of mentioned proof of replicability but is that verification yes and so that's the EM so these things called proofs of storage which are simple proving systems to prove that I
have possession of of some data so proof of storage is like a larger class and so one example might be a proof of data possession where we agree on some data X and then I can prove to you that I I have data X without even revealing X or we're suddenly revealing X would be like the simplest proof I I have X I'll prove it by just giving you X but of course you might want to do something much smaller you know if X is like a few gigabytes large you only want to you want to do something else so then there's proofs of retrieve ability where not only am I gonna prove that I have axe but I also want to make it so that these proofs that I'm giving you can be used to reconstruct X in case that that I'm malicious and I want to withhold X
from you meaning like you don't want to be in a situation where I'm proving that I have expert refused to give it to you so personal space are a different type of proof where I can just guarantee to you that I've that I'm spending a certain amount of storage space so for example eyes I commit just to say that I'm gonna saw a kick a bite and I generate a random gigabyte and then I can prove to you that I'm storing on random gigabyte and I'm not throwing some other some other thing and so that lets you use storage space as a proof of work so in a sense like you can you can count on that storage being unique so now the interesting part is combining a proven space with a normal you know proof of data possession where I would
like X to be useful not just a random string and so the hard part of this was to create a proof of space that was also being used to store useful data and so that's what proves the replication here are they're actually different like I guess the question here is like are these different activities incentivized differently are they different roles yes so these all come from these are like deeper level primitives than then all these incentives ok the cryptographic primitives that that on they give you like this this proving system so a brewing system is like this cryptographic protocol where the very simple idea which usually says there's a proven and a verifier and the provers
gonna prove something to the verifier it's gonna like the very very general case and so proof work is is that the prover is going to prove that the prover has done some work to the verifier usually some amount of work like the prover has spent a certain amount of resources look at like a certain amount of like computational cycles and so i the classic example is hashes right so i can prove to you that that i've done a thousand hashes or another proof might be a verifiable delay function where i can prove to you that I've that I've spent a certain amount of computational cycles in sequence and so I've waited a certain amount of time and so these other kind of proofs of storage and so on are all proving systems like that that are kind of low-level primitives used in a whole
wide variety of protocols and a lot of these got invented to do things like spam reduction right so like three of work was originally invented as a way to reduce spam on the internet on you know and then these other kind of person storage systems were were invented to kind of create clouds that that you could trust better because they could actually prove to you that you're backing up data but no these basically we're went completely unused in the normal centralized cloud environment where that kind of trust is contractual and are now actually only being used finally in the in the whole decentralisation space because this is where we're we're using incentive structures to to guarantee things not not a contractual ingredients so we're talking about all of these different proofs and I happen to know that there
is a zero knowledge proof in there somewhere where is that somewhere and like how does that work why is there a zero knowledge proof in there yeah so we use snarks to prove some of the of the actual proofs of replication so so there are bunch of different prove replication constructions and they usually produce kind of these large outputs and so we would like to be able to do a lot of challenges and proofs on these proofs of replication but then aggregate them and make a sixteen proof so that it can go on chain in a very small compact way and there buncha different mos goods but it's not SAR great way to do this they
give you a way to gonna compute the you know can't prove that you've done the proofs correctly and then you just take the the actual snark proof and put that on the chain and so parties can now verify a few of the inputs themselves and then the actual stark proof and then know that the other proofs have to have been generated correctly so that's where the zero knowledge proof is in our case it's not actually doesn't need to be zero knowledge in that we don't care about the hidden properties about the snark we only care about the fact that Isis extinct proof of that computation it's almost uses a compression algorithm over yeah with this large other proof so I don't actually know the details of how
prove replication works but there's this I think it's called slow encoding or something yes and it produces this massive lattice based kind of tree that is is very large and there's the snark is basically just compressing this so it doesn't take up space on team yes so we we take currently the source data and say that's kind of like a large amount of Lee I say a gigabyte or 32 kilobytes and we apply those various low encoding that kind of produces these layer these drafts and versus them in layers and and the slow part is that there's kind of a sequential thing going on where in order to produce one like in a set of gigabyte you can think of a node being a 32 byte
segment and so think of a tiny little 32 byte byte segments and kind of producing a graph and kind of for each one of them hashing sequentially which is a slow process that has to be done one after the other because of the hash function but then there are yeah these lattice structures with like multiple layers of these graphs and one type of graph is a DRG a depth robust graph and then they get connected with these graphic expander graphs is there's a whole like yeah large complicated lattice structure and at the end we now have imported the original data into what we called the replicas and the replica sort of committed to a specific value so you can take the same source data and encoded
multiple times if you wanted to and then you would end up with multiple different replicas that are all kind of uniquely uniquely included now that we've done that in order to prove that we've done this including correctly we have to we have two approaches either we do the entire encoding inside of OS n or Gerson's like that which would be extremely expensive or we just kind of run a few of the challenges themselves to show that we prove that we have sort of this and kind of prove that so we say like sample a thousand random challenges over this whole proof and and we do that computation inside of the snark so we kind of we take like the source encoded data and then we decode it and then we also show that that goes all the way back to the route that we committed it I
made it too and so it's that proof that we're making that we want to makes it safe because otherwise it would be another 32-byte leaf and then like the whole merkel chain all the way back up to the root which would be a pretty large amount of data so now times a thousand that would be you know yeah it would be a large number of yeah taking the hundreds of kilobytes four megabytes to produce one proof so so with the Starks we are able to compress that down to a few hundred bytes things like to hundreds or something like that this is a use case for zreknarf proofs that were seeing quite often this idea of using it as a validity proof to kind of compress a ton of data down we had Ariel Gaby's on on the show a few months ago and he's
working with you guys and he mentioned there also I don't know if you're actually doing this but he was looking at doing like recursion as well so like you use zero zero knowledge proof to compress a bunch down and then you combine a bunch of 0 at like snarks together and do another snark on top of them this is a sort of recursion idea yeah recursive proofs are awesome and I think right now our latest construction doesn't have recursion yeah I think release detection doesn't have recursion let me just I don't know about that um but um because we've evaluated like hundreds of so great sorry about like all of this work it's it's a we thought kind of like the proofs rollercoaster
like you end up reading tons of different constructions over time but how all these different parameters yeah and served all these different kind of use cases and so things like the latest contraction that we're gonna trip with it's not using recursion but we have that is like hi on our one to use list because he has a bunch of different properties so you end up with a bunch of useful things out of that but I guess every time you design one of these systems you then have to go through all of the problems that are gonna come up with it and then way like is will will there be ways to mitigate these problems or will they destroy the system and then also maybe decide on some trade-offs like oh this is gonna be less efficient but it'll be smaller I don't know something like that yeah so this
parameter choice over the choice of proofs in PowerPoint has been probably the biggest reason it's taken us so long to to kinda ship a lot of this stuff because you choose one construction and it has eternity and it causes save produces artifacts of like a particular size and maybe that's fine and then you kind of tweak some parameter you say hey maybe like we want the sector's to be like slightly bigger and now that makes some other parameter you have to change and so pretty quickly you're in a very large parameter space with many different variables where you tweak one thing here and a bunch of other things have to change as well and doing that complexity management as a bunch of these algorithms are getting optimized
it is pretty pretty difficult because of all of these constructions is kind of a slow encoding so you want it to be slow enough to be useful for the for the proof but but fast enough and it's not very expensive and like dialing that just right it's a pretty difficult challenge and and nailing that with then the particular snark constructions on top to make sure that you can do this efficiently and again so succinctly enough that it doesn't produce too much to go in the chain all of that parameter optimization has been so intense and difficult that we actually have to write software to be able to deal with this meaning like we have a constraint solver just to be able to deal with the constrained optimization problem on produce on choosing the proof structures and the parameters in Poliquin which is
kind of an amazing like result out of this where what other groups can like now use that to to make their lives easier but like we have to like write this that was actually gonna be my question if you if you're actually sharing these internal tools that you've had to create in order to even try out some of these ideas yeah yeah we used to think about Dorian's and yeah it's a again everything it says super open source so you can go check it out it has like a special language where you define a particular algorithm and and you can think of algorithms and the artifacts that generate and kind of composing these algorithms into larger ones and you have like all these variables and parameters and then you can do kind of experimental results for say how long turn hash functions sake and then you
plug those that data in as some of the parameters and then you kind of compute out what other parameters have to be right so based on like this hash function and how long it takes say outside of an arc and inside of a snark then like this particular construction is the one you want to use because it kind of minimizes some times and maybe like minimizes some like on footprint and like all of that stuff is is calculated through this solver I kind of think of it as like making blockchain tech because of how complex the structures are both individual primitives and the kind of how their weaves into a chain or like all the off chain verticals and so on all of that stuff is so complex that we need
software to help us write software so similar to chip manufacturing in a way where chip manufacturing was going pretty well until he hits a certain size sort of a kind of density and they then stop stopped being able to produce chips manually and they had to start using software to to be able to lay out the chips I think we've hit that point with ball chains where the some of the construction that we're making we need software to help us design and to check is correct because the correctness there is the most important thing I think if you actually not only mess up a parameter somewhere and then like the whole thing breaks I just want to ask this is sort of a bit of a switch away but I want to ask if you've looked at any of the other kind of storage solutions out there especially sort of
the newer ones like we actually had our weave on the show a Sam from our weave was on like I think maybe a year ago and like they have a very different idea around this but I'm wondering like how does the current version of file coin fit with at like also there's like the older ones like Chia and made safe these are things that we had mentioned on our earlier series where do you see yourself fitting are you using kind of some ideas from those are you do you see yourself as very different yeah we're pretty different I think we I think there's a subset of ideas that are shared broadly you know kind of like the basic hey you are gonna hire a network so so some network is gonna do research sharing you're gonna hire a network to store
your data kind of like broadly broadly shared but a few things are pretty different about so I think one of them is this prove replication so I think no other networks using prove replication they might start soon this is kind of an advantage of that so we have because we kind of created that field but this is one differentiating factor per example she is not quite letting you store people say that the only it only is kind of like a proof of work but proof like space oriented chain we also are the only one with and this fluid market structure that it's meant to optimize basic have an ask an bid structure where my nursing clients are supposed to be able to reason about prices together and it kind of platform deals out of that and I think we're the only ones
that are doing consensus backed by by the by useful storage so I think she has concerns backed by just approval space but in our case it's useful yeah those are like three of the biggest differentiating factors then then is of course like the tight integration through Lippe into ipfs and a bunch of a lot of things where there's a ton of usage on top of life it's already it's gonna be easy to just back up all of that data straight into um in Department cool so you have sort of that advantage of like an already very very used system that could be migrated yeah yeah that's the one cool thing to mention is that it that IPS is an open network so now we've seen other other groups start to build a
professor board so I think like storage and others are like now adding hydrants before which is supposed to see yes meant to be like a couple layers so to wrap it up I want to bring it back to some of the things that we talked about in those early episodes and we we had a look at the history of p2p and what kind of concluded that p2p failed at some points and we talked about reasons why it might have failed like the UX was terrible and honestly though like I think one of the biggest reasons is that you know if we're talking about the early internet and it was decentralized why was the decentralized well everyone was running their own web server like I
when I was a kid ran a web server in my house no one does that anymore and we're probably not gonna go back to doing that so that is where this world of incentives comes in where I can I don't have to run my own server to be decentralized I can pay someone to run our server for me in in some regard but I don't pay one single entity to do it and my kind of ending question here is what is possible in this new world of incentivized decentralized storage it's a great question and probably start by by saying like the last the last peer-to-peer summer you know again early 2000s produce a bunch
of like really good ideas some of which succeeded more than others so for example I think like BitTorrent was pretty successful at a set of things and those kind of a pared down version of of Mojo nation and other things that came before it and then the group that was doing because I ended up building Skype and then the kind of resource sharing around telephony ended up being huge and and super successful until they got bought by companies and just didn't want to run the risk and didn't want to manage there's like huge peer-to-peer network it's as they squished it to be kind of run right internally so it was there are a few successes though yeah I think in the whole did not have like massive last name in fact that the web had or like you know the early tcp/ip internet had and so yeah I think I think
when it comes to could appear there's a few extremely difficult problems and one of them is yeah there's this resource sharing and incentives and I'll return to that in a moment but I think others are simply just how hard connectivity is so it's extremely easy to just rent a machine and somewhere in the cloud and get like a publicly readable IP address and kind of like an always-on system that kind of it's easy to manage and so on if you now have to deal with a bunch of computers that are running into who knows who plays and they may be on or off or you know all this complexity comes in applications yet potentially much harder to build unless the network things like kind of takes care of it for you and this is what we're trying to do with things like livid BN I profess make
it so that you don't have to worry about kind of reasoning about those problems but it still kind of likes potentially difficult for many use cases I think one other one other big problem there is once you get into certain sizes of this that's for certain applications you want to be able to run some kinds of computation over that data and having it sort of spread out across the world doesn't line up with the goals that some of those organizations write probably the the worst case of their the worst version of this is that the centralized search for elements are building this huge trove of a personalized data that then they running kind of all this ad optimization coding table right it sounds like a bad case but but a good case would be say personal DNA or personal or the medical record
type stuff where you you're trying to run computation over all this data and I can secure not identifiable way but before the purpose of finding important correlations between human populations or things like that that can be useful to do better medicine or bi or things like that so so that kind of competition gets way harder in the situation setting but the good news is it gets much more user controlled right so if you're going to give your data out to somebody even in the good case here highlighted with the medical records stuff now you've given your data out to some other party and you no longer have control of it you because you've kind of chromatic possession you have a looking limited control over it and so this is where I think the cost is is warranted meaning the cost of making it harder to build
these applications it's warranted because of the utility of like of that greater security that comes that comes from it now I think going back to that kind of the incentives question yeah I think like the big the big thing with with all these research sharing that works in kind of like the first wave was that they were either altruistic or and kind of only scaled and work when there was a different incentive layer ie things like Victorian worked really well because maybe it's one of me trying to be distributed game patches or it's people trying to watch ok distributed material they don't want to pay for it right so it's like having a really cool library of music and wanting to share that like I remember this with like Nutella like I was proud of what I was
sharing yeah exactly and to think like like there was like this other incentive structure around it that like allowed you to run them that network but I think once you start getting into high volumes you encounter this this kind of diminishing return where individuals won't want to run the thing themselves and instead you want kind of a professionalized service and it's in this professional and service thing where what you really want to use incentives on you know make it look it's like very very concretely so I kind of think of these as open services so think of open source as a set of kind of principles and license and so on for groups of people to come together and contribute to kind of a shared resource that it's usually kind of like a knowledge good or some sort of like a
good base or say the content or something like that and that works open-source works really well for that type of good because people can come and go and they can contribute to a thing a little bit and then move on but open-source does not work very well for maintaining services in that we haven't been able to see something with a near perfect uptime and really high throughput or something like that come out of open source because kind of this volunteer oriented thing does not lend itself well to you know kind of being on 24/7 Peter duty and working hard to scale the thing for usage by users right so at that point it turns into a job now it's really interesting about the currencies is that they enabled the creation of a class of
networks that are providing a useful service to the world but they're doing so by hiring people with kind of an intra currency this base and kind of like the utility of that of the service itself and so the best example of this is Bitcoin where the Bitcoin network provides the service to the world of having a transaction processing system and say a store of value and that service is like running 24/7 with a near perfect uptime and it has certain throw sections through but that's probably nothing better but but certainly like it's resisting all kinds of attack a lot of people and organizations and and nation states have tried to like bring it down and that service is definitely
out right like Bitcoin is is up all the time and there are a lot of people working day and night you may maintain it running because they're getting paid they're basically hired by the networking sites and that's an extremely powerful thing and this is effectively like a new class of thing that's that's now available where we can blend open-source with economic incentives to produce an open service and this open service thing now can run all kinds of utilities on the network so think of the idea of a public utility as you would see it as kind of like water and gas and something like that and kind of like the real world now imagine that but on the Internet to
run all kinds of important services but now be in kind of an environment where even adversarial parties are working together to maintain service so this is the case with Bitcoin and another networks where the miners are actually highly adversarial with each other and I do not want to help each other they're actually often fighting each other and yet they together produce this amazing service with a fantastic up time right it's like that's that's like a power of incentives so things like this is where once we nail nail these these structures and nail that UX around them then I think these are definitely going to be the way that kind of computing resources are distributed and I think all kinds of other open such service possible it's just that they'll probably take a while before all this
takes off it's I think it's very early basing this on this I think I'm probably Bitcoin is sort of like you know or Linux and it's like one of the first precursors to a kind of like large explosion that will come it's unclear exactly when that'll come but I think a lot of us and design challenges have to be solved before before these things can really take off this has been listen this has been such an amazing conversation I hate to cut it off I hope we can invite you back sometime and we can continue I feel like there's all sorts of things we could talk about here yeah I think would be awesome thank you so much for having me this is yeah thank you very much and I'm gonna say this we've mentioned this decentralized storage series that we had started it's a very old series we are at a different
point in our podcasting capabilities back then but I will link it in the show notes I think it was like the second episode we actually used this name zero knowledge so it's like very very long ago but um yeah thanks so much for helping us round it out thank you cool and to our listeners thanks for listening thanks for listening