> For the complete documentation index, see [llms.txt](https://docs.dothype.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dothype.io/architecture/how-it-all-works/dothype-smart-contracts/resolver-contract.md).

# Resolver Contract

Fully ENS-compatible, the Resolver contract supports multiple record types, reverse resolution, and metadata customization. It follows the standard ENS interface structure but is tightly integrated with the dotHYPE Registry to enforce domain status and expiration.

This contract does not handle ownership—it simply reflects what the Registry allows, and enables you to associate rich identity data with your name.

### 🔍 What It Does

The Resolver supports:

* Address resolution (EVM and multi-chain)
* Text records (socials, avatar, website, etc.)
* Content hash linking (IPFS, Swarm)
* Reverse resolution (address → name)
* Record versioning and batch updates

If your name is expired or inactive, all resolution queries return blank results. The Resolver **only returns records for active `.hype` names**.

### 🔗 Address Resolution

You can link your `.hype` name to wallet addresses using either:

* A simple EVM address (default Ethereum-style resolution)
* A multi-coin address using SLIP-0044 standards

```solidity
function addr(bytes32 node) external view returns (address);
function addr(bytes32 node, uint256 coinType) external view returns (bytes memory);
```

Set via:

```solidity
function setAddr(bytes32 node, address addr) external;
function setAddr(bytes32 node, uint256 coinType, bytes calldata addr) external;
```

> If no address is set, most systems default to the current domain owner.

### 📝 Text Records

Text records allow you to embed human-readable metadata into your `.hype` name.

Common uses include:

* Socials: `com.twitter`, `com.github`
* Profile: `avatar`, `description`
* Contact: `email`, `url`, `website`

```solidity
function text(bytes32 node, string calldata key) external view returns (string memory);
function setText(bytes32 node, string calldata key, string calldata value) external;
```

Text records power UI display, social graphing, and indexing.

### 🧬 Content Hash

Use a `.hype` name to link to decentralized content like:

* IPFS files or websites
* Swarm hashes
* Other content-addressed systems

```solidity
function contenthash(bytes32 node) external view returns (bytes memory);
function setContenthash(bytes32 node, bytes calldata hash) external;
```

> This is ideal for user profiles, dApp frontends, or media hubs.

### 🔄 Versioning System

Rather than deleting records one by one, dotHYPE enables full record resets via versioning.

```solidity
function recordVersions(bytes32 node) external view returns (uint256);
function clearRecords(bytes32 node) external;
```

Each record is linked to a version counter:

* `clearRecords()` bumps the version
* All previous records become invalid

Useful for refreshing a stale or incorrect profile in one transaction.

### 🔁 Reverse Resolution

Reverse records map wallet addresses back to `.hype` names. This is what makes UIs (wallets, explorers, dApps) show your name instead of a 0x address.

Key functions:

```solidity
function setReverseRecord(string calldata name) external returns (bytes32);
function clearReverseRecord() external;
function reverseLookup(address addr) external view returns (string memory);
function getName(address addr) external view returns (string memory);
```

You can also:

* Query a text record via reverse: `getValue(address, key)`
* Check if an address has a reverse record: `hasRecord(address)`

### 🚫 Domain Expiration Enforcement

The Resolver **enforces expiration checks**. If a domain is expired:

* All resolution returns are blank
* Records cannot be set or updated

```solidity
function isAuthorized(bytes32 node) internal view returns (bool);
```

This ensures that only active `.hype` names can display metadata or resolve onchain.

### 🧩 Multi-call Support

To keep things gas-efficient, the resolver supports batch operations:

* Set multiple records in a single call
* Commonly used when updating profiles or migrating data

> This feature inherits from the `Multicallable` interface standard.

### 🔐 Access & Authorization

Only the current name owner can set or update records.

* Ownership is checked against the Registry
* If your name is expired, you temporarily lose write access

All write functions include internal `isAuthorized()` checks.

### 📡 Interface Discovery

Applications can check whether this resolver supports a given record type using:

```solidity
function supportsInterface(bytes4 interfaceID) public view override returns (bool);
```

dotHYPE Resolver supports:

* `IAddrResolver`
* `IAddressResolver`
* `ITextResolver`
* `IContentHashResolver`
* `IReverseResolver`

This ensures compatibility with ENS-resolving dApps and multi-chain interfaces.

### 🧠 For Developers

If you're building with `.hype` names:

* Use `addr()` to resolve to a wallet or contract
* Use `text()` to display social or profile metadata
* Use `reverseLookup()` to show names for addresses

The Resolver does not store ownership—it’s a read/write utility that enhances what the Registry tracks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dothype.io/architecture/how-it-all-works/dothype-smart-contracts/resolver-contract.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
