Introduction of the Light Client for DApp developers
The Light Client Revolution: Unlocking Ethereum's Potential for DApp Developers
As the Ethereum ecosystem continues to evolve, developers are faced with the challenge of creating scalable and efficient decentralized applications (DApps) that can accommodate the growing demand for blockchain-based solutions. One key innovation that has the potential to revolutionize the way DApps interact with the Ethereum network is the Light Client. In this article, we will delve into the world of Light Clients, exploring their current limitations, performance considerations, and future improvements.
Current Limitations
While Light Clients offer a more efficient and scalable way to interact with the Ethereum network, they also come with some inherent limitations. One of the most significant limitations is the inability to receive pending transactions from the main Ethereum network. Light Clients can only receive pending transactions that have been created and sent from that client. When a Light Client sends a transaction, it starts downloading entire blocks until it finds the sent transaction in one of the blocks, then removes it from the pending transaction set.
Another limitation is the difficulty in finding transactions by hash. Currently, you can only find locally created transactions by hash. These transactions and their inclusion blocks are stored in the database and can be found by hash later. However, finding other transactions is a bit trickier. It is possible to download them from a server and verify the transaction is actually included in the block if the server found it. Unfortunately, if the server says that the transaction does not exist, it is not possible for the client to verify the validity of this answer.
Performance Considerations
Request latency is a key performance parameter of a Light Client. The only thing a Light Client always has in its database is the last few thousand block headers. This means that retrieving anything else requires the client to send requests and get answers from light servers. The Light Client tries to optimize request distribution and collects statistical data of each server's usual response times in order to reduce latency. Latency is usually in the 100-200ms order of magnitude, and it applies to every state/contract storage read, block, and receipt set retrieval.
Searching for events in a long history of blocks is also a challenging task for Light Clients. Full Clients employ a so-called "MIP mapped" bloom filter to find events quickly in a long list of blocks. Unfortunately, using a MIP-mapped filter is not easy to do with a Light Client, as searches are only performed in individual headers, which is a lot slower.
Memory, Disk, and Bandwidth Requirements
One of the advantages of Light Clients is that they do not need a big database since they can retrieve anything on demand. With garbage collection enabled (which is scheduled to be implemented), the database will function more like a cache, and a Light Client will be able to run with as low as 10Mb of storage space. Note that the current Geth implementation uses around 200Mb of memory, which can probably be further reduced. Bandwidth requirements are also lower when the client is not used heavily. Bandwidth used is usually well under 1Mb/hour when running idle, with an additional 2-3kb for an average state/storage request.
Future Improvements
Reducing overall latency by remote execution is one of the potential improvements that can be made to Light Clients. Sometimes it is unnecessary to pass data back and forth multiple times between the client and the server in order to evaluate a function. It would be possible to execute functions on the server side, then collect all the Merkle proofs proving every piece of state data the function accessed and return all the proofs at once so that the client can re-run the code and verify the proofs.
Verifying complex calculations indirectly is another area where improvements can be made. One of the main limitations that we are working to improve is the slow search speed of log histories. Many of the limitations mentioned above, including the difficulty of obtaining MIP-mapped bloom filters, follow the same pattern: the server (which is a full node) can easily calculate a certain piece of information, which can be shared with the Light Clients. But the Light Clients currently have no practical way of checking the validity of that information, since verifying the entire calculation of the results directly would require so much processing power and bandwidth, which would make using a Light Client pointless.
Fortunately, there is a safe and trustless solution to the general task of indirectly validating remote calculations based on an input dataset that both parties assume to be available, even if the receiving party does not have the actual data, only its hash. This is the exact case in our scenario where the Ethereum blockchain itself can be used as an input for such a verified calculation. This means it is possible for Light Clients to have capabilities close to that of full nodes because they can ask a light server to remotely evaluate an operation for them that they would not be able to otherwise perform themselves.
Conclusion
In conclusion, the Light Client revolution has the potential to unlock Ethereum's potential for DApp developers. While there are some limitations and performance considerations to be aware of, the future improvements being made to Light Clients will make them an even more efficient and scalable way to interact with the Ethereum network. As the Ethereum ecosystem continues to evolve, it will be exciting to see how Light Clients are used to create new and innovative decentralized applications.
Implications
The implications of Light Clients are far-reaching and have the potential to impact the entire Ethereum ecosystem. Some of the potential implications include:
- Increased scalability: Light Clients can handle a much larger number of transactions and interactions with the Ethereum network, making it possible to create more complex and scalable decentralized applications.
- Improved performance: Light Clients can reduce latency and improve performance, making it possible to create faster and more responsive decentralized applications.
- New use cases: Light Clients open up new use cases for decentralized applications, such as real-time data processing and machine learning.
- Increased adoption: Light Clients can make it easier for new users to join the Ethereum network, increasing adoption and making it more accessible to a wider range of users.
Overall, the implications of Light Clients are exciting and have the potential to shape the future of the Ethereum ecosystem.
Source: https://blog.ethereum.org/en/2017/01/07/introduction-light-client-dapp-developers




