BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

Analysis of Swarm Traffic Reward Mechanism

BPool
特邀专栏作者
2021-06-11 08:15
This article is about 1867 words, reading the full article takes about 3 minutes
The soft launch of the Bee mainnet is imminent, and discussions in the community on the operating principle, core mechanism, and how miners can obtain income of Swarm are becoming more and more heated.
AI Summary
Expand
The soft launch of the Bee mainnet is imminent, and discussions in the community on the operating principle, core mechanism, and how miners can obtain income of Swarm are becoming more and more heated.

The soft launch of the Bee mainnet is imminent, and discussions in the community on the operating principle, core mechanism, and how miners can obtain income of Swarm are becoming more and more heated.

IPFS is a storage system designed to store precious data of all human beings so as to realize the perpetuity of data. Therefore, whether it is IPFS or Filecoin, its characteristic lies in storage. However, Swarm is different. Swarm mainly serves the storage of DApp data on the Ethereum network, focusing on the storage of hot data. Therefore, the focus of Swarm is on traffic.

The traffic reward mechanism is one of the core mechanisms of Swarm. Today, we will try our best to talk about Swarm's traffic mechanism - SWAP in an easy-to-understand language.

SWAP—Swarm's traffic reward

The SWAP protocol is the core protocol of Swarm. It is a point-to-point accounting protocol. Its main feature is data exchange (traffic circulation), which is divided into two parts: accounting and settlement. As stated in the white paper: "The SWAP protocol allows directly connected nodes pay each other, or offer a promise to pay".

SWAP has four characteristics:

• Account service for peers to pay each other and provide payment commitments

• Send checks when payment thresholds are exceeded, using automatic payment settlement

• Debt forgiveness in the form of uncashed checks

• Support to start nodes with zero pledge


To put it simply, when a miner joins the Swarm network and becomes a Swarm node, he will have an Owner address (this is an ETH address), and at the same time, this address will automatically generate a checkbook—a checkbook.

For example, you are node A and I am node B.

When node A transmits or stores data to node B (when the traffic of data transmission reaches a certain threshold), A will issue a check to B, which we can call a settlement. The Swarm network currently has hundreds of thousands of nodes Left and right, each data interaction and transaction between each node will be synchronized to the checkbook (Chequebook).

To understand the whole process, we must first understand the following three concepts.

  • On-chain: that is, data is on-chain. For example, when A issues a check to B, B can choose to go to the chain for settlement after receiving the check.

  • Off-chain: That is, the data is not uploaded to the chain, but stored off-chain. For example, when B receives a check issued by A, he does not upload it to the chain, and waits for a certain amount of checks to be accumulated before going to the chain for settlement.

  • Threshold: SWAP has a threshold concept. When the accumulated checks reach a certain threshold, the automatic settlement and payment function will be used. If A does not settle with B, A will be pulled into B’s blacklist, and A will Can no longer connect to B.



  • There are also relevant annotations in the above picture, green is on-chain, pink is off-chain, and the on-chain and off-chain can be switched independently.

    As shown in the figure above, when node B accumulates a certain amount of A’s checks, B sends a request to A’s smart contract for the BZZ corresponding to the settlement check (at this time, it goes from off-chain to on-chain), then, A’s checkbook The corresponding BZZ (for example, 0.5 BZZ) will be deducted, and then the 0.5 BZZ will appear in B's checkbook, that is, the income of the 0.5 BZZ belongs to B owner address.

    Then, the settlement status will also be synchronized off-chain.

    From the above, we described Swarm's traffic reward mechanism.

    The core of Swarm's traffic reward mechanism is that nodes provide traffic rewards for broadband data transmission. Every time a node transmits data, it can get a check. When the number of checks reaches the corresponding threshold, it will be automatically settled (it can also be settled actively). Then , the node can get the corresponding reward reward.

    Q&A about SWAP

    Q: Why have a check book instead of direct billing?

    A: The Swarm network is a huge traffic network, and data is transmitted between nodes all the time. It may be that node A transmits data to node B in this second, and A needs to pay fees to B. In the next second, node B transmits data to node A. At this time, B has to pay fees to A.

    This time and again, will the relationship between A and B be evened out soon?

    In addition, if all small transactions are directly uploaded to the chain and redeemed, then the network may need to redeem millions of times a day, which will undoubtedly increase the burden on the network and generate a large amount of gas fees.

    The use of checkbooks can perfectly realize off-chain bookkeeping and on-chain settlement, which not only improves efficiency, but also does not affect miners' income.

    Q: What is the penalty if the node does not pay, and how to ensure the integrity of the network?

    A: The automatic payment and settlement system is set up in the SWAP protocol, that is, when the threshold is exceeded, the smart contract will automatically send a check. As shown in the figure below, we can see that "Zero balance" is set in the system. If one party has serious "debt", it will disconnect from the node that is being connected.

    As shown above, if B does not pay, B will be labeled as "dishonest". If B continues to be unwilling to pay, B will lose connection with more and more nodes, then B will be "isolated". ", the probability of receiving orders will continue to decline.

    Q: Why do you say that the SWAP protocol creates an ecological closed loop for the Swarm network?

    A: As mentioned above, if a node chooses to "do evil" and "do not pay fees", then the node will be disconnected from other nodes. If this continues, the node will lose connection with many nodes one after another , and even be "isolated".

    If a node is "isolated" on the network, it means that the node cannot obtain orders in the Swarm network, and cannot obtain block rewards. Since it cannot obtain block rewards, what is the significance of the existence of nodes?

    To sum up, the Swarm network itself has set up a relatively complete ecological closed loop.

    And this is the core logic why it is inferred that the amount of pledge required for Swarm nodes is not large.


currency
Welcome to Join Odaily Official Community