Early demand, and effect on storage costs, after launch

It won’t, the ClientManagers know how much space a safecoin will buy, so at the time of using a safecoin it may be 100Gb or whatever and as you use it you see it gets more space as the price of put drops (or should).

I hope this is what you mean. So a put is always a safecoin but could represent millions or billions of chunks. The network dynamically calculates on every store how much it is.

6 Likes

The price on fiat shouldn’t be a consideration with how the network rewards farmers.

It makes sense to a person but it doesn’t to an economy. Bitcoin is still at 300 and people still are mining, and also people were still mining when bitcoin had its greatest reward and worthless bits. additionally, there was no mountain of economic theory to reason with why 21m; people make it work. as we/they did there, so we/us will here

Safecoin affords a difference in that it will always buy a PUT with some data behind it. And I think in this the fiat denomination should not at all play a factor in how the network determines distribution and cost of bytes/safecoin.

2 Likes

@dirvine I realise the PUT cost changes, but I haven’t grasped how this works and how the various metrics behave (fiat price/user demand v PUT cost v farming rewards).

What I think I know:

  • Farming rewards depend on the amount of free space (too little reward increases, too much reward decreases). Does this effect override variations in the chance of a farming attempt succeeding (since this depends on the number of unallocated Safecoin)? It seems clear how this can work regardless of fiat price.
  • PUT costs are (as you explain) calculated on the fly - by changing the amount of storage delivered in exchange for 1 SC at the time of purchase. (Hehe, I just typed that as “putchase”! Now my copyright ;-))

What I don’t understand is how the PUT cost is calculated and how this would be affected by shifts in fiat price, since demand for PUTs will vary due to factors other than fiat price (whereas farming provision should be closely tied to it). I guess this is not finalised, but can you explain a little?

I can imagine you could vary the PUT price more slowly when the network is out of balance (too much or too little spare capacity). When out of balance, the “priority” adjustment will be farming rewards, but once the farming provision is in balance, the PUT price adjusts more quickly.

Is that along the right lines?

1 Like

https://github.com/maidsafe/rfcs/blob/master/proposed/0012-safecoin-implementation/0012-safecoin-implementation.md#establishing-farming-rate

This explains the process in a bit more detail. Let me know if this answers the questions please Mark and I will add in more info to help out.

5 Likes

Indeed it’s all there, and that’s pretty much how its been since the get-go. The space that a safecoin buys is always determined at the time when you want to store something;

I appreciate the difficulty that comes with designing these aspects of the network, but I think the NC variable (the total number of client accounts) is a bad one in this formula:

StoreCost = FR * NC / GROUP_SIZE

Compare a scenario where X amount of clients each consume on average Y amount of resources per day, with a scenaro where 5*X amount of clients each consume on average Y/5 amount of resources per day. The resource usage is the same in both scenario’s, but the StoreCost is 5 times higher in the latter than in the former.


What about this alternative:

  1. Close groups must track the total amount of SafeCoin issued as rewards, and must track the total amount of SafeCoins absorbed from PUTs
  2. Based on the amount of issued SafeCoins and the total amount of SafeCoins in circulation, a target figure of total amount of SafeCoins absorbed can be computed
  3. On every PUT, if the actual amount of SafeCoins absorbed is lower than the target figure, the PUT cost is increased, else if the actual amount of SafeCoins absorbed is higher than the target figure, PUT price is decreased.

Let’s put it in a formula. Step 1 and 2:

I = total SafeCoins issued
A = total SafeCoins absorbed
TA = target total SafeCoins absorbed
S = supply of SafeCoin (0.0-1.0)

TA = I * S

S makes sure that the rate of increase in SafeCoin supply (i.e. inflation) tapers off as we approach the cap. At the cap, S == 1.0, so then the target total SafeCoins absorbed is exactly equal to total SafeCoins issued. Since there may be times when the farming rate algorithm suddenly has to increase rewards, we probably want to keep a buffer of reserve SafeCoins for such times. If we want to keep 10% of SafeCoins in reserve, the formula becomes:

TA = I * (S + 0.1)

Step 3:

MB/SC = Megabytes bought per SafeCoin

if (TA > A) {            //fewer SafeCoins have been absorbed than we want
    MB/SC--;             //So increase the PUT price to start absorbing more of them
} else if (TA < A) {     //More SafeCoins have been absorbed than we want
    MB/SC++;             //So decrease the PUT price to start absorbing less of them
}

A great benefit of this approach is that we actually have control over inflation now. Unlike in BTC where the inflation rate is a function of time (block count), with this algorithm the inflation rate is a function of usage of network resources. More usage (growth of the network) increases the inflation rate, less usage decreases the inflation rate.

Since we start with 30%(?) of SafeCoins already in existence, I should be initialized at 0.3 * 2^32, and A should probably be initialized so that TA == A where S = 0.3.

MB/SC can be initialized at a guesstimate number, the algorithm would quickly correct it to the right value.

3 Likes

I’m trying to understand the Safecoin RFC linked above. Can anyone give definitions for:

  • primary chunk
  • sacrificial chunk
  • GROUP_SIZE

Thanks.

1 Like

Chunks are now stored as 3 groups of 2 chunks. So 1st group is primary, 2nd group is backup (in case of failure) and third group is sacrificial. The sacrificial basically has farmers holding data we don’t need. The amount of this held in relation to the number of primary chunks tell us the network storage health (balance). So basically we have 50% more data copies than needed. We can lose all of that but then it’s dangerous, so the resource balance kicks in when we see this is vanishing.

Nodes will delete sacrificial data to make room for the other types. This deletion starts to increase farming rates and as we lose more we increase the rate more (farming rate == amount of reward)

Group size is the size of the group in which data can be stored, so with a group size of 32, data can be stored on the closest node to the data and, as the group changes, it stays there (the node may no longer be closest; in probability, it will not be). If that nodes leaves or goes out of the group then the members of the group (NaeManagers) will relocate the copy to (again) the closest node. This is continuous.

I hope that helps.

7 Likes

Thanks David, I’m getting there slowly :smile:. I’m not sure what GROUP_SIZE is yet though. Is it the total number of vaults?

2 Likes

It is only the sizeof the group around any address. So 32 in our case, the closest 32 nodes to an address.

4 Likes

OK thanks, last question for tonight :smile:

I don’t understand this from the RFC:

StoreCost = FR * NC / GROUP_SIZE

Therefore a safecoin will purchase an amount of storage equivalent to the amount of data stored (and active) and the current number of vaults and users on the network.

I see that farming rate FR varies from 0 (sacrificial = primary) to 1 (sacrificial = zero)

The number of active clients that have PUT data, NC is a rapidly growing unlimited number.

If GROUP_SIZE is a constant I don’t understand its purpose, and I don’t see how the formula incorporates the total number of vaults, as indicated by the text.

Consider NC / GROUP_SIZE as a client/close group ratio. It doesn’t incorporate the total number of vaults, everything is “local” to close groups. So a close group simply counts it’s own clients to get it’s NC value.

5 Likes

50% buffer? Nice.

if sacrificial_chunks < (.5 * primary_chunks):
    increase(farmers_rewards)
else:
    decrease(farmers_rewards)

Now I begin to see how Proof-of-Resource works. There is data there, but it’s sacrificial. So the resource must always be there, otherwise the data would be gone.

EDIT: Upon further reflection, that should be 33% buffer, and the first line should be:

if sacrificial_chunks < primary_chunks

2 Likes

I would think you will find that is the total Number of clients that the group (32 nodes) has connected to it.

The client’s Group cannot know the stats on the whole network so the calculations has to be an estimate for the whole network.

So NC/GROUP_SIZE (NC/32) is the estimation for the whole network Total_network_clients_active/Total_network_nodes

FR in the equation takes into account the free space available

Personally I think that the equation will result in too low a PUT cost when spare space is plentiful, and escalate the PUT cost too fast/high when the knee point in the equation is hit. Maybe cost needs to rise quicker towards the knee point and the rise after the knee point be a tad slower. ie a flatter rise as this equation has the potential to see large changes in cost for little change in spare space near the knee point and after. But testing will hopefully show what will really happen in a larger system

2 Likes

This seems like a very good approach, if you can raise an issue against the RFC then it can get the devs debating it as well from an implementation perspective. Looks good though

7 Likes

This is not similar to my proposition of using the notion of velocity of money?

Your S==1 is the same of is constant.

And my = your MB/SC

And

if (TA > A) { //fewer SafeCoins have been absorbed than we want
MB/SC–; //So increase the PUT price to start absorbing more of them
} else if (TA < A) { //More SafeCoins have been absorbed than we want
MB/SC++; //So decrease the PUT price to start absorbing less of them
}

is

If T (quantity of PUTs) increase P should decrease for that we increase M (total safecoin).

If T (quantity of PUTs) decrease P must increase, so we diminish M (total safecoin).

The M is controlled via the rate reward.

4 Likes

Looks like it is! I didn’t base this proposal on that one, at least not consciously (looks like I did read it back then when you posted it, and looking at my comment I didn’t fully get it then hehe). I’m happy to give you all credits though if you want, I’m just glad if together we succeed in making SAFE as stable as possible.

4 Likes

People are free to surf SAFE (like using a plugin for Firefox) so than they’re client’s. So they’re in a group of max. 32 nodes and the nodes know they’re clients. But in the same group (address range) there can be Vaults than? Or are vaults in group with vaults and client’s in groups with clients? A bit confusing to me.

How would we know the total amount of Safecoin in circulation? Groups need to scan the address-range than, and share the numbers with each other?

Close groups handle farming attempts, so you can simply track the success rate of the last 100 attempts for example.