How to access a website "on-chain"

A recent event has prompted me to rethink traditional domain access services. We have always considered domain name resolution services to be very stable, yet they can also encounter issues. This leads me to wonder if a Decentralization solution might be a worthwhile alternative to explore?

After thinking about it, deploying a page on the blockchain may have the following benefits:

  1. Decentralization: All modifications require the collective agreement of everyone involved; no single institution has the final say.

  2. No certificates required: Because blockchain itself uses encryption technology, there is no need for additional certificate configuration.

I had previously seen the domain name solution on TON and thought it seemed just fun, with average practicality, after all, traditional access methods have been very stable and commonly used. But now that I think about it, there might really be places where it will be useful, so I plan to study it more thoroughly.

Creating a Website on the Blockchain

This article will attempt to deploy a website on TON and allow users to access this page in their browser. The process is divided into three steps: 1. Purchase a domain name; 2. Prepare the front-end page; 3. Bind the page to the domain name.

The concept of domain names in blockchain is actually similar to that in the WEB2 world; both serve as aliases for complex and hard-to-remember addresses. In blockchain, they represent the user's address, while in WEB2, they correspond to the service's IP address.

Purchase Domain Name

Taking TON as an example, the official purchase address for the domain is priced in TON. Like WEB2, the shorter the domain name, the more expensive it is, with prices ranging from 1 to 100 TON.

If the domain name is not owned by anyone, you can bid at a low price, and after bidding, enter a countdown, during which everyone can bid until the countdown ends. After the auction, the domain name will be stored in the user's wallet as an NFT. Domain NFTs can be traded. The validity period of the domain is 1 year, and it will be reclaimed after expiration.

In summary, domain names can be obtained through auctions on the official website or traded from other users.

How to access websites "on-chain"

Prepare the front-end page

At this step, a front-end page needs to be prepared for display. For simplicity, this article only prepares an HTML file along with nginx to expose the page, and of course, the project also requires a cloud server to run the front-end page. This step is the same as deploying traditional front-end applications.

Bind the page to .ton

After acquiring a .ton domain name, you can bind your ANDL address on the official TON DNS website. Of course, you can also use the binding tool provided by TON to bind your page according to the instructions on the official website.

After the binding is complete, you also need to start a listening port on the server to listen for http requests and forward them to udp. You can use the official rldp-http-proxy tool for this, and you can start it by entering the command below:

rldp-http-proxy/rldp-http-proxy -p 8080 -c 3333 -C global.config.json

Among them, 8080 is the TCP port that will listen for incoming HTTP queries on the localhost, while 3333 is the UDP port that will be used 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, which can be downloaded here.

Access the .ton domain

Trying to directly access a website by typing 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 here.

Request process of .ton

When requesting a .ton domain, the corresponding ANDL address will first be queried on-chain. This address can be simply understood as an IP address in WEB2, which is automatically generated when you deploy a website. This querying process can also be likened to a DNS query process.

After that, based on the address of ANDL, the request will be forwarded to your corresponding machine, at which point you can specify the corresponding return page. The overall process is quite similar to WEB2, with the main difference being that the querying method for address and domain name mapping is somewhat different.

Accessing the page through a proxy

The most recommended way is to use the proxy tool Tonutils Reverse Proxy provided by the official website. After downloading, installing, and starting it, a port 8080 will be launched for the proxy, and then you can access the .ton domain.

How to access websites "on-chain"

You can see the websites that can access the .ton domain.

Usage Summary

Currently, I have encountered the following issues:

  • There are requirements for the operating environment of the website. Your system needs to support glibc version 2.34 or higher, so check whether your machine meets the requirements before deploying the page.
  • The documentation is not very clear. This may be because there is not much demand for this TON running website, so the documentation is not very complete and requires self-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 access speed will lag behind traditional websites. Of course, there are many factors involved in this, and it can only be said that there is a lot of room for improvement in the future.
  • Not supported by the wallet. The official provides a simple embedded browser page that you can 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 actually quite average, and there are many areas that can be improved in the future. However, I think this direction is quite good and innovative, and it's worth trying.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)