Hey all! I’m curious to know what (if any) models for rent that Harmony may consider implementing for contract storage. For those not familiar with this topic, Raul (Prysmatic) tweeted about it, you can read more about it on ethresearch.
I think the most important thing when thinking about storage rent is what the value is for someone to “store” state for all nodes to manage. The calculation that Vitalik makes is focused on the imperative cost that a node incurs to host the extra bit of data, but not why someone would be willing to pay it.
The value of contract state storage is the non-repudiation, and infinite life cycle that can only be provided by a blockchain system (i.e. a function/object that I create will continue to exist as long as one node stays alive, and no one node has the power to delete my stateful information).
While the cost may certainly be in tune with what Vitalik wrote (though I have different ideas on how to model the “cost” of storage), the model actually goes against the apparent value that blockchain state should provide. I think this is the same problem with the gas structure as well, while it is rightfully rewarding people for compute, the fee is targeting a cost rather than the benefit that I get by having the code run on all the nodes.
I’ll just spend this first post going into an exploration of how to model the cost of state “rent.” For our purposes, however, it’s important to note that these have no effect on what “rent” will cost to a contract, it will be used to calculate market equilibrium for who should pursue state storage. If there’s interest, I’ll go into how one would calculate the optimization of contract storage, how to create a market on top of it
Vitalik chose to have a stagnant cost structure per byte - 1. “To make sure it’s not long-run possible for the state to exceed 500 GB, storing 500 GB should cost 500,000 ETH per year, so storing 1 byte should cost 0.000001 ETH per year. A 24000-byte contract would cost 0.024 ETH (~$15) per year; a 250-byte account would cost 0.00025 ETH (~$0.15) per year”
We know however that any node has a highly variate storage <-> cost value, modeled by a few factors.
State storage cost (S_c)
Opportunity cost of using memory for some other function (O_c)
Learning Curve cost of altering existing systems to fit specialized storage (LC_c)
S_c is quasi-linear due to there not being any inherent performance improvements someone could make to data storage (a byte is a byte). Most optimizations would come from economies of scale like electricity, drive maintenance, etc. Since we want to focus on letting anyone store state, it’s better to operate under the assumption that economies of scale won’t be reached.
O_c is highly dependent on node preference, but we can assume that the opportunity cost will follow an s-curve since light storage would not be noticeable, and likewise at a certain point any more additional storage won’t be noticeable either. The average hard drive will probably be around ~1 TB, so we can guess the formula will look like this:
Where b is the number of bytes stored
dLC_c(b)/db is exponential decay due to the cost of refactoring becomes less marginally intensive as , similar to:
Where lambda is decay constant
Finally, putting these all together leaves us with a dual integral function over all costs to calculate marginal cost per each byte. Clearly, we can see that state storage becomes the most costly factor at scale, but for maintaining use in smaller nodes, we have to pay attention to learning curve cost, and opportunity cost.
Good discussion William.
I think the purpose of determining of cost of hosting data on blockchain is to determine what’s the lowest possible price for the storage rent. In that sense, I am not quite sure Opportunity cost and learning curve cost affect much in determining the price of storage rent.
To me, opportunity cost is used when deciding “what to do” at the moment, but it shouldn’t be accounted for in determining the price of something I offer over the time. For example, if I have a lambo and I use it to deliver food. The opportunity cost of using my lambo to deliver food is extremely high (when you can rent it out for thousands of dollars per day), but I can’t price the food delivery so high because of my opportunity cost.
Similarly, learning curve cost seems “sunk cost” to me, which shouldn’t be the cost/price determinator over the long term. Over the long term, the key determinator is still the cost of “state storage” itself.
Focusing purely on optimizing storage cost is how you end up with current mining structures (i.e. mining pools, large mining centers, no decentralization)
No opportunity cost is factor of what else you could be doing with the storage ad infinitum, which is always used in determining a form of whether you should choose to do something or not. In the example of the lambo, the opportunity cost is not dependent on the car, it’s dependent on what else you could be doing with the car other than driving it to deliver food. You could have a date, work, whatever, that you value as more internally than to deliver food.
You’re right, learning curve is not a determinator over the long term, which is modeled in the formula I gave. It is, however, a cost that is factored in when someone first wants to begin mining, and even as someone moves to a more complicated multi-asic system. There are costs associated with discovery in how to set it up. With Harmony’s miners (potentially the investors), you have to coach and talk them through exactly what to do, and once you leave, they will have to maintain constant overwatch over it to fix any issues.