Method and system for accessing decentralized application
By establishing a bridge between the DNS recursive server and the HTTP proxy server and configuring processing rules in the HTTP proxy server, the browser support problem when users access decentralized applications and the naming conflict between multiple domain name spaces is solved, and the convenience and compatibility of users accessing decentralized applications through regular browsers is achieved.
Patent Information
- Application Number
- CN202411968944.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-15
AI Technical Summary
There are two main problems with users accessing decentralized applications: regular browsers do not support decentralized domain names, and naming conflicts caused by multiple domain name spaces are serious.
By establishing a bridge between the DNS recursive server and the HTTP proxy server, the DNS recursive server is configured to resolve the decentralized domain name and conflicting domain name into the address of the HTTP proxy server, and configure HTTP request packet processing information in the HTTP proxy server, including wild domain names, redirection processing rules and processing actions, to achieve access and naming conflict resolution of decentralized applications.
It realizes that users access decentralized applications based on traditional or decentralized domain names through regular browsers, and effectively solves naming conflict problems in multi-domain name spaces, providing a more convenient and compatible access method.
Smart Images

Figure CN119835325A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information technology, and in particular relates to a method and system for accessing decentralized applications. Background Art
[0002] Decentralized applications (DApp) are applications built on blockchain platforms that use smart contracts to implement their functions and logic, and can be addressed through traditional domain names and decentralized domain names. With the growing demand for decentralization, more than a dozen decentralized domain name systems such as ENS and Unstoppable Domains have emerged one after another, and the number of registrations has continued to grow, forming a multi-domain name space together with the traditional ICANN domain name space.
[0003] At present, there are two problems for users to access decentralized applications. One is that conventional browsers do not support decentralized domain names. Users need to install dedicated browsers or specific browser plug-ins to access decentralized domain names. For example, install dedicated browsers such as Brave, Opera, Status, Mobile, Puma, or install plug-ins such as MetaMask, Unstoppable extension, Bob Wallet, Phantom, AegisWeb3, LinkFrame, etc. in general browsers such as Firefox. The second is the naming conflict caused by multiple domain name spaces that are independent of each other. For example, in October 2022, due to a complaint from UnstoppableDomains, the .nft domain name issued by NNS (NFT Name Service) was removed from the Opensea exchange; in the same month, Unstoppable Domains stopped supporting the .coin domain name in order to avoid conflicts with the .coin domain name issued by the blockchain platform Emercoin; in addition, ENS's .eth domain name was reserved by ICANN as Ethiopia's national top-level domain name.
[0004] In summary, the fact that conventional browsers do not support decentralized domain names and the naming conflicts caused by the coexistence of multiple domain name spaces have become real problems that need to be solved urgently. Summary of the invention
[0005] In view of the above problems, the present invention proposes a novel technical solution, which enables users to access both decentralized applications based on traditional domain names and decentralized applications based on decentralized domain names through conventional browsers, and can also solve the naming conflict problem of multiple domain name spaces.
[0006] The technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a method for accessing a decentralized application, comprising the following steps:
[0008] Configure domain name resolution information on the DNS recursive server, including configuring the address of the A or AAAA record of the decentralized domain name and the conflicting domain name as the address of the HTTP proxy server;
[0009] Setting up an HTTP proxy server, and configuring HTTP request message processing information in the HTTP proxy server, wherein the HTTP request message processing information includes a wildcard domain name, a redirection processing rule, and a processing action;
[0010] The DNS recursive server receives the domain name query request initiated by the user when accessing the decentralized application through the browser;
[0011] The DNS recursive server retrieves the domain name according to the domain name query request, and returns the IP address of the HTTP proxy server to the user terminal for a decentralized domain name or a conflicting domain name, so that the user terminal initiates an HTTP request to the HTTP proxy server according to the IP address;
[0012] The HTTP proxy server receives HTTP requests from the client, implements access to decentralized applications and resolves naming conflicts in multiple domain name spaces based on the configured HTTP request message processing information.
[0013] Furthermore, the HTTP request message processing information is configured in the HTTP proxy server, including: for domain names without conflicts, the processing action corresponding to the wildcard domain name match is configured as redirection, and the redirection processing rules are configured; for domain names with naming conflicts, two processing methods are adopted: one is to select and configure one of the redirection processing rules, and configure the processing action corresponding to the wildcard domain name match as redirection; the other is to leave the choice to the user end, retain multiple redirection processing rule configurations for the corresponding wildcard domain name, and configure the processing action of the wildcard domain name match to return to the navigation page.
[0014] Furthermore, if the IP address in the response of the DNS recursive server received by the user end is not the IP address of the HTTP proxy server, the user end initiates an HTTP request to the received IP address to directly access the centralized application service.
[0015] Furthermore, after receiving the HTTP request from the client, the HTTP proxy server searches the configuration information according to the domain name carried in the Host field, including the following steps:
[0016] If the action for the wildcard domain name match is redirection, it is processed according to the corresponding redirection processing rule;
[0017] If the processing action corresponding to the wildcard domain name match is to return to the navigation page, corresponding information is generated according to the corresponding multiple redirection processing rules, displayed to the user end in the response message for selection, and cookie information is set to record the user end selection.
[0018] Furthermore, if the processing action corresponding to the wildcard domain name match is redirection, processing is performed according to the corresponding redirection processing rule, including:
[0019] If it is a non-ICANN domain name, there is a redirection processing rule, and the Location field in the HTTP response message is set to the corresponding alias and returned to the user end, so that the user end can access the decentralized application through the alias;
[0020] If it is an ICANN space domain name, there is no redirect matching rule, obtain the A or AAAA record of the domain name, forward the HTTP request without the query parameter to its server address, and return the result to the user end.
[0021] Furthermore, if the processing action corresponding to the wildcard domain name match is to return to the navigation page, corresponding information is generated according to the corresponding multiple redirection processing rules and displayed to the user end in the response message for selection, including:
[0022] If the wildcard domain name retrieved by the HTTP proxy server does not belong to the ICANN domain name space, an HTML hyperlink is created and the href attribute in the hyperlink tag is set to the corresponding alias according to the wildcard mapping rule;
[0023] If the wildcard domain name retrieved by the HTTP proxy server belongs to the ICANN domain name space, an HTML hyperlink is created, a query parameter is added to the URL and is set to ICANN, the HTTP request is identified as the HTTP request selected by the user end when the domain name conflict occurs, and when the user end clicks this option, an HTTP request carrying the query parameter is initiated and sent to the HTTP proxy server.
[0024] Furthermore, the setting of cookie information to record the user's selection includes:
[0025] The HTTP proxy server adds the Set-Cookie field in the HTTP response header to set cookies and record the user's preferences. When the user initiates the same HTTP request again, it is processed according to the corresponding redirection processing rules based on the cookie information it carries.
[0026] In a second aspect, the present invention provides a system for accessing decentralized applications, including a DNS recursive server and an HTTP proxy server; the DNS recursive server configures domain name resolution information, and configures the address of the A or AAAA record of the decentralized domain name and the conflicting domain name as the address of the HTTP proxy server; the HTTP proxy server configures HTTP request message processing information; the DNS recursive server receives a domain name query request initiated by a user terminal when accessing a decentralized application using a browser; the DNS recursive server retrieves the domain name according to the domain name query request, and for the configured decentralized domain name or the conflicting domain name, returns the IP address of the HTTP proxy server to the user terminal, so that the user terminal can initiate an HTTP request to the HTTP proxy server according to the IP address; the HTTP proxy server receives the HTTP request of the user terminal, and implements access to the decentralized application and resolves the naming conflict of multiple domain name spaces according to the configured HTTP request message processing information.
[0027] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the method of the present invention.
[0028] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the various steps of the method of the present invention are implemented.
[0029] The beneficial effects of the present invention are as follows:
[0030] (1) The present invention has strong operability, and users do not need to perform any additional operations. The way to access decentralized applications is the same as that of Web2.0 websites.
[0031] (2) The present invention has wide compatibility and supports both Web2.0 websites and decentralized applications; (3) The present invention solves the naming conflict problem of multiple domain name spaces at the application level. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flowchart of the steps of the method for accessing decentralized applications of the present invention.
[0033] Figure 2 It is a schematic diagram of the implementation process of the method for accessing decentralized applications of the present invention. DETAILED DESCRIPTION
[0034] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below through specific embodiments and drawings.
[0035] Aiming at the naming conflict problem of multiple domain name spaces, the present invention proposes a method for accessing decentralized applications. The present invention introduces a new network element, HTTP proxy server, in the cloud, configures domain name resolution information in the DNS recursive server, so that it can resolve decentralized domain names and conflicting domain names into the address of the HTTP proxy server, and solves the naming conflict problem through the service redirection and conflict handling mechanism of the HTTP proxy server.
[0036] The present invention proposes a method for accessing decentralized applications, the process of which is as follows: Figure 1 As shown, the following steps are included:
[0037] S101: Configuring domain name resolution information on the DNS recursive server, including configuring the address of the A or AAAA record of the decentralized domain name and the conflicting domain name as the address of the HTTP proxy server;
[0038] S102: Setting up an HTTP proxy server, and configuring HTTP request message processing information in the HTTP proxy server, wherein the HTTP request message processing information includes a wildcard domain name, a redirection processing rule, and a processing action;
[0039] S103: The DNS recursive server receives a domain name query request initiated by the user client when accessing the decentralized application using a browser;
[0040] S104: The DNS recursive server retrieves the domain name according to the domain name query request, and returns the IP address of the HTTP proxy server to the user terminal for a decentralized domain name or a conflicting domain name, so that the user terminal initiates an HTTP request to the HTTP proxy server according to the IP address;
[0041] S105: The HTTP proxy server receives the HTTP request from the client, and implements the access to the decentralized application and resolves the naming conflict of multiple domain name spaces according to the configured HTTP request message processing information.
[0042] In one embodiment of the present invention, a method for accessing a decentralized application is proposed, and the implementation process is as follows: Figure 2 As shown, the following steps are included:
[0043] 1. The DNS recursive server configures domain name resolution information, including configuring the address of the A or AAAA record of the decentralized domain name and the conflicting domain name as the address of the HTTP proxy server.
[0044] 2. The HTTP proxy server configures HTTP request message processing information, including wildcard domain names, redirection processing rules, and processing actions. For domain names without conflicts, configure the processing action for the corresponding wildcard domain name match as redirection, and configure the redirection processing rules. For domain names with naming conflicts, the administrator has two ways to handle them: one is that the administrator chooses to configure one of the conflicting domain names as a redirection processing rule after comprehensive consideration, and configures the processing action for the corresponding wildcard domain name match as redirection; the other is to leave the choice to the user, reserve multiple redirection processing rule configurations for the corresponding wildcard domain name, and configure the processing action for the wildcard domain name match to return to the navigation page.
[0045] 3. The user accesses the decentralized application through a browser and initiates a domain name query request to the DNS recursive server.
[0046] 4. The DNS recursive server retrieves the domain name. For the configured decentralized domain name or conflicting domain name, it returns the IP address of the HTTP proxy server. The remaining unconfigured ICANN domain name space domain names are recursively resolved using the traditional process and the resolution results are returned.
[0047] 5. After the user receives the DNS response from the DNS recursive server, if the IP address in the response is not the IP address of the HTTP proxy server, the user initiates an HTTP request to the address using the traditional process to directly access the centralized application service; otherwise, the user requests the HTTP service from the IP address of the HTTP proxy server.
[0048] 6. The HTTP proxy server receives the user's HTTP request and searches the configuration information based on the domain name carried in the Host field:
[0049] 6.1 If the processing action for the wildcard domain name match is redirection, the processing flow according to the corresponding redirection processing rules is as follows:
[0050] 6.1.1 If it is a non-ICANN domain name, there is a redirection processing rule. The Location field in the HTTP response message is set to the corresponding alias and returned to the user. After receiving it, the user accesses the decentralized application service through the alias;
[0051] 6.1.2 If it is an ICANN space domain name, there is no redirection matching rule, obtain the A or AAAA record of the queried domain name through other public recursive methods, and forward the HTTP request without the query parameter (query parameter) to the server address and return the result to the user.
[0052] 6.2 If the processing action corresponding to the wildcard domain name match is to return to the navigation page, then generate corresponding information according to the corresponding multiple redirection processing rules, display it to the user in the response message for selection, and set cookie information to record the user's selection, including the following steps:
[0053] 6.2.1 Setting navigation page information: The HTTP proxy server encapsulates multiple pieces of information corresponding to the wildcard domain name in the response message and displays them to the user for selection. After the user selects, the page is redirected in the following two ways:
[0054] (1) If the wildcard domain name retrieved by the HTTP proxy server does not belong to the ICANN domain name space, it can create an HTML hyperlink and set the href attribute in the hyperlink tag to the corresponding alias according to the wildcard mapping rule. The process after the user clicks the hyperlink is the same as the traditional method. Specifically, the process after the user clicks the hyperlink is: the browser initiates a domain name query request to the DNS recursive server according to the URL pointed to by the hyperlink; the DNS recursive server performs recursive resolution and returns the resolution result; after the user receives the DNS response from the DNS recursive server, it initiates an HTTP request to the address in the response message; the user receives the HTTP response and displays the response content in the browser.
[0055] (2) If the wildcard domain name retrieved by the HTTP proxy server belongs to the ICANN domain name space, an HTML hyperlink may be created. The URL remains unchanged but a query parameter is added and set to ICANN (i.e., set to a special identifier, which can be ICANN or another identifier). This identifies the request as an HTTP request selected by the user when a domain name conflict occurs. When the user clicks this option, an HTTP request carrying the query parameter is initiated. The domain name contained in the URL is still resolved to the address of the HTTP proxy server, so the HTTP request is sent to the HTTP proxy server. After receiving the HTTP request, the HTTP proxy server resolves the query parameter and the query parameter is ICANN. The subsequent processing flow is the same as step 6.1.2.
[0056] 6.2.2 Setting Cookie Information: The HTTP proxy server adds the Set-Cookie field in the HTTP response header to set Cookies and record the user's preferences. When the user initiates the same HTTP request again, it is processed according to the corresponding redirection processing rules based on the Cookie information it carries. The processing flow is the same as step 6.1.
[0057] In one embodiment of the present invention, taking accessing a decentralized application using the decentralized domain name spacex.eth as an example, the specific steps are as follows:
[0058] (1) The DNS recursive server uses BIND9.16. By configuring RPZ (Response Policy Zones), the A address of *.eth is configured as the address of the HTTP proxy server;
[0059] (2) The HTTP proxy server obtains information from the ENS official website and configures domain name processing information. The wildcard domain name is *.eth, the redirection processing rule is to redirect *.eth to *eth.link, and the processing action is redirection;
[0060] (3) The user accesses the decentralized application service through a browser and initiates a DNS request for the spacex.eth domain to the DNS recursive server;
[0061] (4) The DNS recursive server returns the address of the HTTP proxy server according to the RPZ configuration;
[0062] (5) The user requests the HTTP service whose Host field is spacex.eth from the HTTP proxy server;
[0063] (6) The HTTP proxy server receives the HTTP request, retrieves the wildcard domain name information based on the domain name spacex.eth carried in the Host field, finds out that the redirection processing rule is to redirect *.eth to *eth.link, and takes the processing action of redirection. According to the redirection processing rule, the Location field in the HTTP response message is set to space.eth.link and then returned to the user;
[0064] (7) Users access the decentralized application service through the alias space.eth.link.eth, and the subsequent process is the same as the traditional process.
[0065] The key point of the present invention is to propose a method for accessing decentralized applications. First, by combining the policy analysis of the DNS recursive server and the HTTP proxy server, users can access decentralized applications through a conventional browser; second, the administrator configures the conflicting domain name on the HTTP proxy server, or the HTTP proxy server provides a website navigation page for users to select the website to visit, thereby solving the domain name conflict problem in multiple domain name spaces; third, when the domain name conflict requires user selection, the HTTP proxy server records the user's option through Cookie to avoid multiple selections by the user, thereby providing users with more convenient services.
[0066] Another embodiment of the present invention provides a system for accessing decentralized applications, which includes a DNS recursive server and an HTTP proxy server (such as Figure 2The DNS recursive server configures domain name resolution information, configures the address of the A or AAAA record of the decentralized domain name and the conflicting domain name as the address of the HTTP proxy server; the HTTP proxy server configures HTTP request message processing information; the DNS recursive server receives the domain name query request initiated by the user end when using the browser to access the decentralized application; the DNS recursive server retrieves the domain name according to the domain name query request, and returns the IP address of the HTTP proxy server to the user end for the configured decentralized domain name or the conflicting domain name, so that the user end can initiate an HTTP request to the HTTP proxy server according to the IP address; the HTTP proxy server receives the HTTP request of the user end, and implements the access to the decentralized application and resolves the naming conflict of multiple domain name spaces according to the configured HTTP request message processing information.
[0067] The specific implementation process and interaction process of the DNS recursive server and the HTTP proxy server refer to the above description of the method of the present invention.
[0068] Another embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the method of the present invention.
[0069] Another embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the steps of the method of the present invention are implemented.
[0070] The specific embodiments of the present invention disclosed above are intended to help understand the content of the present invention and implement it accordingly. It can be understood by those skilled in the art that various replacements, changes and modifications are possible without departing from the spirit and scope of the present invention. The present invention should not be limited to the contents disclosed in the embodiments of this specification, and the scope of protection of the present invention shall be subject to the scope defined in the claims.
Claims
1. A method for accessing a decentralized application, characterized in that: The following steps are involved: Configure domain name resolution information on the DNS recursive server, including configuring the address of the A or AAAA record of the decentralized domain name and the conflicting domain name as the address of the HTTP proxy server; Setting up an HTTP proxy server, and configuring HTTP request message processing information in the HTTP proxy server, wherein the HTTP request message processing information includes a wildcard domain name, a redirection processing rule, and a processing action; The DNS recursive server receives the domain name query request initiated by the user when accessing the decentralized application through the browser; The DNS recursive server retrieves the domain name according to the domain name query request, and returns the IP address of the HTTP proxy server to the user terminal for a decentralized domain name or a conflicting domain name, so that the user terminal initiates an HTTP request to the HTTP proxy server according to the IP address; The HTTP proxy server receives HTTP requests from the client, implements access to decentralized applications and resolves naming conflicts in multiple domain name spaces based on the configured HTTP request message processing information.
2. The method according to claim 1, characterized in that The HTTP request message processing information is configured in the HTTP proxy server, including: for domain names without conflict, configuring the processing action corresponding to the wildcard domain name match to redirect, and configuring the redirection processing rules; for domain names with naming conflicts, two processing methods are adopted: one is to select and configure one of the redirection processing rules, and configure the processing action corresponding to the wildcard domain name match to redirect; the other is to leave the choice to the user end, retain multiple redirection processing rule configurations for the corresponding wildcard domain name, and configure the processing action of the wildcard domain name match to return to the navigation page.
3. The method according to claim 1, characterized in that If the IP address in the response from the DNS recursive server received by the client is not the IP address of the HTTP proxy server, the client initiates an HTTP request to the received IP address to directly access the centralized application service.
4. The method according to claim 1, characterized in that: After receiving the HTTP request from the client, the HTTP proxy server searches the configuration information according to the domain name carried in the Host field, including the following steps: If the action for the wildcard domain name match is redirection, it is processed according to the corresponding redirection processing rule; If the processing action corresponding to the wildcard domain name match is to return to the navigation page, corresponding information is generated according to the corresponding multiple redirection processing rules, displayed to the user end in the response message for selection, and cookie information is set to record the user end selection.
5. The method according to claim 4, characterized in that If the processing action corresponding to the wildcard domain name match is redirection, processing is performed according to the corresponding redirection processing rule, including: If it is a non-ICANN domain name, there is a redirection processing rule, and the Location field in the HTTP response message is set to the corresponding alias and returned to the user end, so that the user end can access the decentralized application through the alias; If it is an ICANN space domain name, there is no redirect matching rule, obtain the A or AAAA record of the domain name, forward the HTTP request without the query parameter to its server address, and return the result to the user end.
6. The method according to claim 4, characterized in that If the processing action corresponding to the wildcard domain name match is to return to the navigation page, then corresponding information is generated according to the corresponding multiple redirection processing rules, and displayed to the user end in the response message for selection, including: If the wildcard domain name retrieved by the HTTP proxy server does not belong to the ICANN domain name space, an HTML hyperlink is created and the href attribute in the hyperlink tag is set to the corresponding alias according to the wildcard mapping rule; If the wildcard domain name retrieved by the HTTP proxy server belongs to the ICANN domain name space, an HTML hyperlink is created, a query parameter is added to the URL and is set to ICANN, the HTTP request is identified as the HTTP request selected by the user end when the domain name conflict occurs, and when the user end clicks this option, an HTTP request carrying the query parameter is initiated and sent to the HTTP proxy server.
7. The method according to claim 4, characterized in that The cookie information is set to record the user's selection, including: The HTTP proxy server adds the Set-Cookie field in the HTTP response header to set cookies and record the user's preferences. When the user initiates the same HTTP request again, it is processed according to the corresponding redirection processing rules based on the cookie information it carries.
8. A system for accessing decentralized applications, characterized in that: Includes DNS recursive server and HTTP proxy server; The DNS recursive server is configured with domain name resolution information, and the address of the A or AAAA record of the decentralized domain name and the conflicting domain name is configured as the address of the HTTP proxy server; HTTP proxy server configures HTTP request message processing information; The DNS recursive server receives the domain name query request initiated by the user when accessing the decentralized application through the browser; The DNS recursive server retrieves the domain name according to the domain name query request, and returns the IP address of the HTTP proxy server to the user terminal for the configured decentralized domain name or conflicting domain name, so that the user terminal can initiate an HTTP request to the HTTP proxy server according to the IP address; The HTTP proxy server receives HTTP requests from the client, implements access to decentralized applications and resolves naming conflicts in multiple domain name spaces based on the configured HTTP request message processing information.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented.