Why Does State Rent Matter

Untitled

Share This Post

In a nutshell, state rent is a fee users pay to have their accounts, data, and contracts live on a blockchain and still have fast, cheap transactions. Consider state rent like you would pay for storing data on an Amazon Web Service (S3) server. You pay for the storage on an ongoing basis and don’t get to pay just once and have your data live there forever.

While this is a very intuitive concept, have you ever wondered why in all your time in crypto, you’ve never been asked to pay to have an account or store your NFTs continuously?

This is because the blockchain industry has a bit of tunnel vision currently–it is only focused on scalability and mass adoption. But scalability is only one of three major problems, as seen through the lens of the Blockchain Trilemma. Neither Bitcoin nor Ethereum has offered solutions that have been proven over time.

While 2022 has been focused on accelerating scaling solutions like Optimistic Rollups, Zero-Knowledge Rollups, and sidechains, a quiet problem that threatens the security and decentralization of all growing blockchains. This problem is called state bloat or state explosion.

State explosion occurs as more and more information is added to the blockchain. Since each node on the blockchain is required to store and process this information, processing times slow, storage requirements increase, and the cost to operate a full node becomes more expensive.

One day there will be billions of people relying on blockchains to do everything from buying a coffee at Starbucks on Earth to transferring ownership of physical real estate on Mars (you wait!). This article covers why state rent and other techniques matter as they relate to that inevitable day when state explosion is a problem that can no longer be ignored.

The problem will, therefore, only begin to appear after blockchain solves its scalability problem(s) and achieves rapid growth and adoption. So it is understandable that people today are focused on scalability first — but that does not mean the State Explosion challenge should be ignored.  -Jan Xie

The Tragedy of the Commons

The ‘tragedy of the commons’ is another way of saying humans are greedy.  Put simply, people, when they can, will consume resources at the expense of everyone else.

Sound familiar?

It was initially proposed by William Forster Lloyd in 1833 (then revised by ecologist Garrett Hardin in 1968) when he wrote about what would happen if every shepherd, acting in their own self-interest, allowed their flock to graze on a common field. We all intuitively know the answer–all the grass would be eaten and the field destroyed. Ironically, this process ensures the shepherd doing the over-consumption is hurt as well. Economically speaking, it also raises the concern of under-investment–who will pay to replant the field?

Lloyd and Harden offered no solutions to these problems. Instead, those in power used privatization, regulations, and top-down governance to manage (eh-hem, bandaid) the problem. Look at where we are today. From the banking crisis of 2008 to the recent FTX collapse to hunger and global warming, we are waking up to the reality that the centralization of anything is problematic.

Some might argue that the free market is still the answer. But the problem is that power is always consolidating and becoming more centralized over time. Think about the major legacy news outlets. There are now just three major news networks-Fox, CNN and MSNBC!

Consolidation of news into a few corporate-controlled news outlets means less local news, which means your concerns are less reported on, and thus less addressed. Like in a 51% attack, these companies could easily band together to deliver a coordinated “attack” on the public by sharing misinformation, disinformation, or even targeted information to drive public consensus.  These companies, like larger fish consuming all of the smaller fish, won’t stop until there is nothing left to swallow.   Profit incentives are always at the heart of the abuse of the commons.  Let’s look at why with another fish example.

Take the world’s fish stocks, for example. According to the FAO, about 60% of the world’s fish stocks are fished, 33% are overfished, and only 7% are underfished. This tells you everything you need to know about how private companies could care less about their sustainability. If left to themselves, they won’t stop until no fish is left.

How about regulating the markets? There are at least two significant problems with regulations operated from a centralized, top-down structure. One is NIMBY, and the other is Rent-Seeking. Let me explain.

With “not in my backyard” (NIMBY), you desire improvement but don’t want to risk anything. For example, you might want fewer homeless people, but you’d like them nicely tucked away somewhere your home value won’t be driven down. You may want a new airport but would like it across town. You get the idea.

According to Study.com, rent-seeking is “obtaining economic advantages and increasing profits through manipulative means, then failing to improve the economy productively.” This can involve lobbying the government for loans, subsidies, grants, social securities, tariffs, and licensing requirements. Ultimately, this kind of behavior produces inequality in income, loss of government revenue, unfair market competition, and discourages innovation.

The most epic example of rent-seeking is the 2008 financial crisis. We witnessed the pathetic state of affairs where banks took excessive risks to gain excessive returns, failed, then were bailed out with YOUR tax dollars. Not only did this NOT help you in any way (although you were told these banks were too big to fail), this gave them an unfair advantage over cautious competitors. Through this form of rent-seeking, they coerced the public into paying for their failure. Instead of adding value, they took it away.

To summarize, top-down solutions often don’t work because they are always too far from the problem to properly know how to solve it. Economist Partha Dasgupta at the University of Cambridge in the United Kingdom says it best,  “States lack the information acquired by local users over thousands of years.” Sending round a bunch of bureaucrats to look at the problem was often not very useful.”

Next, we look at how the tragedy of the commons relates to the blockchain by identifying the state and what it means in this context.

What is State?

State refers to the digital assets, data, accounts, and smart contracts available when asked. This means that there are two components to every state discussion:

  1. State – the current data in use.
  2. History – past data, no longer in use.

The state can be updated and changed, but history is immutable and cannot. When we say immutable, we only refer to history, not the state. As time moves forward and blockchains grow, the state grows with it.

Blockchains preserve their state and history in innumerable ways, and while we won’t go into each, this article discusses in detail how Bitcoin and Ethereum do it. It is worth noting that some blockchains, like Bitcoin, always require full nodes to store history and state. Ethereum, however, has many different modes which allow for different strategies.

In Ethereum’s archive mode, all state and history are saved, which, when combined, is over 2 TB of data. Under default mode, the historical state is pruned, with only transaction history and current state stored. This results in a total data size of about 170 GB, where transaction history represents about 160 GB and the current state about 10 GB.

The main takeaway is that regardless of what blockchain you are referencing or what mode the node is using growth is, at best linear and, at worst, exponential.

What Does State Explosion Matter?

As we just illustrated, state explosion refers to the incessant growth of a blockchain and the data it stores across its distributed network of nodes. Bitcoin has more of a linear growth rate, whereas Ethereum is exponential (see the chart below) because of all the various types of data and smart contracts that can be written to it. The current Bitcoin state size is 442.69 Gigabytes, and Ethereum’s current state size is 1.07910 Terabytes.

Untitled

Figure – Showing Ethereum’s Exponential Growth Source

Bitcoin has grown from 0 to 3GB in 10 years, but Ethereum has gone from 0 to 10GB in 4 years. In 2017, there was a prediction that Ethereum would hit 1000 Gigabytes. It predicted a 700% increase in size from 2017 to 2018, which also was accurate. If we use just a 500% growth rate annually, we’d expect Ethereum to hit 55000 Gigabytes (55 Terabytes) by 2032!

This matters because every single full-node operator must pay for this state size increase by obtaining the proper hardware and resources necessary to continue their mining or validation operations. The real issue is that the users of this space only had to pay a one-time payment. Afterward, they get permanent usage rights to a storage system distributed across countless nodes, which essentially pay the “rent” for the user.

The end result is miners and validators shut down operations because they can’t afford to operate. With fewer operators mining and validating, we have a less decentralized and, thus, less secure network.

Let’s look at an example of one-way state bloat is occurring unnecessarily. Below are the top 5 smart contracts ranked by storage on block 5700001 (May 30, 2018):

  1. EtherDelta, 5.09%
  2. IDEX, 4.17%
  3. CryptoKitties, 3.05%
  4. ENS, 1.92%
  5. EOS Sale, 1.73%

EOS had a sale and needed some space to transfer tokens. The sale has ended, but what happened to that 1.73%? The answer-nothing. This storage space used for the EOS sale will continue living on indefinitely, wasting disk space on every node in the network. This cost is not only in size but also in the length of the occupied time. It is just like the debt owed on a credit card as interest accrues- the longer you hold that debt, the more you could have used it for other, more valuable ventures.

The tragedy here is that just like the shepherd wanting to participate in feeding his flock but finding there is nothing left of the common resource (grass), the miner wants to secure the network and be rewarded but finds that the cost of the common resource (storage space required for full node operation) is too great.

So what can be done?

Solutions to State Explosion

Untitled

Earlier, we differentiated states from history as present vs. the past. This is important because, relatively speaking, it isn’t too challenging to handle historical data. Many techniques, like decentralized checkpoints and zero-knowledge proofs, can handle this. The more challenging problem is handling the accumulation of the current state.

There are several different approaches, each with its own twist. Let’s look at a few:

Bitcoin

Compact State Nodes – While not the only approach being tested, one example of a scaling approach is Utreexo’s use of a hash-based cryptographic accumulator. Essentially, this introduces a new type of node, called, the Compact State Node”, which stores only an accumulator representation of the state. These nodes require additional proofs before they can verify transactions, and while the CPU time cost of this verification is small, the network bandwidth of these proofs is a trade-off made to achieve the lower state size.

Ethereum

Sharding: split the storage space into separate shards, which all report to the main (beacon) chain. Each shard will maintain its own state and transaction history. In this way, a validator only needs to maintain their shard. Currently, Ethereum has implemented 64 shards  (caveat: this may not always be the case going forward, for instance, a hard fork could increase the number of shards), thus reducing the storage requirements substantially.

State expiry: remove portions of the state that haven’t been accessed during a specified period. For example, an address that hasn’t been used in the last 12 months could be removed. There would be a need to revive the expired state and prevent permanent data loss. It is thought that the minimum viable state needed to operate a full node would only be ~20-50 GB with state expiry.

Weak statelessness: only require block proposers to store state and validate blocks. All other nodes would not need to store state. to store state and allow all other nodes to verify blocks statelessly. Implementing this in practice requires a switch to Verkle trees to reduce witness sizes.

Prepaid rent: require users to prepay a lump sum of rent for storage space. The longer the user takes up space on the network, the more the rent would be tapped, eventually going to zero. But that brings up some questions:

  • What to do when the lump sum is used up?
  • What about shared smart contracts which share many users? Who should pay the rent, especially when many of these users are no longer active?

More on Ethereum’s approach can be found here.

Solana

Time-and-space Rent: Require users to have two years’ worth of rent paid when setting up new accounts. Each time a transaction is requested, which would bring the account balance below the minimum, fail it. Make all users who hold at least two years’ worth of rent exempt. The two years come from hardware dropping by 50% every two years.

More on Solana’s approach here.

NXT

Blockchain Shrinking – Periodically create an entirely new blockchain with a new genesis block. Make the old blockchains available for storage by nodes if they choose to, but pay them an extra for doing so. These historical blockchains would be used for validation in the typical sense but now are consolidated amongst just those nodes that opt-in.

More on the NXT blockchain shrinking approach here.

Arbitrum

Slash Bad Actors: Assume that transactions submitted by block producers are accurate and honest. Provide a seven-day window for network participants to identify and challenge fraudulent transactions. Have these same participants post collateral that would be slashed if dishonest actions are detected. This approach doesn’t handle state explosion normally but just discourages intentional damage by bad actors.

On Ethereum, for instance, before November 22, 2016, it was possible to add very large smart contracts to execute a Denial of Service (DOS) attack, Later, Ethereum decided to cap smart contract sizes to a limit of 24.576 kb to prevent this kind of behavior. On Arbitrum, had this kind of attack been done, the attacker’s collateral would have been confiscated.

More on Arbitrum and their slashing approach here.

RSK

Transaction-Based Rent Payments: have users pay rent with each individual transaction, proportional to the target contracts’ last inactivity period and current storage consumption. The decision to use transaction-based payments came after RSK research concluded that fixed-length rent payments were too complex. RSK also uses cache eviction, which means moving the contract data to a storage device with lower access time, and removing it from a faster, more expensive memory. For example, high availability contracts could be kept in RAM, while infrequently used contracts are moved to SSD storage

More on RSK network here.

Accumulate Network

Root Anchoring & Data Distribution: Store the state of one network as a hash on another network, and distribute data across multiple chains.

According to Accumulate author TJ, “With Anchoring, a cryptographic proof or hash containing batches of transactions from an Accumulate account chain is inserted into another chain like Bitcoin or Ethereum and validated by miners on those networks. Anchoring is important in keeping the many chains on Accumulate in sync. It also enables the network to store data on other chains outside of the Accumulate network to mitigate state bloat and to also provide additional security guarantees.”

More on Accumulate Network and Root Anchoring here.

CODA Protocol

Compression: Use zk-SNARKS to compress the size of the blockchain. zk-SNARKs can compress the entire blockchain to a fraction of the size of traditional blockchain ledgers. Amazingly, the chain compresses the state of the entire blockchain to just a 1 KB zk-SNARK proof.

This proof represents the authenticity of the state, enabling nodes not to store the entire blockchain. The only thing needing storage is a small amount of data which allows a path from the proof to each user’s account.

More on CODA protocol here.

Hedera:

Renewal Fees: Charge a smart contract a renewal fee proportional to the amount of space it takes up on the blockchain. Hedera will allow rent to be paid in two different ways:

  1. Self-funded. Renewal fees are paid by the hbar (native Hedera token) held by the smart contract.
  2. [Not yet enabled] External funded. Hbars from a defined Hedera account can pay a smart contract’s renewal fees

What happens when it is time for renewal? First, the network will attempt to renew the contract by charging it the renewal fee based on a configurable ~30-90 day renewal time period.

If the auto-renewal attempt fails, an expired status is applied, and a grace period begins. The grace period will disable the smart contract but not remove it from the ledger. This allows it to be still renewed. A 30-day grace period will likely be implemented. After expiration, the smart contract would permanently be deleted.

Learn more about Hedera and Renewal fees here.

Learn more about the proposed implementation here.

Ergo

Storage Rent: Pay ~0.14 ERG (native Token on ERGO) every four years from the last transaction you made. If a rent fee cannot be collected due to a lack of funds in the contract, the miner can claim everything in a contract (including tokens and NFTs). These rules apply to each address in a wallet that contains an asset.

For users, the incentive here would be to reduce the number of wallets holding assets, thus saving storage on the Ergo network. As long as accounts are used within a 4-year period, they avoid the process of miners reclaiming their tokens and assets per the protocol just mentioned.

This action’s side effect is that miners can ultimately recover lost tokens and put them back into circulation. Keeping coins in circulation helps reduces the deflationary effect of lost coins.

Learn more about Ergo and storage rent here.

EOS

Storage Purchase: Have users directly buy bytes of storage (EOS calls this RAM) at market price. When the user no longer needs the storage, exchange the RAM for EOS.

The design of RAM utilizes a free market design that has some issues. Firstly, RAM is traded through a built-in trading market, which is always susceptible to market manipulation. In addition, RAM is not transferable, and cannot be rented, which means user assets have no available mechanism to appreciate in value over time.

Read more on the idea of pricing storage separately from execution here.

XRP

Discardable history and “reserve” system: History is discardable using a ledger design. This means participants can choose not to keep XRP history stored as part of their full nodes.  Today, most servers only keep a few months of history.

XRP also uses a “reserve” system to discourage people from increasing the size of the ledger. This is done by requiring 20 XRP to be locked up in reserve when accounts are created, discouraging the creation of large numbers of accounts.

Nervos Network and State Rent

Let’s describe stat rent through an analogy. Nervos makes the storage space of the blockchain like land, it’s limited, and to use it (store data), you have to own $CKB (1 CKB = 1 byte). This “state-focused” economy encourages developers and users to efficiently use the blockchain’s storage, one of its limited resources.

Instead of mandating periodic rent payments from users, Nervos imposes rent through targeted inflation. When CKBytes are utilized to store data on-chain, an “inflation tax” is paid by those holders to miners through issuance. Long-term holders looking for a store of value can shield their CKByte holdings from this inflation by locking them in the Nervos DAO.

You might be surprised that Nervos is better situated than Ethereum when handling the problem of state bloat. Let’s start off right away by saying that Ethereum’s Account model produces problems that Nervos (and other UTXO blockchains) do not have, as it relates to state. For example, with the account model, users can, and often do, share smart contracts. So questions arise immediately.

  • Who is responsible for payments when you have one smart contract and N users?
  • How do you continually collect rent from your users?
  • If the state rent isn’t paid, the contract could get archived, so how would users gain access?
  • Data on Ethereum is rarely removed since there is no incentive to do so, even if you stopped using a potential contract. Bloat can run rampant. How do you control this?
  • If data isn’t removed, active users carry the burden of state rent for all users, including old users who have stopped using the contract but still have data there. Why should only some users have to pay for the common usage of the smart contract?

In this article, we haven’t discussed the Nervos cell model, but let’s just say that the state rent problems mentioned above are all addressed by design. State rent becomes the user’s full responsibility, giving them greater control of their assets. With the cell model, there is no mixing, and thus sharing, of state rent with other users.

No need for complex, elaborate designs that just introduce additional attack surfaces. Nervos state rent is intuitive, simple, and most accurately matches digitally how we already operate physically.

Learn more about how Nervos Network Uses State Rent to Control State Explosion here.

Conclusion

In this article, we covered why State Rent Matters by exploring the so-called, ‘tragedy of the commons whereby greed destroys all, including the one being greedy. We then mapped this onto blockchain technology as we explored the state and state explosion concept.

We then introduced the idea that the state of a blockchain can be viewed separately from its history.  This separation has given rise to many approaches to deal with state explosion, everything from pruning to blockchain shrinking, to compression with zk-Snarks, and finally, the idea of state rent.

The exciting thing is that blockchain is growing, but as the focus has been primarily on scaling and mass adoption, we see that problems are lurking around the corner. State explosion increases the cost of operating a full node, which reduces the number of network participants. Fewer participants mean a less decentralized and, thus, less secure network.

Luckily, we are not near the ubiquitous use of cryptocurrency and blockchain, so we have time to solve these problems, and many projects are doing a brilliant job.

Exported with Wordable

More To Explore

Image1
Blockchain Professional

My 1st Experience With Tenderly – A Guest Blog

A Guest Blog by Travis Richardson In blockchain development, where every transaction carries real value and network fees can be costly, ensuring smooth and error-free

NFTs and Mass Adoption
Blockchain Professional

NFTs and Mass Adoption – A Report

Introduction The cryptocurrency world has rapidly evolved over the past few years, with NFTs emerging as one of the industry’s most exciting and promising developments.