Building a Sovereign Internet with Chia Data Layer

Michael Taylor
5 min readJan 30, 2023

Introduction

A sovereign internet is one where individuals have control over their digital space and are not dependent on centralized authorities or intermediaries to access and share information. This includes having control over personal data, privacy, and the ability to publish and access content without censorship or interference. A sovereign internet prioritizes decentralization, privacy, and security, enabling users to fully exercise their freedom of speech and expression. In essence, it is a web where individuals have full autonomy and control over their online presence.

The Chia Network Data Layer could potentially create a new protocol to replace the current Hypertext Transfer Protocol (HTTP) by leveraging its decentralized and secure features. The Chia Datalayer’s peer-to-peer communication capabilities and ability to store and exchange data could provide a more robust and censorship-resistant alternative to the current centralized system of HTTP. This new protocol could offer improved speed, security, and reliability for data exchange, allowing for the creation of new applications and services not currently possible with HTTP.

Implementation Proposal

This proposal outlines the development of a new protocol, distinct from the commonly utilized HTTP protocol. To identify resources, the prefix “chia://” will be utilized instead of the traditional “http://”. The resource identifier will be a singleton ID for a data layer store. The browser will subscribe to the identified store ID, ensuring it is in sync, before rendering its contents as a web page, provided that the store abides by the defined data structure specification.

This proposal acknowledges that until common browsers have native support for this protocol, a browser extension will need to be developed. The browser extension will be responsible for several key functions. Firstly, it will need to store the RPC URL to the user’s local Chia node. Although it may be possible to connect to a remote node provided by a central service, it is strongly encouraged that users run their own local node to maintain full sovereignty over their internet usage while utilizing this protocol. Connecting to a local node should be the default option to promote this behavior.

Next, the browser extension will need to intercept URL requests and determine the protocol being requested. Upon detection of the “chia://” prefix, the browser extension will halt any redirect attempts or timeouts and extract the singleton ID from the request. The browser extension will then direct the local node to promptly subscribe to the store, downloading its contents locally into a sandboxed environment.

The data layer is capable of storing binary data in hexadecimal format, allowing for a comparison to Amazon Web Services S3 where a data store can be viewed as an S3 bucket and key/value pairs as S3 objects. This analogy is useful for those experienced in serving static Single Page Applications (SPAs) from an AWS Bucket as it makes it easy to visualize how one might store and serve an SPA in a similar manner.

After the store is synced, the browser extension will convert the objects from hexadecimal format to local files on the user’s machine. The final task for the browser extension will be to initiate a local HTTP server. Once all the files have been decoded and stored in a temporary sandbox folder on the user’s machine, the entire folder will be served by the local HTTP server. As long as an “index.html” file is present, the SPA will be accessible within the browser.

The data store in this scenario would have a well-defined structure to ensure compatibility with the chia:// prefix and allow for seamless data retrieval and display. This structure could include information such as the HTML structure, CSS styles, and JavaScript code, similar to a traditional web page.

Visualization of how a singleton can be structured to serve a SPA

Tools Needed

It is feasible to create a CLI tool or NPM package that simplifies uploading SPAs to the datalayer. The tool would require commands to create new data stores and traverse the build directory to convert each file into hexadecimal format and write it to the store. The key for each file would follow the format “/path/filename.ext”.

The process would be streamlined and accessible to developers, enabling the creation of decentralized web applications on the Chia network with ease.

Data Availability Considerations

In this scenario, serving a single page application directly from the Chia Datalayer would require the upkeep of the owner’s Chia node to remain active and connected to the internet. However, the browser extension for the SPA could include an option for users to mirror the data store, which would ensure the SPA’s availability even if the original store owner goes offline. As the popularity of the SPA grows, it is likely to reach a critical mass of mirrors, which would ensure that the SPA is always available.

For smaller players who may not have the resources to maintain uptime, there could be an opportunity for data mirroring services to emerge. These services would offer to mirror the data store for a subscription fee, ensuring full uptime until the critical mass of mirrors has been reached.

What comes next

This article focuses on how single-page applications can be delivered to the browser directly from the Chia Datalayer. However, serving the backend of the application on the datalayer and allowing the SPA to communicate with it is a separate topic that will be addressed in a different article. The future development of the “chia://” protocol could also include the establishment of an uninterruptible nameserver on the datalayer that uses hostnames to resolve into data store IDs.

Conclusion

The Chia network has the potential to revolutionize the internet as we know it. By empowering individuals to be in control of their digital space, the network enables the creation of a decentralized and more equitable web. The development of the “chia://” protocol represents a major step towards realizing the promise of Web3 and bringing about a more democratic and accessible internet. This shift has the potential to impact society in ways that are not yet fully understood, but the sovereignty of one’s digital space is a positive development that can bring about a more just and equal society.

--

--