Subdomains
Names come in handy in many situations. We believe that any place an address is used, a name should be able to be used instead. The smart contracts you interact with have names, the deposit address for your favorite exchange has a name, your favorite DAO has a name, or maybe you use subnames to keep your wallets organized.
Luckily, the ENS Protocol has so much to offer for you to play with. There are a variety of ways you can give out subdomains to your apps users, set them up for yourself, or more.
If you are interested in naming smart-contracts specifically, check out the Naming Smart Contracts page.
Durin is an opinionated approach to issuing ENS subnames on L2. It takes care of the L1 Resolver and offchain gateway parts of the CCIP Read stack for you, so you can focus on the business logic of your L2 smart contracts.
The NameWrapper is a smart contract that allows you to issue trustless on-chain subdomains. NameWrapper subdomains come in the form of ERC1155 NFTs, which can be transferred, sold, or traded. Read our guide to creating an onchain subname registrar to learn more.
In the previous version of the ETHRegistrar, you could register subdomains for a name. These subdomains are always owner-controlled, and can be transferred. They are also stored on-chain, but are not in the form of a standard NFT.
You can register a legacy subdomain by calling the setSubnodeRecord
function on the ENS Registry contract.
You can always opt to write your own resolver in solidity, doing so will give you absolute programmatic control over how resolution for your name and its subnames will behave. Requires deploying a smart contract.
To load data from an off-chain location, such as layer 2, database, or file. A resolver can leverage CCIP Read to load data from an off-chain location.
Tooling has been built to allow you to easily deploy a template resolver, or leverage a library to load data from offchain.
The Unruggable Gateway is a set of solidity tooling that allows you to write a resolver that can trustlessly load storage slots from an EVM-compatible chain.
If you are looking to skip writing & deploying a contract to mainnet you can use ccip.tools's proxy factory. This allows you to easily, and at low deployment cost deploy a resolver that can load data from a CCIP endpoint.
This allows you to easily deploy a resolver that can load from your Gateway API without having to write any solidity code.