Rinke Hendriksen : Hello world, Swarm
ETHCC 4 · 20 Jul 2021 · 33:06
Rinke Hendriksen introduces Swarm, Ethereum's native decentralized storage network, at ETHCC 4 in Paris, covering the basics of how the project stores and distributes data across a peer-to-peer network. The talk touches on Decentralized Storage and Data Availability.
Speakers
Topics
From ETHCC 4, hosted by Ethereum France.
Transcript
coming to speak to you yes so does this
well and my slides are up as well all right so thank you all for coming here and i'm like really happy to be here and and present in real life right it's so much better than presenting in front of my computer and screen um so my name is rinker i'm the product owner of swarm and well i'm here today to talk about a swarm surprise um but before i start let me ask you who heard about swarm before all right that's good and whoever heard a very simple explanation about swarm
one guy two okay that's good so i'm didn't make my presentation for for for nothing um because that's exactly what i'm going to do right now to present a simple indicator size and accurate mental model of swarm which will help you to explore and understand the benefits of using this tech for yourself so let me get started with presenting what a swarm is and for myself i actually mostly like to conceptualize swarm as this global hard drive which is hosted and operated by computers which are running all across the world and which collaborates because you have the financial motivation to do so
and just as with a normal hard drive in this warm hard drive you can also upload and download right and store data so in swarm you can also upload and basically when you upload content to swarm which can be a file or a website or something like that this content is split into many small pieces we call them chunks and these chunks are literally split all across the globe right and then downloading basically constitutes requesting this chunk by whomever wants to request a file and puzzle it back together and here it's important to
take notice of the fact that actually in swarm the nodes don't store files they don't store the website but they store these chunks which are part of a bigger um bigger context um so only for the person who is uh downloading this content actually the chunks make sense and being this global hard drive there are a few very interesting properties of swarm and the first thing is that swarm has privacy preserving and permissionless uploads and download swarm has robust defenses against blocking or changing access to content once it is published
swarm outer skills with an increase of demand the content is integrity protected and swarm also eventually forgets the content that is no longer relevant to preserve all right so now you know what swarm is and of course uh you're asking yourself okay so how does swarm work how do you get that um i'll be talking about that next i'll be touching up on the network then about uploads and downloads about house form deals with finite capacity and then in the end i'll briefly touch upon how swarm fits in the web3 stack so how does swarm work well the first thing that is important to notice
is that swarm is not your regular piece of software well maybe here at efcc it is because here we're talking all about decentralization and blockchain and decentralized protocols but if i'm talking to normal software developers and i'm explaining them what swarm is like it blows their minds because swarm doesn't run just on one computer but actually it's a collaboration of nodes who share and talk the same protocols and they collaborate together um so i put here a picture of a b and a picture of a swarm and that's because well swarm is the eventual network and a product that you're using but actually b is the software that the individual computers run and a user is motivated to run b for two reasons first of all by running
the b software you have access to the swarm network so you can upload and download and also if you have the computer laying around or a depth note or something like that and you run on it the swarm protocol you're actually earning a bit of money from your spare bandwidth and hard drive capacity all right so the second most important thing to know about swarm is swarms network and for those people familiar here with the technical term swarm uses a specific flavor of kadamlia called forwarding cademnia and for those who don't know what i'm saying i'm just going to explain it now so don't worry
all right so i'm having here a very nice little small swarm network with 16 notes in real life of course um swarm is most likely going to be much larger than 60 nodes in fact right now we're having a network running with 200 000 nodes all around the world but i'm just taking this 16 node network because it's easy to explain all right so you see here alice and dave and these two nodes i just gave them a name and alice and dave both have an address alice has an artist starting with all zeroes and dave has an address starting with all ones and let's say that we want to send a
message from alice to dave or to any other node for that matter but um we're going to send it to dave and the question now is what kind of connectivity pattern does alice need to follow in order to always be able to send a message to dave with 16 nodes you can imagine okay well ls just connects to all the nodes but if you imagine a network of 200 000 nodes or even more you can imagine that it's just impossible to connect to all the nodes so they need to choose their connections carefully so the first thing that alice does is to bring some order into the network and she spits the network basically in half one half of the network is reserved for all the nodes that start with
zero and the other half of the network is reserved for all the nodes to start with a one like dave and she makes one connection in that part of the network with a different first bit so we call that bin zero all right but we're not yet there we need a bit more order in the network so what else does she divides her part of the network again in two now splitting up those notes with a different second bit and those notes with the same second bit as ls and also make one connection there
in bin one yeah and the last order which alice applies is well split up her quarter of the network again those notes with the different third bits we call bin two we make one connection and then everything which is left we call the nearest neighborhood which are basically the nodes who are having a very similar address to alice and we connect to all the nodes in the nearest neighborhood in the real swarm network um this basically looks like right now we're having 12 bins
but this number varies right the nodes they come and go so it can go up or down and we don't make just one connection in each bin with we make a couple of them to ensure that you know we can just always operate even the orders continuous flow of nodes coming and going all right so this is how alice orders a network and how alice decides what connections to take but what about the original example of alice wanting to send a message to dave right that's how we started and as you have seen alice is connected to bob but bob is not the same as dave so how can alice send a message to bob
to dave well what i'm claiming is that um if bob follows exactly the same logic with the bins and with making the one connection then basically we don't guarantee that bob is directly connected to dave but we can guarantee that bob is at least be able to forward a message to a note that having that has a more similar uterus to dave than bob has right so this is how it works and by the way um i highly invite you just to plot this thing for yourself and to think about it
and you're able to validate what i'm just what i just said but for now we're just alice and alice wants to send the message to dave but alice doesn't know how to reach dave as we've just seen she's not connected to dave but alice is connected to bob so she sends a message to bob because he knows that bob's arrows is a bit more similar to dave than herself she says to bob hey bob i'm having a message for dave and bob is like okay i don't know dave but i know carol and carol is more likely to know dave so bob sends a message to carol says carol hey i'm having a message for dave and carol's like okay i know dave right so sends a message to dave and
this is how alice can send a message to dave but also to any other node in a network and of course a swarm nodes don't just pass messages right so swarm is a protocol for decentralized storage of data so swarm nodes store chunks and the message passing is for upload and download and remember again these chunks i spoke about it before these are these very small pieces of data that belong to file or belong to a bigger piece of content and those chunks they well don't look like that but i can represent it like this they contain data and they have an
address and this address is very important because it's basically this address that defines what nodes are going to store the chunks so a chunk that has an address that starts with all zero all ones will be stored by those nodes that have an outers similar to that just as we could compare the similarity of two addresses we can also compare the similarity of an otters of a junk and others of a note so that's how we can define that the junk is stored by well in this case dave and the neighbor of dave just as alice had this nearest neighborhood dave also has a nearest neighborhood and
that's why we can define that they both store this junk so the chunk is stored by always more than one node again to facilitate that the junk stays in the network even if nodes come and go and the others of the chunk is actually defined as the hash of the data or it is attested by a digital signature of the uploader so that provides integrity over the data all right so now we have the two most important components actually to define upload and download in swarm because we know that we can pass a message to any other node in a neighborhood and we also know that those nodes
store a chunk if their artist is very similar to that chunk so we can just define upload and download as follows upload is basically to route a message to the neighborhood of the chunk and the message basically is the chunk so it's a chunk data and it's answered by a receipt confirming the storage of the data download basically is to request to send a message to the neighborhood junk request message which then is answered by the chunk so i'm having here again our four friends alice bob carroll and dave and you see here that
dave is storing a junk with the address of four ones right so ellis wants to request that junk and what he does she sends a message to dave in this case it's a chunk request message passing via bob fire carol fire dave and dave is like okay i'm having this chunk so let me pass it back to carol to bob and bob eventually passes it to dave and sorry to alice and ellis uses this junk together with all the other chunks that she is requesting to i don't know create a file maybe decipher punk manifesto all right so she has the junk and it's important to realize at this
point that nobody knows who was the originator of a request right so you can imagine this for watching um dave knows that the junk was requested by carol but doesn't know whether carroll was the originator of the request or just the forwarder carol has the same about bob carroll doesn't know whether bob was a forwarder or the originator and so also bob only knows that ellis requested this particular chunk um from him um but she doesn't know whether ellis actually was downloading this junk for her own consumption or whether she was just i don't know sending it to somebody else right so this facilitates the privacy of whomever is
downloading fireswarm and you might question yourself right now okay so actually why do these nodes help each other in passing of these messages and that's because the notes are actually financially motivated to do so so i'm having here a little table and you see again l is bob carroll and dave and just as we can compute the similarity between two addresses we can also compare the distance which is basically the inverse of that so alice has a destination of four to the chunk of four zeros bob is a bit closer carol is even closer and just dave has infinite similarity
so based on this distance metric we can define how much people are going to pay so alice is furthest away so she pays four to receive this particular chunk and she pays it to bob and bob on his turn is also requesting this chunk from carol so bob pays three pocketing a profit of one right same for carol and for dave and you see that everybody in this whole chain is receiving a bit of profit from actually honoring the request of alice so this profit can be either in the token of swarm bcz or um it is paid in reciprocal service or
just by waiting so it is possible to use the swarm for free for example you just want to send a download link to a friend and a friend can download it so it just doesn't need to pay a bzz but if you're you know streaming a movie or a live stream or whatever you will need to pay a bit of money to basically basically incentivize the network to help you in routing all these chunks from all across the network okay so um i was going to explain how swarm works and right now we know how the network is being built up we know how upload and download works the only thing that i'm going to talk about right now is how swarm deals with finite capacity so again
picture yourself this you know global hard drive and think about a normal hard drive right eventually it fills up right if you just put a lot of movies on your hard drive my hard drive is full and um what i'm doing myself i'm buying a new hard drive or i just delete some movies which are not relevant anymore but before i said that in swarm content once published cannot be changed anymore and also nobody can revoke access from anybody so basically it's in the public domain so swarm has no deletion operation so how does swarm then deal with finite and basically how we do that is every
chunk in swarm has a reference to an on-chain payment which signals the value of that particular chunk so this on chain payments together with some expected profit measure from the nodes who are like getting profit from serving it allows the nodes basically to order the chunks based on their value and this is how in swarm always the most relevant chunks are preserved and those chunks which don't have such a payment or which are not requested anymore are eventually replaced by more relevant content so swarm always preserves the content that is most relevant to preserve at
that moment okay so i explained what is form and what is left basically is to talk about how swarm fits in the web3 stack and as we say in the swarm white paper swarm caters for a sovereign self-suffering global society freedom of expression on the web and permissionless open markets but up until now i've been only talking chunks and small pieces of data it's not really something that i don't know at what snowden can use so you see here these layers and what i've been talking about right now is the
disk so it's a distributed immutable store of chunks this is really the pure hard drive and just as a hard drive on its own doesn't really give meaning to the data the disk also doesn't give meaning to the chunks it's basically the data structures and how you interpret those chunks that give meaning to those so that's already possible with form with the b note you can request files you can request directories um you can define dynamic content you can send messages in a private and permissionless manner and together all these puzzle pieces they form the fundament to actually build decentralized
applications on top of swarm and these decentralized applications can really be anything because form you know it's this global hard drive but you can also visualize it as basically a serverless server which is hosted by so many nodes and you can visualize it as dropbox you know really the sky is the limit which we can build on top of form and also swarm is built in such a way that it's really this layer in this deck so it's you know we really try to make it easy for developers to build whatever they want on top of swarm so that's why we're here today also with swarm and i'm not the only one you'll
find more people and we're really happy to talk to you about how you could use swarm in your product we really believe that um that swarm and blockchain and all these things they are going to change the world and um yeah so with that i would like to invite you to try out swarm 1.0 today i have a couple of links here you can scan the qr code to to get a link to this presentation and yeah thank you to lafay that was it questions from the public
raise your hand wonder just a second yeah my question is um what's the latency when you insert data and when you want to retrieve i'm thinking like is it possible to make games where you record the position of players this kind of stuff yeah right so that's a good question so thanks for asking that so the latency imagine yourself a computer from the 90s well maybe that's around the latency so swarm um you can imagine orchestrating downloading these chunks all around the
network it's like a quite a complicated puzzle um we have this form 1.0 out there you can use it you can put your content on it which then you know can't be deleted anymore but for the time being um it's really not so fast right so we're working on it with with a very good team of developers and a whole organization that is you know we're making it better and better and you know releasing software regularly so we hope to make it fast maybe in a year from now or half a year you can download you know games and put it as a back end for that um but for now i would advise you maybe to sign up for our newsletter and you'll be able to follow our our
process and yeah keep an eye on us and for sure we want to cater for you uh also in the future okay question so i have i have two questions so one how do you compare it to filecoin especially with regards to like economics and sorry where are you sitting here yeah and the second one in the past you had service for messaging like a queuing messaging yeah so is it integrated or what's your plan with that i'm having a hard time understanding what you say can you repeat maybe one question right uh so the first one was how do you compare it to the file coin
how do i file file coin how do you ah how i am comparing to filecoin okay so i find the most like prominent difference with filecoin that actually in filecoin you're not uploading content to the network basically what you're doing in filecoin and basically this is ipfs right so filecoin is the incentive layer on top of ipfs but in ipfs we are announcing to the network that i am storing a particular file that file to the network and you're not just uploading the file to the network you're uploading the chunks
containing that file to the network so that's really important if we're talking um permissionless upload and download and also to protect the privacy of people because in swarm sorry in ipfs you're always storing the content and if that content is content that people might not want you to store basically you're always liable for the content that you're storing yourself and in swarm there's no such liability because nodes don't store files they store chunks and it's impossible for yeah no i wouldn't say impossible but it's it's really hard to make a note liable for the for the chunks it's storing because there's plausible deniability right so a note
stores a chunk but the note doesn't know what file this particular chunk is part of so that's that's i think the most important difference between swarm and ipfs um i have a couple of questions like it too is very simple like what is your network capacity estimate right now and what is the number of active nodes in the network right so the network capacity has already set we have 200 000 nodes at the moment um the standard database size of swarm i think it's 30 gigabytes so do the math that's your network capacity at the moment
but the more people use swarm um you know the more expensive it costs the more profit note operators get so we also expect this capacity of the network is basically dynamic where it comes and goes with the usage of the network and the profit that node operators can make by running swarm our results i get 200 000 all active sorry those 200 000 nodes all active they're all active wow yeah and another question okay is it uh is it s3 compatible swarm or can you repeat it please uh that's warm s3 compatible if swarm is turing compatible no not during
s3 aws history no at the moment it isn't but as already said we are providing the low level access in two swarm so yeah it's a hard drive touring compatible with a hard drive probably not with the programs running on top of the hardware are and swarm is exposing both the higher level and the lower level apis so you know any developer here wishing to make swarm um s3 compatible we would love to talk to you and i think we also have grants for that right i think that's it yeah thank you