# Setonix: Blockchain-Based Hierarchy Domain Name System for Web3
## 4 Design of Setonix DNS for Supporting Fully Decentralized Web3 Access
### Architecture
#### 4.2.1 DNS Part  
First, in DNS, ownership management is essential since information about who holds each domain name is needed in every process. Therefore, the design begins with the ownership contract that manages ownership as the top priority, followed by the DNS design incorporating this contract. The ownership contract that manages ownership is shown in Figure 1 below. The data consist of wallet addresses and domain names, with each domain name being matched in a one-to-many format with those owning wallet addresses. This smart contract operates with a verify ownership function to check if ownership matches for a domain name, and a set ownership function to match the domain name with a wallet address, storing ownership for the domain name. The fetch ownership function directly returns ownership information for a specific domain name. Finally, update ownership functions to update the ownership stored as a wallet address for a domain name. Next, the DNS involves a registration process, which stores a new domain name matched to an address, and a resolver process, which verifies it. Registration must occur first for resolving to be possible, so the design begins with registration, followed by the resolving process. The overall process for registration can be seen in Figure 2 below. The process follows the arrows as shown in the figure. First, for registration, the registrant's wallet address, the domain name to be registered, and the corresponding address are required. The wallet address is needed to match the owner information with the domain name when executing the ownership registration contract. When the required data are received by the DNS along with the request message, it is first processed by the domain parser and then sent to the domain checker. The domain checker examines the parsed domain to determine whether the domain name is already registered or if it includes a subdomain. If the check confirms that the domain is not registered, it is sent to the ownership contract to assign ownership to the domain first, and then registration proceeds. If only a subdomain is being registered, it is sent directly to the domain register. In this process, the domain hierarchy structure, designed for convenience in management and use, is included. To explain in detail, take the Web3 domain'sub.domain.needs' as an example. When this domain is entered for registration, the domain parser splits it by dots ('. '), dividing it into'sub', 'domain', and 'needs'. The parsed domain is checked by the domain checker in its basic form, 'domain.needs', by grouping the domain name and TLD together, excluding the subdomain'sub', as defined in the Considerations section. If the check reveals that the domain is already registered but includes a subdomain (as in the current example), the ownership information issued for that domain is verified. If it  
Figure 1: The architecture of the ownership contract, a smart contract that manages ownership of domain names registered in Setonix. Figure 2: A sequence diagram illustrating the process of registering a domain name in Setonix. matches, the domain register is executed for the subdomain. However, if no subdomain exists, the same domain name cannot be reissued, so an error message is returned. Finally, if the domain is not registered, a new registration is attempted. Ownership registration is processed for the base domain through the ownership contract. If a subdomain is attached, additional registration is carried out for it as well. Next is the resolving function, which is requested through an interface described later. This process is much simpler compared to the domain name registration process. The domain resolver within the DNS is designed to return the address matching the requested domain name to the requester. The overall architecture of the Setonix DNS contract, which includes both registration and resolving functions, is shown below in Figure 3.  
As shown in the diagram, functions for updating, directly fetching ownership, and resolving and registering are also included.