Incentivisation in Swarm - Viktor Tron

EthPrague 2025 · 28 May 2025 · 26:13

Viktor Tron gives an overview of incentives in Swarm, a decentralized storage and communication network. He explains how incentivization keeps the network economically self-sustaining and allocates scarce bandwidth and disk space without compromising privacy or scalability, grounding each protocol choice in the profit-maximizing behaviour of node operators. Presented at ETHPrague 2025.

Speakers

Topics

From EthPrague 2025, hosted by ETHPrague.

Transcript

[Music] So, thanks for coming. I'm Victor Tron and I'm going to talk about the incentive system for swarm. Um, I hope that you came with a with a conviction that swarm is is is already having a pretty good incentive system which is uh making it economically self- sustaining. It's not only that. It doesn't only make it only economically self- sustaining but it's actually optimizes somehow the the the allocation of physical resources primary physical resources such as bandwidth

um bandwidth uh disk space and and like IO and CPU I'm going to concentrate on the first two so the smooth operation of of of of uh small crucial hinges on the bandwidth incentives because uh because of the forwarding of relaying of messages. However, storage incentives serve to make sure that of data durability. It's kind of a novel term usually used for availability guarantees in long-term storage. Um so contributing your bandwidth to the swarm network constitutes uh relaying messages to peers for others sake such as uh such a

relayed send is a major importance in swarm since the since uses a rec recursive routing skin called code forward in cadmia. Academia routing is often used in distributed hash tables, DHTs for short, but uh it's usually used in a very different way than than for usually it's used in an iterative fashion that the that the peers are kind of dialing up have a closer PS to the address the information about which the the DHD stores and they want to know about uh instead of directly doing this iteration often repeatedly to find the nodes online because it's not guaranteed A swarm node maintains a particular set of connections peer connections that are

keep alive connections and therefore can already rely on the availability of P and also it makes it possible to outsource the the the the problem of of finding the closer P and therefore it's kind of the the the message is traveling through a a chain of ever closer PS to the the actual destination where the retrieval happens for example for a for a for for a small chunk like for for a piece of data. How the keeper life connection also can remember the request for the duration of this uh request response uh round trip and therefore it can it can keep that that stream open and also make it possible to to remember that you only do the accounting act or

the action of accounting uh for that u bandwidth sharing event when when the when the when the response is is is is of satis like when when the response is satisfactory. This is going to have an act of instant gratification which is available there and uh they have the accounting for the relaying is in is in quasi real time and so when whe when performing this request to yourself or or for your upstream stake is left in ambiguity which essentially keeps the identity of the request originator not known or in fact yeah in ambiguity and uh ultimately can enable private browsing. It's a very important uh privacy feature and let me

make a shameless plug here uh about my talk on Thursday. It's going to be at the uh web 3 privacy now event meetup and it's about the privacy features of swarm. It's a kind of rather strong value proposition mainly focusing on private download and upload censorship resistance and uh private messaging can usually just say signal on swarm. So let's let's concentrate on the on the rest. So um as for for for for the bandits incentive there there's a few few other factors for example. Secondly, there's a due to cadmia topology, the forwarding requests sent to a a few far away peers are are frequent on their own because

there's there there's many of those requests. Like for example, if if you if you know starts in in in in in the zero bit, then of course half of the chunks half of the chunks have because it's uniform distribution of the hashes has has one bit. you you're going to send quite a lot of requests to your to your zero bin in terms of the the the if if if you count the bins according to proximity order. So that means that uh it's quite a lot of them. On the other hand, if if if you have go to closer uh bins, then they are counterbalanced this this this uh traffic is counterbalanced by the by the number of chunks that upstream PS send you as a as as a request. As it turns out actually can be

calculated that that gives a gives you a balanced uh load across logarithmic distance be bins and effectively load balancing uh requests with a peer connected are const uh the the the load balanced when the number of peers is constant in every bin. That means that uh ultimately the variation of of of of give and take is is is is expected to be to have the same difference the same the same var variance constant variance uh a priority be be uh in in every in every bin and actually it makes it possible so so to so the overall amount of number total number of peers uh that you that you expect is a is is as usually inia a

constant in in in every bin. So all together it's kind of logarithmic in the size of the network. Why is it important? It's important because this this number since the app is a logarithmic that you kind of interact with. It makes it possible to maintain a microp payment like settlement system with the with with the peers that can it's kind of like a like a payment channel some sort of payment channel uh service account. Accounting then enables this service of service service exchange allowing PS to to to uh kind of spare monetary compensation of any sort if they're if they're if they're provision and and and and the amount they consume consumption and

provision kind of somehow balanced or within a within a particular threshold of of balance. uh also so due to the balanced throughput across connections peer-to-peer accounting uh uh of each peer connection by default of of of of constant variance and if the debt becomes excessive like quantifiable with this threshold then that is settled the debt is settled by sending a check to the credit the checkbook contract which is smart contract on the on the event blockchain manages the the redemption of the debt by allowing only the last checks to be cashed So it allows for a kind of cumulative counting. If on the other hand if the if if in the case the fear the peer fails to comply with their

obligation to send the check with the right amount then one can just disconnect directly against some sort of instant gratification here. Uh why is this important? This this whole thing was actually uh invented you know with with with with the foresight that you know transaction costs might vary and we we don't really want to to kind of uh deal with them. So accounting profit offers service to service exchange which is then no compensation happens regular offchain acknowledgement of that with the checks and allowing the flexibility of onchain redemption at the at the pace that the that the beneficiary wants. basically uh waiting for for for the for the transaction costs to be low enough to

make it feasible and that's that's the the the the onus is on them to interact with the blockchain actually. So why why overall the swap protocol which you see the you see you see that it's a abbreviation of many things uh provides a fair compensation scheme to solve the incentivization of bandwidth sharing uh this so what so actually we we had this solution already seven years ago that's the honest truth and the the inventor of that solution is sitting right there in the middle of the room and I hope you don't mind me pointing out and the alternatives that connect directly to this to these random peers on the basis of need in like in iterative cadmia kind

of lack these these alternatives lack the repeated dealings grounds for the for for the continue channel security and also the also the the impending disconnection and and and therefore to to to enforce this compensation uh must find a way to provide well third party proofs to for data transfer and funnily enough. This kind of is this this third party proof to to provable data transfer, it's also known as the is is the uniccast problem. Cryptographers thinks that it's a it's an unsolvable problem. It's it's quite interesting that that's although it's a seveny old uh story, it's actually becoming more and more recognized as as maybe the

solution for this problem. And last but not least, uh the checkbook, which is one half of a payment channel. Hey, enables enables uh you to to earn without having a contract deployed on your side because uh you can just earn checks uh by by providing the service without having the contract. So this this opens the possibility for for a zero zero ether zero cash entry to the to the system basically bootstrapping your way into crypto directly. So it's also quite interesting aspect. Okay, let's let's let's go to storage now. So it seems that uh storage is um of of course it's a very different type of

animal because it's with storage it's it's kind of promisory uh contract in a way so instant gratification is not available and therefore storage incentives are a bit more involved so implements a positive incentation system at at the protocol level. What does it mean? It means that it's it's it's going to reward you know the farmers the stores with their with with with with some tokens if well I will tell you how but uh of course no one's head falls if if if if chunks are missing it seems that it's it's quite robust though so first how how does the money get into the system so users that intend to store uh on swam anything buy

post stitch stems in bulk to purchasing this so-called postage batch on the blockchain from a contract. Uh and this kind of postage batch is more like a hot wallet where you keep an an amount of uh uh money and of course the validity of the of the samp. So it expires when when when the account goes to zero in the balance and in the meanwhile regular intervals the the storage rent is deduced uh from the amount uh you decreasing the amounts of a available.

However the price can change the under. So it can actually easily happen that that the that the value increase of that holding on the hot walt is actually uh always keeps it afloat. In fact, in fact, the same promise as Arie makes with pay pay one's uh store forever actually can happen on on on on swarm just by by just by if if it happens to be the case that that there there's a point but it's never a promise and you can always top it up to to avoid uh loss etc if if there's if if if it hits the fan. So um so what are postage stamps

after all? The posted stamps are are basically serve to protect against spamming, free riding and and also express a priority of retention in case the the in case some chunks need to be deleted from a node's reserve due to capacity shortage and and the storage slots uh in a batch which is like is a bug purchase of of stamps basically uh is so the storage are organized in kind of buckets which are disjoint neighborhoods of of the address space.

And they need to match uh the the the the chunk address that the postage stamp is attached to need to match the this uh kind of bucket and the bucket index is is just is just counting how many how many uh stamps you can issue in a particular bucket of the of the batch. And and so this is what exactly enforces load balancing which is which is made possible of course in the first place by by allowing a hash address which is anyway uniform in distribution but this is enforcing it because obviously you know u in certain formats. Of course, chunks can be or pieces of data can be can be mined and and if you can you could and if you if you didn't care

about about this this the this these slots being uniformly distributed. So or like roughly uniformly then you could just spam a neighborhood and and and and and bring the bring the prices up for that neighborhood or or however it would be expressing the the the the disbalance in their in their storage. So storage matches are stored on the blockchain and various sizes and and um and the match balance can also be topped up and essential to prolong the storage uh the stems allow the peerto-pe system to offer a genuine cloud storage service and and since the price is always uh

optimal so the user is in a in a way optimal because because it's uh so Um um yeah so with with optima uses us users don't need to speculate on the future price of of storage and the token volatility if they use this because uh and and and this this also very very important to think that think about this as a as not a marketplace. It's very important that it's not a marketplace in a sense you're not actually looking to to get individual contracting with with with with the storage provider like it is on on Falcon and other other platforms. It's actually a a a proper peer-to-peer uh cloud service where where the provision of storage is

actually going to a deterministically random uh selection of space deterministically random because it's a it's a result of a hash and matching the hash with your with your node addresses is what what what entitles you to or actually obliges you to store stuff. Now uh so uh the revenue coming from the storage rent that is uh I I said it's regularly deduced from rent is is going towards a reward pot which is redistributed to stores as part of a so-called redistribution game. So the red the redistribution game is played in rounds

happening every every 152 blocks on the on the on on the Gnosis chain. It's orchestrated by a suite of smart contracts on the on the EVM on this chain. Each round consists of three phases as you see you know this kind of tries to tries to uh display this. The three phases are commit, reveal and and claim. These are these are named after the the transactions that that the store nodes typically send to this smart contract. The first two the comet and reveal they they they correspond to standard comet reveal scheme. So which the participants are able to secretly submit their take or their their view on a data set that's that's restored and

replicated uh in their in their neighborhood. So there isation gamers uh must first agree but have consensus over the data set that they need to store which is not so in case of for example if you talk about Ethereum blobs that's a bit different because Ethereum blobs are explicitly uh sanctioned by by by the consensus already and and and and therefore their storage is based on their hash only to check here here it's a bit more involved because here here it's here it's the users are directly uh communicating through their postage stamp they attach to the chunks that they want things to store to be stored.

Uh so after the reveal phase ends the random address is chosen uh that anchors this neighborhood the the the the chosen neighborhood and of course they then they commit to this shelling game. Basically the peer that is storing the chunks in in the chosen neighborhood go through all the chunks and recalculate their hash based on it's like using a modified hash uh that that uses a random nons basically that that that does to check that that that the calculation is recent. They go to all the chunks and select the 16 smallest hash values. It's a bit more bit bit technical but this it's important to say because often people think that this sampling is the

same as kind of availability sampling in that sense the sampling part is not not is much more because already it assumes that you went through the data and if you come to the same uh sample then the the idea is that you that your take on the data is roughly roughly the same as as as others that agree with you on the sample and and after the committee trivia scheme is is a is a guarantees that that this that what you need to store is under consensus and after the reveal phase ends the random address is chosen out of the so to be the true stellar basically they they are

the ones who who whose whose whose take on the data we're going to accept and uh and and and the random noise is not known after the previous runs review phase as I So, so, so each each node will have basically three quarters of the round to to complete their sampling because they have the previous claim round and then the at the end of the the commit round to to to to commit their their their their sample. Now, after after that from the from the true stellars also those same nons is used to to select a winner. So in the next round and and that that basically selects who's who's the winner who's who's the winner who needs to submit the claim

after all and the claim is submitted to to to guarantee that there's no there's no nonsense basically. Uh so the game the the when so the game here is orchestrated by these four four contracts. the re the postage stamp contract is what what uh sells the sells the batches maintain this list of valid stamps and collect the storage rands to deposit it to to to to the towards the the the reward bot and the st the staking contract is just a registry participation with I mean it's it's going to be modified to have a smart neighborhood management which maintains a balanced set of peers and also takes care of the freezing which uh when the peers was unable or unwilling to be part

of the shelling consensus So when they when they were either saboters not revealing their comet or they were liars that they revealed the comet that was not uh the truth. In order to win uh the claimment as as I said there's a claim phase when when when they submit the claim the claimant is uh is must submit a proof of entitlement to the to the redistribution contract which is then checked meticulously. So here's here's the the the aspects of the of the of the of of of the of the proof of entitlement is kind of eight forward. The three of them already happens kind of in the commit phase when you can already check whether someone is replicating the shelling game in a way and then the

redundancy or the reveal phase sorry you check the there's a weak weak condition of redundancy which is based on the uh staking and um so so most of most of your so your your your probability of being selected for truth telling and for for claim is is is based on your stake at the moment. But it will be slightly changed and and and then the the the the after the first three the next five is is really really part of the claim. So relevance retention recency retrievability and and and and resources. Enough resources means that we actually check that the that those values that you actually have in the

sample is is is estimated to be chosen from what what size of a big sample because uh it's this density based size estimation that we that we have a kind of complex math behind relatively simple concept of kind of estimating how how how big your sample was. Now uh so negative incentives uh just just a few words before I conclude that negative incentives you know can can be completely implemented on top of this as as as external system because it doesn't actually need to change the change the underlying uh protocol level system. So

the the protocol of this chunk store which is the basis of swarm but it might be might be actually u um motivated by by certain problems with the positive incentive. If if you think that the it can have a tragedy of comments problem which means that and if if no one had full if if if a chunk goes missing then then overall the system might not be too too uh strongly motivated although in some there there's many many ways to make sure that in in every in every neighborhood there's enough storage not to to store stuff positive incentive etc but but might be might be true. So, so in the case of negative incentives, of course, you have

a it's you can think of it as a non-compensatory insurance uh uncompensatory because obviously you cannot back your you cannot insure your stuff for for for for what it's worth because you can't get it back. But it's it can be challenged and then then the deposit to a proper stake that the negative uh incentivized uh peers uh would put up they they they would lose and and here here's just a just maybe maybe I conclude with this with these three uh properties. So most most importantly this is also not a marketplace in the sense that that insurers are

also provided by a decentralized service network. Basically global global deterministically random assignment of of the insurance problem to to appear and also it also of course assumes load balancing etc. And one one the other two very interesting stuff is that here the se here we separate the insurer from the actual store in the positive incentive network and and therefore this allow withholding attack. So withholding attack is a kind of driven attack when your insurer kind of withholds uh the retrievability of a chunk and and only puts it up on the blockchain when

challenged. uh they don't gain too much from this but actually it can be can be reopened. So it's like been not providing storage. However, if you if if part of the insurance that you actually pay for the batch pay pay for the storage batch that holds it and plus you can make sure that that the that that the chunk was already at the place when the issuer got that got hold of it then then it can actually prevent withholding attack. And if if if if the self-inforced uh um keeping alive of the of the of of the batch, you know, doesn't doesn't happen, sorry, then then then it can be then then be can be robbed of their stake again and

therefore, you know, cannot do it cheaply. And and and as last thing, of course, the the the the the postage stamps are often used as a as a bit of a critical way about SW because it seems to leak at least uh the common ownership as well as the co constituency of the files by if you if you sign the same postage match even though you might not be able to track what it's coming from due to this anonymous property of of uploads, but you can still trace it to to the to the same origin. And interestingly, this is new idea is to introduce a a service like a stamp mixer which kind of issues issues the stamps

as part of the insurance and and kind of mixes mixes them from from various real uploaders and that that would completely anonymize the the original ownership. And I here I here I will conclude and and thanks a lot. I I hope you go with with realizing that that form has a lot of a lot of you know potential in in decentralized storage uh because of its um quite thorough incentivization system that keeps it economically self- sustaining. Thank you.