Recently, an event made me rethink traditional domain access services. We have always considered domain resolution services to be very stable, yet they can also encounter issues. This led me to wonder if decentralized solutions might be a worthwhile alternative to explore.
After some thought, deploying a webpage on the blockchain could have the following benefits:
Decentralization: All modifications require collective agreement, and no single entity has the final say.
No certificates needed: Since blockchain itself uses encryption technology, there is no need for additional certificate configurations.
I had previously seen the domain solution on TON and thought it was just a fun idea with limited practicality, as traditional access methods are already stable and widely used. However, upon reflection, there may indeed be situations where it could be useful, so I plan to study it further.
Creating a Website on the Blockchain
This article will attempt to deploy a website on TON, allowing users to access the page through their browsers. The process is divided into three steps: 1. Purchase a domain; 2. Prepare the front-end page; 3. Bind the page to the domain.
The concept of domains in the blockchain is similar to that in the WEB2 world; both serve as aliases for complex, hard-to-remember addresses. In the blockchain, it represents the user's address, while in WEB2, it represents the service's IP address.
Purchasing a Domain
Taking TON as an example, the official purchase address for domains is https://dns.ton.org/, priced in TON. Similar to WEB2, shorter character domains are more expensive, with prices ranging from 1 to 100 TON.
If the domain is not owned by anyone, you can bid at a low price, and after bidding, a countdown begins during which everyone can compete until the countdown ends. After winning the bid, the domain will be stored in the user's wallet as an NFT. Domain NFTs can be traded. The validity period of the domain is one year, after which it will be reclaimed.
In summary, domains can be obtained through auctions on the official website or traded from other users.
Preparing the Front-End Page
In this step, you need to prepare a front-end page for display. For simplicity, this article only prepares an HTML file along with Nginx to expose the page. Of course, a cloud server is also needed to run the front-end page. This step is similar to traditional front-end application deployment.
Binding the Page to .ton
After acquiring a .ton domain, you can bind your ANDL address on the TON DNS official website. You can also use the binding tool provided by TON, following the official guide to bind your page.
Once binding is complete, you need to start a listening port on the server to listen for HTTP requests and forward them as UDP. You can use the official rldp-http-proxy tool, and you can start it with the following command:
rldp-http-proxy/rldp-http-proxy -p 8080 -c 3333 -C global.config.json
Here, 8080 is the TCP port on the local host that will listen for incoming HTTP queries, while 3333 is the UDP port for all outbound and inbound RLDP and ADNL activities (i.e., connecting to the TON website through the TON network). global.config.json is the filename for the TON global configuration file, which can be downloaded here.
Accessing the .ton Domain
Attempting to directly enter a .ton domain in the browser will not work, as the browser does not know where to resolve this domain. Therefore, some additional steps are required.
Requesting the .ton Domain
When requesting a .ton domain, the corresponding ANDL address is first queried on-chain. This address can be simply understood as the IP address in WEB2, which is automatically generated when you deploy the website. This querying process can also be likened to a DNS query process.
Then, based on the ANDL address, the request will be forwarded to your corresponding machine, where you can specify the page to return. The overall process is quite similar to WEB2, with the main difference being the method of address and domain mapping queries.
Accessing the Page via Proxy
The most recommended method is to use the proxy tool provided by the official website, Tonutils Reverse Proxy. After downloading and starting it, a port 8080 will be opened for proxying, allowing you to access the .ton domain.
You can see that the website for the .ton domain is accessible.
Usage Summary
Currently, I have encountered the following issues:
There are requirements for the environment in which the website runs. Your system needs to support glibc version 2.34 or higher, so check if your machine meets the requirements before deploying the page.
The documentation is not very clear. This may be because the demand for running websites on TON is not high, so the documentation is not very comprehensive, requiring some exploration. Additionally, the Chinese version is not updated in a timely manner and lags behind the English version.
The access speed is relatively slow. The speed of access lags behind traditional websites. Of course, many factors are involved, and there is significant room for improvement in the future.
Not supported by wallets. The official provides a simple embedded browser page, allowing access without installing a proxy. However, currently, this website is recognized as a phishing site by all major wallets o.0.
In summary, the current experience is quite average, with many areas for improvement. However, I find this direction to be quite good and innovative, and trying it out is worthwhile.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。