Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ENSv2 overview
When a payment app receives alice.eth as input, it retrieves the address associated with that name.
The name's owner can change the payment destination and assign child names such as team.alice.eth to other members.
The app's read operations and the owner's name management operations go through separate contracts.
A registry is a contract that records name management information and resolution destinations. A resolver is a contract that returns records associated with a name, including addresses and profiles. The app looks up the designated resolver in the registry and obtains the payment destination from that resolver.
ENSv2 connects these management destinations at each level of the name hierarchy.
It also records accounts that own names separately from accounts delegated specific operations.
For example, an operator can be permitted to change the designated resolver without being allowed to transfer the name.
ENSv2 launched on the Ethereum mainnet on October 27, 2026.
It preserves a resolution path for existing ENSv1 names while allowing owners to migrate their names individually.
https://ens.domains/blog/post/ensv2-live-on-mainnet

Management at each level of the hierarchy
When managing team.alice.eth, the registration information for alice.eth itself and that for its child team are stored in different registries.
The parent registry designates the child's management destination, and name lookup follows that connection.
Separating these connections from the resolver designation for each name makes the storage structure easier to follow.

Values stored for each label
Each dot-separated part of a name is called a label.
In team.alice.eth, team, alice, and eth are individual labels.
The RootRegistry points to the management destination for eth, and the ETHRegistry managing .eth stores the registration for alice.
The registration for alice contains two destinations.
resolver points to the contract returning records for alice.eth, while subregistry points to the registry managing its descendants, including team.alice.eth.
Changing the child registry does not change the separate resolver designation for alice.eth itself.
The standard contract for managing descendant names is UserRegistry.
Its address is assigned to the subregistry of alice, and the registration for team is stored there.
The identifiers used in code are divided into identifiers for individual labels and identifiers for entire names.
A labelhash is the keccak256 hash of a label string such as alice.
A namehash is computed by combining the parent's identifier with each child's labelhash in order, identifying the entire name, such as alice.eth.
This 32-byte value is also called a node in the code.
Concatenating the parent's namehash and the child's labelhash into 64 bytes and hashing them produces the child's namehash.
Registries use the labels they manage as keys, whereas resolvers use the node of the entire name. The inputs therefore differ even when the operations concern the same name.
Here, node means a name identifier, not a server on a network.
The basic IRegistry read interface exposes getSubregistry(label), getResolver(label), and getParent().
This minimal interface connects the name hierarchy without prescribing an implementation for ownership tokens or expiry.
The implementation discussed here is commit 4f47cbc, identified by the official mainnet source.
The standard PermissionedRegistry stores the following Entry using a label-derived identifier as the key.
The code excerpts focus on storage structures and conditional logic.
Not every deployed contract necessarily behaves identically; verify the implementation in use before applying these details.
struct Entry {
/// @dev Incremented on unregister; combined with labelhash to form the EAC resource ID.
uint32 eacVersionId;
/// @dev Incremented on unregister and on token regeneration; combined with labelhash to form the ERC1155 token ID.
uint32 tokenVersionId;
/// @dev Child registry for this name.
IRegistry subregistry;
/// @dev Timestamp at or after which the name is considered expired/available.
uint64 expiry;
/// @dev Resolver address for this name.
address resolver;
}subregistry is the child management destination, while resolver is the destination returning records for this name.
expiry specifies the deadline until which the registration is considered valid.
The holder of the registered name is recorded through an ownership token that associates one owner with one ID.
The two version numbers track generations of the ownership token and permissions.
Owners and roles are stored separately from this Entry.
Registrations for the same label, such as alice, in different registries represent different names.
Identify a name by combining the label-derived key with the registry address.
The child's getParent() returns its configured parent connection.
To verify ownership of an official ENS name, do not rely solely on that declaration. Follow the hierarchy from the canonical root and verify that the parent actually designates the child registry.
Possessing a token alone cannot distinguish a name created in an arbitrary registry from an official ENS name.

Following the resolution path
When an app resolves team.alice.eth, it normalizes the input according to ENS rules.
It converts the name into a DNS-encoded byte string, with each label prefixed by its length, and passes that string to the resolver.
UniversalResolverV2 proceeds from the root through eth, alice, and team, examining resolver designations at each stage.
It updates the candidate whenever it finds a resolver, ultimately using the designation closest to the name being resolved.
The implementation's LibResolution recurses toward the parent of the name before processing each label.
This differs from independently looking up each word in the string from left to right.
Queries to each registry retrieve the child management destination and designated resolver in sequence.
For example, even if team has no dedicated resolver, the complete name can be passed to the resolver for alice.eth if it supports child names.
The interface for this extended resolution is IExtendedResolver.
When falling back to a parent resolver, check that it supports this interface.
A parent resolver may respond to a child name even if the child is not individually registered in the registry.
Expiry also affects the resolution path.
For an expired name, the standard registry returns zero for both resolver and subregistry.
If alice.eth has expired, resolution cannot proceed to the child registry even if the value for team is still stored there.
If a valid resolver higher in the hierarchy has already been found, that candidate may remain available.
To retrieve data from external storage or an L2, CCIP-Read combines client-side external retrieval with contract-based verification of the response.
The client library performs HTTP communication with the gateway and passes the retrieved response to the verification call.
The contract does not access the internet directly.
If a registry along the path rejects a call, LibResolution records the failing registry and error data in ResolutionError and stops.
Apps should distinguish this failure from an unregistered name or a missing record.
https://github.com/ensdomains/contracts-v2/blob/4f47cbcc11462fb413196e6b5c0f8090247a6c08/contracts/src/universalResolver/libraries/LibResolution.sol

Reading records and looking up owners
Pass the name and the call data for the desired record to UniversalResolver's resolve(name, data).
For an address, use the addr(bytes32) call format and decode the returned bytes as an address.
Retrieving records for a name is distinct from looking up its owner.
Helper functions for finding owners and registry locations are provided by UniversalHelper.
Use findExactOwner when looking up the owner of the specified name itself.
Do not treat a lookup that finds a parent's owner as evidence of ownership of the child itself.
Ownership and operational permissions
The standard registry records each name's holder using an ownership token called ERC1155Singleton.
Each token ID has one holder, with a single address stored internally in _owners[tokenId].
Unlike ordinary ERC1155 tokens, units of the same ID are not divided among multiple holders.
Separately from this ownership record, a role mapping records who can perform each operation. This distinguishes permissions to transfer a name, designate its resolver, and delegate operations to another account. This separation matters both for delegation after registration and for checks when transferring a name. https://github.com/ensdomains/contracts-v2/blob/4f47cbcc11462fb413196e6b5c0f8090247a6c08/contracts/src/erc1155/ERC1155Singleton.sol

Checking operations and delegation
Consider an owner who uses an account for custody and delegates only resolver designation changes to an everyday operator.
EnhancedAccessControl represents the target of a permission as a resource and the permitted operation as a role.
Roles are stored in _roles[resource][account], allowing the role bitmap to be retrieved for a particular target and account.
ROLE_SET_RESOLVER is the operational permission to change the designated resolver.
An account holding the corresponding administrative permission can grant or revoke that operational permission for another account.
The ability to perform an operation and the ability to delegate it are represented by different bits.
The administrative bit corresponding to an ordinary role is positioned 128 bits higher.
Permission checks combine roles assigned to ROOT_RESOURCE, which apply to the entire contract, with roles assigned to the individual resource.
The check determines whether the combined roles contain all requested roles.
function hasRoles(uint256 resource, uint256 roleBitmap, address account)
public
view
virtual
returns (bool)
{
return _effectiveRoles(resource, account) & roleBitmap == roleBitmap;
}resource is the target of the operation, and roleBitmap is the set of required roles.
The function returns true only if the combined global and individual roles retrieved by _effectiveRoles contain every required bit.
If any are missing, the caller's permission check rejects the update.
In addition to the general access control framework, PermissionedRegistry restricts administrative permissions for individual names.
Administrative permissions for an individual name are assigned during registration and cannot be granted afterward.
Consequently, relinquishing an administrative permission does not guarantee that it can later be restored.
The number of accounts holding the same role for one resource is tracked internally as a 4-bit number, with a maximum of 15.
Account for this limit when assigning the same role to many operators.
setApprovalForAll is broader than granting individual operational roles: it authorizes an account to exercise the owner's roles.
Distinguish role delegation from blanket approval when delegating limited operational responsibilities.

Name expiry and the scope of valid permissions
ownerOf(tokenId) returns the owner when the ID is current and has not expired.
It returns the zero address for expired or outdated IDs, distinguishing a stored last owner from a currently valid owner.
latestOwnerOf may return the last recorded owner, but it should not be used as an equivalent check of valid ownership.
The role mapping also accounts for the registration's validity period. For an expired name, the resource used to look up individual permissions is advanced by one generation. This prevents old stored roles from continuing to authorize operations on an expired name. The distinction between restoring an existing registration by renewing during the grace period and replacing it with another registration is reflected in the renewal and re-registration logic discussed later.
Token IDs tied to permission changes
If old operators retained their roles after alice.eth expired and someone else registered it, accounts unknown to the new owner could manipulate the name.
Also, if a seller relinquishes administrative permissions after listing a name, the buyer could receive a name without the expected capabilities.
To prevent these two problems separately, the storage identifier, role lookup resource, and ownership token ID serve different purposes.
All three identifiers take the upper 224 bits from the label hash and put a purpose-specific value in the lower 32 bits.
| Identifier | Lower 32 bits | Where it is used |
|---|---|---|
| Storage identifier | 0 | The name's Entry |
resource for permission lookup |
eacVersionId |
Per-account role mapping |
| Ownership token ID | tokenVersionId |
Holder and token transfers |
eacVersionId is a generation number that prevents previous permissions from carrying over into a different registration.
tokenVersionId prevents a name with changed roles from being acquired under an outdated marketplace order.
When a role for an individual name is actually granted or revoked, a burn invalidates the old token, and a token with a new ID is issued to the same owner.
function _regenerate(uint256 resource) internal {
if (resource != ROOT_RESOURCE) {
Entry storage entry = _entry(resource);
uint256 tokenId = _constructTokenId(resource, entry);
address owner = super.ownerOf(tokenId); // grant/revoke only on registered
_burn(owner, tokenId, 1);
++entry.tokenVersionId;
uint256 newTokenId = _constructTokenId(tokenId, entry);
emit TokenRegenerated(tokenId, newTokenId); // resource is unchanged
_mint(owner, newTokenId, 1, "");
}
}Here, the resource remains unchanged and only tokenVersionId advances.
Because the new ID is issued to the same owner, the holder remains unchanged while the ownership token ID changes.
A marketplace order referring to the old ID can no longer be used directly to transfer the name.
For example, assigning an operator role to a registration with permission generation 0 and token generation 0 advances the token generation to 1 while leaving the permission generation at 0. If the name subsequently expires and another party re-registers it while the former owner's token still exists, both generations advance to separate the new registration from the old one. Deregistration may already have burned the token and advanced its generations, so re-registration does not unconditionally increment both a second time. Ordinary transfers and expiry renewals do not advance the generations.
eacVersionId prevents permissions from carrying over to another registration, while tokenVersionId reflects changes to the role configuration in the token ID.
Apps tracking the same name should not assume that the token ID is permanent. They should also retain the registry and stable label identifier.

Permissions that survive transfers
When a name is transferred, the previous owner's roles are also transferred to the recipient. This internal reassignment does not change the token ID being transferred. However, roles directly granted to third parties do not disappear merely because the owner's roles have been transferred.
A safe transfer checks whether any such third party retains roles allowing intervention in the name.
The roles to check are collected in UNEMANCIPATED_ROLE_BITMAP.
| Operation | Permissions checked |
|---|---|
| Changing the designated resolver | Operational permission and corresponding administrative permission |
| Changing the designated child registry | Operational permission and corresponding administrative permission |
| Deregistration | Operational permission and corresponding administrative permission |
| Transferring the name | Administrative bit permitting transfer |
The implementation does not categorically reject cases in which a third party has only renewal permission. https://github.com/ensdomains/contracts-v2/blob/4f47cbcc11462fb413196e6b5c0f8090247a6c08/contracts/src/registry/libraries/RegistryRolesLib.sol
Another consideration is intervention by administrators of the registry as a whole.
isEmancipated checks whether global permissions still include roles that can modify settings for an individual name.
UserRegistry also checks the role permitting implementation replacement and its corresponding administrative permission.
Even without a role that directly changes name settings, an implementation upgrade can change the behavior.
unsafeTransfer provides a transfer path that skips safety checks for third-party intervention roles and potential intervention at the registry level.
It still checks whether the operation comes from the owner or an approved operator and whether the former owner has ROLE_CAN_TRANSFER_ADMIN.
Recipients should verify not only that they can receive the ownership token but also which operations remain available to third parties and administrators.
An arbitrary contract exposing a function named isEmancipated does not provide the same security guarantees merely by returning a particular value.
Also consider whether the contract uses the standard implementation and whether its implementation and permissions can be verified.

Records retrieved from names
Once the registry's designated destination is known, the resolver can return addresses and profiles.
The standard PermissionedResolver is a resolver provisioned for an account and can associate multiple names with the same record.
Roles determining ownership of a name and roles allowing its records to be modified are managed in their respective contracts.

Storage shared by multiple names
Resolvers store records for several purposes.
| Stored field | Stored value and purpose |
|---|---|
| Address | Destination address bytes for each coin type |
| Text | Strings associated with keys such as description and avatar |
contenthash |
Data used to retrieve content from decentralized storage |
name |
Name string returned by reverse resolution |
For example, an app sending funds to alice.eth reads the address, while a profile screen reads text records.
contenthash stores data identifying where the corresponding content can be retrieved.
The reverse-resolution name and the forward-resolution address are also separate fields.
PermissionedResolver has _recordIds[node], mapping a full-name node to a record ID, and _records[recordId], mapping that ID to its contents.
A record ID is unique only within its resolver. The same ID in another resolver identifies a different record.
A new ID is allocated when a name is first written to.
function _ensureRecord(bytes memory name) internal returns (uint256 recordId) {
bytes32 node = NameCoder.namehash(name, 0);
recordId = _recordIds[node];
if (recordId == 0) {
recordId = ++_recordCount;
_recordIds[node] = recordId;
emit Linked(recordId, node, name);
}
}Only when _recordIds[node] is 0 does the implementation increment _recordCount and allocate a new ID.
The Linked event records the association between the ID and the name.
If an ID already exists, it is returned, allowing subsequent updates to write to the same record.
If alice.eth and wallet.eth are linked to the same ID, both names return the same addresses and profiles.
Updating a value through one name also changes the value read through the other.
This mechanism shares all fields of a record together.
linkToNode obtains and assigns the record ID used by another name at that moment.
It is not a reference that follows the other name itself, so if that name later moves to another ID, the original name's ID does not automatically change.
linkToRecord also allows a record ID to be specified directly. Passing 0 removes the name's association.
Unlinking a name does not delete the record's contents. A name without its own ID refers to the default record configured for the root name. An empty field in a dedicated record is not individually filled from the default record.
Sharing a registry's subregistry, in contrast, shares the namespace of its descendants.
That is distinct from sharing records within a resolver.

Write permissions and read formats
To change a profile description, call setText(name, key, value).
Use name to select the name being updated, passing a DNS-encoded byte string with each label prefixed by its length.
Select the field with key and pass the new string as value.
The function first checks permissions for the key and, if authorized, writes to the record used by that name.
/// @inheritdoc ITextSetter
function setText(bytes calldata name, string calldata key, string calldata value)
external
onlyRoles(PermissionedResolverLib.resource(key), PermissionedResolverLib.ROLE_SET_TEXT)
{
uint256 recordId = _ensureRecord(name);
_records[recordId].texts[key] = value;
emit TextUpdated(recordId, key, key, value);
}key selects both the permission resource to check and the text field to modify.
If the account has ROLE_SET_TEXT for that resource, value is stored in texts[key] for the recordId obtained from name.
name selects the write destination, but it does not restrict delegated permissions to that name alone.
For example, delegating a role that permits changing only description allows the operator to modify description for every name handled by that resolver.
Even if the intention is to delegate only alice.eth, the permission extends to wallet.eth on the same resolver.
Owning a name does not automatically confer roles in its resolver.
Use grantSetterRoles to delegate permissions by argument.
In the version discussed here, the general grantRoles function is disabled and calling it fails.
To give a subname owner independent control over records, designate a resolver in which that person holds the necessary roles, separating storage destinations and permission scopes.
Read operations are consolidated into resolve(name, data), which interprets traditional record retrieval formats such as addr(bytes32) and text(bytes32,string).
Preserving a call data format does not mean the resolver still exposes an external function with the same name.
An implementation that directly calls addr(node) on this version of PermissionedResolver will not work.
Apps should retrieve the resolver currently used by the name and its supported interfaces again before updating records. Writing to a previous resolver updates a value that readers will no longer see if the name already points elsewhere.

Checking proxies and implementations
Standard resolvers and subregistries can be created as individual proxies from a shared factory. A proxy is a contract that holds state and delegates actual execution to a shared implementation. Each proxy holds the address selecting its implementation, so upgrading one person's resolver does not upgrade every other user's resolver.
The factory determines the deployment address from the creator and salt, allowing its provenance to be verified later.
verifyContract verifies that a proxy was created by that factory and returns its current implementation address.
After checking provenance, compare the returned implementation with the expected one.
Also examine which accounts received roles during initialization, and identify who can upgrade the implementation by checking holders of ROLE_UPGRADE.
Because custom resolvers can also be designated, using the factory is not a requirement for name resolution itself.
Registration and renewal
To acquire a .eth name, the user-facing ETHRegistrar checks registration conditions and fees before registering the name in ETHRegistry.
Registration takes place in two stages: submit a hash of the conditions first, wait, then reveal the conditions.
Because the name registration and the payment destination record in the resolver have different storage destinations, verify record configuration separately after registration.

A commitment concealing acquisition conditions
If the desired label and recipient are revealed immediately, another participant could acquire the same name first. The user therefore submits a hash combining the registration conditions with a random secret. This commit-reveal scheme subsequently reveals the same conditions, and the contract verifies that they match the earlier hash.
makeCommitment hashes the registration conditions and secret after encoding them with abi.encode.
The inputs included in the hash have different purposes.
| Input | Purpose in registration |
|---|---|
| Label | Selects the part of the name to acquire |
| Owner | Specifies the recipient after registration |
| Secret | Makes the conditions difficult to guess |
| Child registry | Specifies the management destination for descendant names |
| Resolver | Specifies the destination returning records |
| Registration duration | Specifies the validity period |
| Referrer identifier | Identifies the referrer |
Encoding follows the argument types, so this differs from simply concatenating strings. This implementation does not include the payment token in the hash. Use a sufficiently long random secret so the registration conditions cannot be determined simply by enumerating candidate names.
commit stores the block timestamp at which the hash was accepted in commitmentAt.
Registration succeeds only after the minimum waiting period has elapsed and before the maximum validity period is reached.
function _consumeCommitment(bytes32 commitment) internal {
uint64 t = uint64(block.timestamp);
uint64 t0 = commitmentAt[commitment];
uint64 tMin = t0 + MIN_COMMITMENT_AGE;
if (t < tMin) {
revert CommitmentTooNew(commitment, tMin, t);
}
uint64 tMax = t0 + MAX_COMMITMENT_AGE;
if (t >= tMax) {
revert CommitmentTooOld(commitment, tMax, t);
}
delete commitmentAt[commitment];
}t0 is the stored timestamp; the accepted interval includes tMin but excludes tMax.
Suppose the commitment timestamp is 1000.
If the minimum waiting period is 60 and the maximum validity period is 86400, the acceptance window runs from 1060 inclusive to 87400 exclusive.
These values illustrate the boundaries. For the actual settings, read MIN_COMMITMENT_AGE and MAX_COMMITMENT_AGE from the target deployment.
If it is too early, wait until the minimum timestamp; if the commitment has expired, start again with a commitment. Changing any hashed conditions, including owner or duration, also requires a different commitment. The commitment does not reserve the name itself, so the contract still checks availability when the conditions are revealed and the name is registered.
Attempting to recommit the same hash before the stored timestamp plus the maximum validity period is reached fails with UnexpiredCommitmentExists.
Once the maximum timestamp is reached, the same hash may be accepted again, but the previous commitment has expired for registration purposes.
When registration succeeds, the stored commitment is deleted to prevent reuse of the same acceptance record.

Payment and creation of the registration
register checks that the owner is not the zero address, verifies the commitment, and consumes it.
It then checks name availability and whether the requested registration duration meets the minimum.
The base price and premium are obtained from a price oracle.
The values supplied to calculate the price have the following purposes.
| Input to the calculation | What determines the price |
|---|---|
| Name | Label to register |
| Duration | Registration period |
| Time since expiry | Post-expiry premium |
| Payment token | Asset used to pay the fee |
Fees are collected using the ERC20 safeTransferFrom function.
After transferring funds from the payer to the fee recipient, the owner and destinations are registered in the .eth registry.
The registration call also receives the assigned roles and expiry.
SafeERC20.safeTransferFrom(paymentToken, msg.sender, BENEFICIARY, base + premium); // reverts if payment failed
tokenId = ETH_REGISTRY.register(
label,
owner,
subregistry,
resolver,
REGISTRATION_ROLE_BITMAP,
uint64(block.timestamp) + duration // new expiry
); // should not revertpaymentToken is used to collect base + premium, followed by a call to register the name in ETHRegistry.
resolver and subregistry are the two destinations associated with the name being registered.
REGISTRATION_ROLE_BITMAP specifies the initial roles defined by the registrar. The registrant cannot pass an arbitrary set of roles as an argument.
The returned tokenId is the ownership token ID of the new name.
Payment requires both a sufficient token balance and an allowance enabling the registrar to withdraw the tokens.
Prepare ETH for gas separately from the ERC20 tokens collected as registration fees.
Prices and accepted tokens depend on the oracle and deployment environment, so obtain a quote from the registrar's getRegisterPrice, which reflects the target name's state.
If fee collection or subsequent registration fails, every state change in the same transaction is reverted. Even if the commitment was deleted earlier, the deletion cannot be finalized on its own while registration fails. Distinguish gas consumption by a failed transaction from finalization of the registration fee transfer.
The resolver stored during registration is the address of the contract returning records.
Registration does not automatically configure the payment destination address returned by that resolver.
After registration, store the actual records and verify that the name returns the expected values.

Expiry and renewal
After a name expires, the standard registry treats it as AVAILABLE.
From that point, it stops returning the currently valid owner, resolver, and child registry connection.
However, ordinary .eth users can acquire another person's expired name only after the registrar's grace period.
The stored AVAILABLE state and the conditions under which the registrar accepts re-registration are separate.
The normal ENSv2 grace period is 28 days.
During this period, the existing registration can be renewed, restoring the expiry, holder, and role relationships.
The registrar performing this action receives renewal permissions that apply across the entire registry.
Ordinary renewal permission for an individual name alone does not allow arbitrary expired names to be restored.
The user-facing renewal function is renew(RenewData, paymentToken).
RenewData contains the label, the extension duration in seconds, and the referrer identifier.
The payer does not have to be the owner; another account can pay the renewal fee.
IPermissionedRegistry.State memory state = _requireRenewable(rd.label, rd.duration); // reverts if not
uint64 newExpiry = state.expiry + rd.duration; // reverts if overflow
amount = rentPriceOracle.getRenewPrice(rd.label, state.expiry, rd.duration, paymentToken); // reverts if invalid
ETH_REGISTRY.renew(state.tokenId, newExpiry);
_onRenew(rd.label, rd.duration);state.expiry + rd.duration becomes the renewed expiry, newExpiry.
That value is written back through ETH_REGISTRY.renew, and the renewal fee is returned as amount.
The calling public function collects the fee according to this calculation.
Renewal does not change the owner or roles.
Renewing an existing registration during the grace period is distinct from changing permission generations when another party re-registers it. When the previous registration is restored, the original owner and role relationships remain in use. When someone else acquires the name again, the registration is separated so that previous delegations do not carry over.
The renewal destination also depends on migration status.
Unmigrated ENSv1 names use ETHRenewerV1, while migrated or newly registered ENSv2 names use ETHRegistrar.
The expiry of reserved legacy names is also adjusted, so this should not be understood as immediately reducing the grace period of every ENSv1 name from 90 days to 28 days.

Reverse resolution and primary names
Because multiple ENS names can point to the same address, choosing a display name for an address requires a separate record. The name a person sets for their own display is called the primary name. Reverse resolution obtains that candidate and verifies through forward resolution that it points back to the same address.
For example, if reverse resolution of address A returns alice.eth but the name resolves forward to address B, it should not be adopted as A's display name.
The reverse function of UniversalResolver includes this check and reverts with ReverseAddressMismatch on a mismatch.
At the launch of ENSv2, reverse resolution uses the ENSv1 infrastructure.
The root's reverse name connects to ENSV1Resolver to read existing reverse records.
Functions writing to Ethereum's addr.reverse also use the ENSv1 ReverseRegistrar.
Distinguish this from the new L2 reverse-resolution architecture described as planned in the official documentation.
The reverse name of an Ethereum address consists of the 40 lowercase hexadecimal characters without 0x, followed by .addr.reverse.
ReverseRegistrar computes the reverse node by combining the label hash of that string with the namehash of addr.reverse.
The input differs from directly hashing the 20-byte address.
This node is used to select storage locations in the legacy registry and resolver.
claimForAddr sets the owner and resolver of the reverse node.
Storing the display name is a separate operation: setNameForAddr also updates the resolver's name record after claimForAddr.
The adapter for contract accounts checks whether the caller is the account itself or its owner.
It also accepts operations from accounts authorized to set the name.
After checking these authorizations, it forwards the call to the legacy ReverseRegistrar.
https://github.com/ensdomains/ens-contracts/blob/staging/contracts/reverseRegistrar/ReverseRegistrar.sol
Consequently, claiming a reverse node alone does not set a display name. Furthermore, a matching name and address should not substitute for signature-based authentication at login.

Migration from ENSv1
After the launch of ENSv2, existing ownership tokens and all their records are not recreated at once.
Instead, legacy names are initially secured as reservations, remaining readable until owners choose to migrate individually.
For wrapped names, restrictions from the legacy NameWrapper are also carried over into post-migration roles.

Continuity through reservations and mirroring
During pre-migration, existing .eth names are secured as RESERVED in ENSv2.
Reservations record the name, expiry, and resolution connections, but do not yet create a new owner or ownership token.
While preventing the name from being acquired as a new registration, ENSV1Resolver returns results from the legacy registry and resolver.
As long as this mirror path is in use, updates to legacy records are reflected in reads.
Read-only apps using a compatible UniversalResolver can reduce the burden of determining which registry version to use for each name.
However, the mirror is a connection for reading legacy values, so the returned address cannot necessarily be treated as a write destination.
Reserved expiries are extended to account for the difference between the old 90-day grace period and the new 28-day grace period.
The official procedure accounts for approximately 62 days of difference and boundary adjustments. Renewals of unmigrated names use ETHRenewerV1 to keep the legacy infrastructure and reservation in sync.
It does not apply the 28-day grace period uniformly to all legacy names from launch day.

Moving ownership tokens and carrying over records
Unwrapped .eth names and wrapped names that can be unwrapped migrate through UnlockedMigrationController.
For unwrapped names, the controller receives the legacy ERC721 token and migration data, checking both the correspondence between label and token ID and the contract from which the token was received.
If the checks pass, it transfers control of the legacy name, sends the old token to Graveyard, and changes the reservation into a registration with an owner.
The migration data specifies the new owner. It also selects the resolver and child registry destinations. The recipient need not be the same account as the pre-migration holder. The legacy name and token are moved only after the checks pass.
if (tokenId != uint256(keccak256(bytes(md.label)))) {
revert LibMigration.NameDataMismatch(tokenId);
}
_BASE_REGISTRAR.reclaim(tokenId, address(this));
_REGISTRY_V1.setRecord(
NameCoder.namehash(NameCoder.ETH_NODE, bytes32(tokenId)),
GRAVEYARD, // transfer ownership to graveyard
address(0), // clear ENSv1 resolver
0
);
_BASE_REGISTRAR.safeTransferFrom(address(this), GRAVEYARD, tokenId); // transfer token to graveyard
_inject(md);
return this.onERC721Received.selector;setRecord transfers ownership of the legacy name to GRAVEYARD and zeros its legacy resolver designation.
After the old token is sent to the same destination, _inject(md) registers the new owner and destinations specified in the migration data.
This code does not copy every address and text record to the new storage destination.
Prepare the records and roles of the new resolver before migration. Do not assume the legacy addresses and profiles will automatically be present in the new destination. Verify the actual values returned after switching destinations. Token migration and record migration are separate concerns.
Wrapped names that cannot be unwrapped are handled by LockedMigrationController. Subnames independent of their parents have a migration path through the migrated parent's WrapperRegistry.
Non-independent subnames whose parents retain control fall outside the scope of that migration controller.
Instead, they are registered again in the parent's ENSv2 registry once it exists.
If the received token does not match the migration data, receipt fails and the changes in the transaction are reverted.
However, once migration succeeds, there is no mechanism for freely retrieving the old token from Graveyard and restoring the original registration.

NameWrapper restrictions and post-migration roles
The ENSv1 NameWrapper records irreversible restrictions as bits alongside ownership and expiry.
These restriction flags are called fuse flags.
CANNOT_UNWRAP prohibits unwrapping, while CANNOT_SET_RESOLVER prohibits changing the resolver designation.
When migrating a locked name, preserve its restrictions by not granting roles corresponding to prohibited operations. If resolver changes are prohibited, omit the resolver-changing role. If transfers are prohibited, omit the administrative bit that permits transfers. The roles granted to the name itself are calculated from the legacy flags.
function _tokenRoleBitmapFromFuses(uint32 fuses) internal pure returns (uint256 roleBitmap) {
if ((fuses & CANNOT_SET_RESOLVER) == 0) {
roleBitmap |= RegistryRolesLib.ROLE_SET_RESOLVER;
}
if (LibMigration.notFrozen(fuses)) {
roleBitmap |= roleBitmap << 128; // give admin
}
if ((fuses & CANNOT_TRANSFER) == 0) {
roleBitmap |= RegistryRolesLib.ROLE_CAN_TRANSFER_ADMIN; // no user
}
}If CANNOT_SET_RESOLVER is not set, add the role that allows changing the resolver designation.
If notFrozen is true, also add the administrative bits corresponding to the operational roles.
The final ROLE_CAN_TRANSFER_ADMIN is a special administrative bit without an ordinary role counterpart and is evaluated independently when transfers are not prohibited.
For names whose restrictions are also frozen by CANNOT_BURN_FUSES, ordinary administrative permissions are not granted.
This avoids restoring an administrator capable of removing prohibitions after migration.
Transfer permission is an exception represented only by an administrative bit, so it is inaccurate to say that every administrative bit is cleared unconditionally.
In addition to the roles for the name itself, the global roles of the registry managing its children are calculated separately.
For example, if CANNOT_CREATE_SUBDOMAIN is set, the created WrapperRegistry is not granted the registration role for issuing child names.
Its initialization also derives roles from legacy NameWrapper flags rather than accepting an arbitrary external set of roles.
For subnames at the third level or deeper with CAN_EXTEND_EXPIRY, which permits expiry extension, this version sets the expiry to type(uint64).max instead of adding a renewal role.
Names directly under .eth use their reserved expiry at migration, so not all migrated names become perpetual.
This differs from the initial deployment tag, which assigned a renewal role.
For names whose resolver designation cannot be changed, there is also an exception mapping known legacy PublicResolver instances to PublicResolverV2.
Even in this case, verify the name's designated destination and the contents of its records separately.

Verifying read results
After migration succeeds, resolve the name from the canonical root. Read the currently valid owner and verify the designated resolver and child registry. For record updates, also check the resolver's roles and the actual returned values.
An indexer building a list of names should track them using the registry address and stable label identifier.
Continuing to retain an old token ID after a role change can cause the same name to be lost from the index, so use TokenRegenerated to associate the old and new IDs.
Record update events refer to recordId, so also use Linked to track associations between names and record IDs.
Distinguish stale indexer displays from discrepancies in the contract's current values.
Conclusion
In ENSv2, parent registries designate child management destinations and resolvers return records associated with names.
Recording name ownership, operational roles, and record-writing permissions separately makes delegation and sharing possible.
When reading the implementation, trace which registry contains the name, which roles can update it, and which resolver supplies its values.
The same three relationships help distinguish legacy token movement, preservation of old restrictions, and record preparation when migrating ENSv1 names.
The ENSv2 architecture and migration procedures are described in the official ENS documentation. https://docs.ens.domains/
