1.country: Revolutionizing Web2 Domains with Web3 Identities 🌐
A technical introduction of how 1.country connects web2 domains with web3 identities and services.
1.country is the world's first platform that combines Web2 domain and Web3 name services. 1.country was released by Hidden State, a Harmony ecosystem partner, earlier in March 2023. 1.country delivers an ICANN-compliant 1.country domain with the security, transparency, and efficiency of blockchain and smart contracts. Users can now simultaneously own their Web3 identity, a browsable website, and an extendable domain in one transaction.
When someone wants to create a website, they must choose a registrar and purchase a domain name that uniquely identifies their site. Although registrars are required to follow certain ICANN rules to ensure fair access to the domains, each registrar may charge an additional premium on top of the registration fees charged by the registry operating the root domain (such as 1.country), and there is no guarantee or transparency requirement for their service quality. Web2 domain registration is also distinguished by its interactive and participatory nature, such as selecting a domain name that is simple to recall, reflects the brand or purpose, and is optimized for search engines and social media sharing.
After choosing the Registrar and the domain name, it is required to find a place where the website linked to the domain will be hosted, configure DNS settings, ensure domain security, and comply with various laws and regulations related to domain registration and website operation. Registering a Web2 domain could be a complicated process that requires attention to detail and careful consideration of the registrant's needs and goals.
Like domain names were born to simplify website access by replacing IP addresses with readable names, Web3 Name Services were introduced by Namecoin in 2011 to provide a simpler way to resolve blockchain alphanumeric addresses with a name. Recent implementations, like Ethereum Name Service (ENS), additionally allow subdomain creation, decentralized websites hosted on IPFS, and could also map a name with a Smart Contract. However, Web3 name servers are isolated to the blockchain.
With 1.country, users have a seamless user experience incorporating the advantages of a Web2 domain and a Web3 Name Service: the decentralized blockchain's security and transparency while having access to resources built on the blockchain through an easy-to-remember domain name that is accessible on every web browser. For example, the domain abhinav.country, serves as the representation of their web2 presence which can be transferred with the transference of their domain NFT.
Linking a Web2 domain to a Web3 Name Service creates new opportunities for creativity and internet-wide collaboration.
Interoperability is challenging when connecting Web3 names with Web2 domains because the two technologies use different underlying architecture and infrastructure. Web3 is built on a blockchain, a decentralized technology for identity verification, unlike web2, which is built on centralized domain name registrars and DNS servers.
Web2 applications typically use traditional web protocols such as HTTP and TCP/IP to communicate with each other. Even though these protocols are the fundamental building blocks of blockchain, they work well in a client-server model, where a centralized server provides resources and services to multiple clients. They are not as well-suited as peer-to-peer networks for web3 as there is no centralized authority.
To address this challenge, we (1) created a series of smart contracts to handle domain deployment (domain registration, subdomain creation, domain renewal), (2) created our own DNS server to facilitate certificate generation, DNS configuration, and web hosting, (3) Deployed a Relayer API that communicates with Registrar API, the DNS, and the NFT metadata API, (4) developed a react-base webpage that orchestrates the communication with web3 name renting and web2 domain name registration.
The Integration of Two Ecosystems
The integration of the Web2 domain registry and Web3 name purchasing can be explained by the domain purchase process.
The user searches for the domain name that they want to register.
The Frontend validates the name to ensure it conforms to Registrar's restrictions.
Once the name has been validated, it is then checked against the web3 smart contracts and the web2 backend to determine its availability and its price according to the number of characters in the domain name.
To avoid two users trying to obtain the same domain simultaneously, the user reserves the name by signing a web3 transaction.
The user proceeds to purchase the domain by signing a payable web3 transaction, which unveils the following tasks on the smart contracts:
The domain gets registered, and a domain record is generated, which contains the following info: renter, date of purchase, expiration date, purchasing price
The domain NFT is minted providing a secure and decentralized means of establishing ownership of the domain and authenticity.
After that, the frontend interacts with the Registrar Relayer API to generate NFT metadata.
Then, the frontend calls the purchaseDomain endpoint on the Registrar Relayer API to claim the web2 domain. Here the backend interacts with the DC Contracts to verify if the domain purchase went through; if so, proceed to claim the domain name.
The Registrar Relayer API first configures the DNS records on the Redis server and then generates the SSL certificate through a frontend call using the /cert endpoint.
Lastly, the Relayer API configures the hosting service on the Redis server and your domain is ready!
Multiple systems across the blockchain, the Registrar Relayer, and the GCP infrastructure deployer, work in sync with the frontend to provide a good user experience during the registration of .country domains.
There are a couple key components to the domain registration process: two smart contracts DC and the ENS deployer, the ENS registrar relayer api, the NFT metadata and the frontend.
DC contracts serve as a gateway for interactions with domain names on the blockchain network. DC contracts are flexible and extensible, functioning as a base contract where current and future domain features are integrated. Services such as analytics, tweets, videos, or hosting services that provide additional functionality to domain owners can be integrated onto the base contract. While DC contracts are responsible for managing the core domain-related functionality, services can provide additional value by offering services that enhance the functionality of their domains. Together, DC contracts and services form a system that allows users to manage and leverage their web3 domain names to their full potential.
The ENS Deployer contracts handle the process of deploying domains, making it faster, easier, and more reliable than manual deployment. The ENS Deployer contracts also consist of a series of smart contracts that provide a range of services, including domain registration, subdomain creation, domain renewal, and more. These contracts are modular and easily customizable, allowing users to configure the specific services they need for any use case.
ENS Registrar Relay API (Relayer) is a backend that handles web2 domain registering tasks such as claiming the domain name before the Registrar, DNS configuration, SSL generation, and setting the domain hosting. The relayer also serves as a middleware, such that only the Frontend can interact with the Relayer while it talks with the Registrar, Redis DNS server, and the NFT metadata API.
The NFT metadata is generated through a backend server that offers an efficient and a convenient solution for generating unique domain NFT images. The server generates the image and uploads it to a specified Google Storage bucket location. This process is automated, allowing for quick and hassle-free NFT image creation. Once the process is complete, the API returns a metadata URL that corresponds with the contracts token id construction process.
The frontend of .country is responsible for managing the user interface and handling user interactions with the site. A React app serves as the frontend, providing a robust framework for managing the business logic of the platform. This includes integrating the user's web3 wallet, which allows for secure and transparent transactions via the blockchain. The app also interfaces with DC smart contracts, which are used to manage the domain registration process and ensure the security and authenticity of each transaction. Finally, the Relay API is integrated into the frontend to facilitate communication between the various components of the system, providing a seamless and intuitive user experience. Through the use of this powerful frontend technology, 1.country domains are able to offer a user-friendly, fast, and reliable platform for managing domain registrations and other digital transactions.
Some Key Innovations
NFTs with a second-level domain. Associating blockchain Non-Fungible Tokens (NFTs) ownerships and transactions with domains under web2 .country Top-Level Domain (TLD) is an innovation in digital ownership and asset management. By combining an NFT with a .country domain, a website owner may establish a unique and immutable digital identity for their domain, providing a secure and decentralized means of verifying ownership. This also allows the transfer of ownership to be more streamlined and secure, as the NFT represents digital ownerships that can be publicly and instantly verified at any time. Traditionally when a user wants to transfer a domain to someone else they would need to be with their registrar for at least 60 days, request an authorization code, authorize the transfer and might even need to pay a fee. On the other hand, a .country domain can be transferred in a matter of seconds after the domain has been registered. Additionally, NFTs can provide new and exciting opportunities for website owners to monetize their domain names and improvements (such as content, popularity, and search engine optimizations) by creating and selling the domains as unique digital assets in active, transparent NFT marketplaces. There are numerous potential use cases for this innovation. For example, creators and artists may use their domain name as a canvas to showcase and monetize their work.
Free, fast SSL certificate generation in under five minutes, and possibly much faster in the coming months. Obtaining an SSL certificate could be a costly, complex, and somewhat technical process, often involving multiple steps and requiring payment of significant fees. Typically, obtaining and setting up a valid SSL certificate for a website could take anywhere from an hour to a whole day. 1.country has made the process easier, faster, and cheaper.
Decentralized DNS (dDNS). Instead of relying on centralized authority, we will allow domain names to be registered and controlled through the blockchain by the users themselves. Doing so will eliminate single points of failure on nameservers, make DNS operations more permissionless and transparent, provide users almost complete control over their domain names, and lower the risk of domain name hijacking and censorship.
In our upcoming article, we'll delve deeper into the key components and explore additional key innovations made. Be sure to keep an eye out for it.
Become ONE with Harmony
Developers can build on Harmony today, a fast and open blockchain for decentralized applications. Harmony Mainnet supports state sharding with instant finality. Our staking mechanism reduces centralization while supporting delegation and slashing.
We 💙 Developers.
Have an idea? Build it on Harmony and submit a pr.