...by Daniel Szego
quote
"On a long enough timeline we will all become Satoshi Nakamoto.."
Daniel Szego

Saturday, July 28, 2018

Blockchain and the storage cost structure


Blockchain is a pretty costly storage mechanism. The reason for that is that everyhing that is somehow a state variable is stored in the blockchain practically forever, including all of the previous versions as well. For this reason systems like Ethereum explicitly discourage storing too much information in the blockchain, like with the gas value of the storage variables (initializing a new storage variable costs 20.000 gas, whilst modifying state variable costs 5.000 gas, so practically, these operators are among the most expensive ones). 

The model could be however fine tuned as not every variable is necessarily needs to be stored forever in the blockchain with every modification forever. There might be situations as we say that the variable can have a lower security, saying if we have consistent values that are stored in the last couple of hundred blocks, that might offer enough security for a given use-case. Actually, if have consistent values for a couple of hundreds of blocks, it is not so easy to hack or fork. Like considering a long range or forking attack with proof of work, it is almost as much impossible to start a long range attack from the genesis block, recalculating practically all of the hashes as it is difficult to start a forking attack from a state that 100 blocks in the past. 

As a result, blockchain models should be more fine-tuned, allowing for the application developers to specify how much security is set to a certain variable. Certainly, lower security state variables might be much cheaper than the high security ones.