As Ethereum usage increases, running a full node becomes more resource- and bandwidth-intensive. This results in fewer and fewer people being able to run a full node, reducing the decentralization of the network. Additionally, as transaction demand increases, Ethereum faces difficulties in scaling, leading to network congestion and high gas fees.

Register with the three major cryptocurrency exchanges (copy the link and open it in the browser)

https://www.communityrebate.com

Stateless clients, proposed by Vitalik in 2017, offer a potential solution to the decentralization challenges facing Ethereum. The key idea of ​​stateless clients is to reduce the storage and bandwidth requirements needed to run a full node, enabling more people to participate and decentralizing the network. This article will take a deep dive into how stateless clients work and their potential pros and cons.

What is the Ethereum state?

To understand stateless clients, we first need to understand the concept of "state" in Ethereum. The Ethereum state refers to the current state of all accounts, contracts, balances, nonces, and storage in the Ethereum world. It can be thought of as a database that stores all relevant information about the Ethereum network at a given point in time.

The state is persisted in the form of a Merkle Patricia trie, which is essentially a modified Merkle tree for storing key-value pairs. The root hash of this trie summarizes the entire state. With each new block, the state is updated based on the transactions in that block. The new state root hash is included in the block header.

Over time, as more and more accounts, contracts, and transactions are added, the state of Ethereum becomes increasingly large. Currently, the size of the state is over 1TB, increasing by tens of GB every year. This ever-growing state is the root cause of the decentralization problem.

Why state growth causes problems

The increase in Ethereum state size leads to some key issues:

● Long sync time for new nodes - It takes a long time for new nodes to synchronize all historical state changes. This increases the difficulty of running new full nodes and hinders decentralization. It currently takes multiple days or even weeks for new nodes to synchronize from the genesis block to the latest state, which is a major obstacle to effectively launching new nodes and allowing more participants to join the network for consumer hardware.

● Increased hardware requirements - Larger states require more storage, memory, and processing power to store, access, and update. This makes it prohibitive for users with fewer resources to run nodes. Running a fully synchronized Ethereum node now requires at least an SSD with 1-2TB of capacity. This is out of reach for many potential node operators.

● Increased bandwidth usage - The broadcast of a new block must also include the updated state, requiring more bandwidth. This increases costs for node operators. Currently, state dominates most block broadcasts, so block sizes are growing. More bandwidth translates into higher costs for node operators.

● Slower block verification - Reading and updating a larger state makes block verification slower, limiting transaction throughput. Each transaction requires multiple reads and writes to storage to update balances, nonces, contract status, etc. A larger state means more reads/writes per block, reducing the number of transactions that can be processed per second.

● Permanent storage cost - Once data is added to the state, it must be stored permanently. This leads to unbounded state growth. There is currently no mechanism to actively delete old and unused state data. Therefore, as long as Ethereum continues to run, the state retention cost will increase indefinitely.

What is a stateless client?

Stateless clients provide a way to verify new blocks without requiring access to the full Ethereum state. They utilize cryptographic proofs called "witnesses" to prove the validity of state changes in a block without requiring specific state data.

A stateless client works as follows:

1. The client only stores the block header and state root, not the complete state data. The block header contains metadata such as the root hash of the state trie after processing the block.

2. When validating a new block, the client receives a "witness" along with the block. This witness is a set of Merkle proofs that prove that a specific state update in the transaction is valid.

3. The witness contains a Merkle proof of a specific state value used to process the transaction. For example, an update to an account balance or contract storage.

4. The client uses the witness to ensure the validity of the transaction against the last known state root. The proof verifies that the state change matches the previous root.

5. If valid, the client updates to the new state root provided in the block header. This new state root will be used to verify the next block.

By using witnesses to verify state, rather than storing the full state locally, stateless clients gain several advantages:

● Very fast sync times — no need to fully sync historical state changes. Stateless clients can sync almost instantly, with only block headers required.

● Low storage requirements — The state root is only 32 bytes. Instead of hundreds of GB of state, only the block headers are needed.

● Less bandwidth usage — only block headers and witnesses are transmitted, not the full state. Bandwidth usage is minimized.

● Fast verification - witnesses contain only a small subset of relevant state. Only proving that accounts/storage have been updated is useful.

● Easily supports light clients - light clients can easily verify proofs. The light client model is very compatible with stateless verification.

Challenges of stateless clients

While stateless clients bring some significant benefits, there are also some significant technical challenges:

Witness size - witnesses may be too large to be transmitted efficiently. If full Merkle proofs are used, they may exceed the block size limit.

● Witness creation — Generating the best witness is complex for a block proposer. The proposer must assemble the correct proof fragments to verify each transaction.

● No witness incentives - There is no direct reward for providing a witness. Unlike mining, there is no built-in incentive for witness creation.

● Temporary data - witnesses prove the state at a certain point in time and need to be regenerated. Witnesses cannot be reused during state evolution.

● State storage - Someone still needs to maintain the complete state to generate witnesses. Stateless verification relies on stateful witness generation.

● Complex applications - some contracts may depend on a large subset of the state, making the witness bloated. For example, a contract that updates many storage slots per transaction.

Possible solutions

Researchers have proposed various solutions to address these challenges:

● Verkle tree - a special data structure used to reduce witness size. Verkle trees use concise cryptographic commitments to minimize proof size.

● Witness cache - The proposer can maintain recent witnesses for reuse. Caching witnesses that may be useful again can amortize the creation cost.

● Protocol Incentives — Rewards for providing useful witnesses. New incentive structures can compensate for the creation of witnesses.

● Intermediate state roots - Track roots over time to avoid regenerating witnesses. Maintaining partial roots allows reuse of witness fragments.

● State rent - requires payment to maintain state over time, pruning unused state. Rent enforces cleanup of obsolete storage to limit proof size.

● Partitioned witness model - Split state processing between proposers and validators. Some dedicated proposer nodes generate witnesses.

There are trade-offs between these approaches, and further research is needed to discover the best implementation. Fortunately, rapid innovation in the field of zero-knowledge cryptography may bring new possibilities for efficient stateless clients.

Potential impact

If technical obstacles can be overcome, stateless clients could significantly boost Ethereum’s growth:

● Faster synchronization and verification to support higher transaction throughput. Stateless verification will greatly speed up block processing.

● Reduce the resources required to run a node, increasing decentralization. Laptops and hobbyists can realistically run full nodes.

● Better support for light clients such as mobile wallets. State proof is highly compatible with the light client model.

● Smoother introduction of sharding, stateless verification between shards. Cross-shard transactions can utilize efficient state proofs.

● The ability to remove and prune old state data that is no longer useful. State growth can be actively managed instead of growing indefinitely.

● Node operators have more flexibility to customize state based on their needs. Nodes can customize state retention strategies based on use cases.

● Transition to a model where compute and bandwidth are more important than storage. The architecture changes to a more cloud-friendly model.

There are also some potential risks, such as increased vulnerability to DDoS attacks and only a few node operators reliably storing blockchain history. However, cryptographic proofs can reduce these risks. Overall, stateless clients are one of the most promising ways to overcome Ethereum's current limitations.

in conclusion

As adoption increases, Ethereum's growing state size poses a challenge to decentralization. Stateless clients offer a solution by enabling nodes to verify transactions without requiring the full blockchain state. This could eventually enable mobile phones to run Ethereum nodes, greatly increasing decentralization. #DeFiChallenge