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.

This article examines ERC-7529, a proposed mechanism for discovering and verifying relationships between corporate domains and smart contracts using DNS TXT records.

This article translates, summarizes, and expands on the following specification.

More EIP, BIP, SLIP, CAIP, ENSIP, RFC, and ACP explainers:

Overview

ERC-7529 describes how web applications can retrieve DNS TXT records using DNS over HTTPS (DoH) and associate smart contracts with ordinary DNS domains.

TXT records contain free-form text and are commonly used for email authentication and domain ownership verification.

DoH carries DNS requests over HTTPS, protecting the connection to the selected DNS resolver against interception and modification in transit. It enables web applications to query DNS records directly, although the resolver and underlying DNS infrastructure still form part of the trust model.

ERC-7529 uses this mechanism to retrieve TXT records containing references to smart contracts. A client can discover a domain's declared contract addresses, reducing some forms of impersonation and improving discovery through conventional web infrastructure.

For example, a stablecoin issuer could publish contract references so wallets can check whether a contract is associated with the issuer's known domain.

Motivation

As more businesses use blockchains and digital assets, users need a convenient way to discover which contracts are associated with which organizations.

Because businesses often organize their web presence around domain names, the mechanism should work with established web discovery and verification practices.

Before browser applications could conveniently use DoH, they often depended on an application-controlled server or third-party service to query DNS. Such intermediaries could modify responses. DoH enables direct HTTPS queries to a selected resolver, reducing reliance on application-specific intermediaries, without eliminating the need to trust DNS resolution.

Providers such as Cloudflare identify TXT records as a common mechanism for email authentication and domain ownership verification. Contract discovery has a similar purpose: allowing domain administrators to publish assertions.

Publishing contract references in TXT records can:

  • Help users discover and evaluate contracts declared by a domain administrator.
  • Help applications identify tokens and NFTs associated with a known business domain.
  • Make contract information discoverable through existing web and search infrastructure.

The proposal illustrates several applications.

Example 1: payment processors and stablecoins

A customer purchases an item at merchant.com. The payment processor, paymentprocessor.com, issues its own stablecoin and publishes the relevant contract reference under ERC-7529.

The merchant embeds a paymentprocessor.com page in an iframe. A compatible wallet can inspect the iframe's domain, query its TXT records, and discover the associated contract.

After verifying the relevant association, the wallet can offer payment using the stablecoin declared by that domain. This establishes a domain association, not a guarantee of the token's solvency or security.

Example 2: brand discovery on an NFT marketplace

A visitor to nftmarketplace.io wants to buy an NFT issued by a favorite brand, such as theirfavoritebrand.com.

The marketplace could let users search by brand domain and check whether the NFT contract is among the domain's published references.

This helps users identify the brand's declared NFT contracts and provides businesses with an additional way to distinguish official assets from imitations.

Specification

Definition of eTLD+1

A top-level domain (TLD) is the final label of a domain name, such as .com or .net.

If registrable domains always sat directly below a TLD, abc.myexample.com and def.myexample.com would generally fall under the same registrable domain.

However, public suffixes such as .ac.uk contain multiple labels. The effective top-level domain (eTLD) is the applicable public suffix, and eTLD+1 adds the registrable label immediately above it.

For example:

Domain name eTLD eTLD+1
myexample.com .com myexample.com
sussex.ac.uk .ac.uk sussex.ac.uk

Domains sharing an eTLD+1 generally fall under the same registrable domain, although subdomain administration may be delegated. ERC-7529 uses this level to associate contracts with a domain.

Publishing contract information in TXT records

The organization controlling an eTLD+1 publishes a TXT record in its DNS with the contract addresses it wants to associate with that domain.

DNS TXT records are not intended for large data sets, and providers impose size limits. An EVM address is about 42 characters long, so multiple addresses can generally be included within the permitted limits. A hostname can also have multiple TXT records, which clients can retrieve using DoH.

The record format is:

Field Content
HOST ERC-7529.<chain_id>._domaincontracts(chain_id is the numeric ID of the target chain)
VALUE address1,address2,…

The proposal recommends ERC-1191 checksum formatting for EVM addresses. This helps clients detect address errors and incorporate chain information into checksum validation.

For an introduction to ERC-1191, see:

[ERC1191] Using Chain IDs in Ethereum Address Checksums

A web application can retrieve the TXT records using DoH. The following example illustrates the request.

javascript
await fetch("https://example-doh-provider.com/dns-query?name=ERC-7529.1._domaincontracts.myexample.com&type=TXT", {
  headers: {
    Accept: "application/dns-json"
  }
})

This lets the application obtain contract references directly from a selected resolver rather than relying on a separate application intermediary.

Associating smart contracts with domains

A contract may optionally implement the on-chain portion of ERC-7529. This allows clients to check whether it declares an association with an eTLD+1.

The contract maintains:

  • A domains mapping keyed by the keccak256 hash of each eTLD+1 string.
  • An addDomain function for adding a domain.
  • A removeDomain function for removing a domain.
  • A checkDomain function for checking whether a domain is associated.

Clients can query a particular association. Optional AddDomain and RemoveDomain events help them track changes over time.

The example is:

js
{
  /// @notice Optional event emitted when a domain is added
  /// @param domain eTLD+1 associated with the contract
  event AddDomain(string domain);

  /// @notice Optional event emitted when a domain is removed
  /// @param domain eTLD+1 that is no longer associated with the contract
  event RemoveDomain(string domain);

  /// @dev a mapping from the keccak256 hash of eTLD+1 domains associated with this contract to a boolean
  mapping(bytes32 => bool) domains;

  /// @notice a getter function that takes an eTLD+1 domain string and returns true if associated with the contract
  /// @param domain a string representing an eTLD+1 domain
  function checkDomain(string calldata domain) external view returns (bool); 

  /// @notice an authenticated method to add an eTLD+1 domain
  /// @param domain a string representing an eTLD+1 domain associated with the contract
  function addDomain(string calldata domain) external;

  /// @notice an authenticated method to remove an eTLD+1 domain
  /// @param domain a string representing an eTLD+1 domain that is no longer associated with the contract
  function removeDomain(string calldata domain) external; 
}

Client-side verification

Clients can approach verification from either direction.

  • Starting with a TXT record: retrieve the listed contract addresses, call checkDomain through RPC for each compatible contract, and pass the relevant eTLD+1 to check whether it returns true.
  • Starting with a contract: inspect AddDomain and RemoveDomain events where available, identify the associated eTLD+1, then query its TXT record and check whether the contract address is listed.

For mutual association checks, the client verifies:

  • The TXT record was retrieved for the intended eTLD+1.
  • The record's value contains the expected contract address on the relevant chain.
  • The contract's domain mapping confirms the same eTLD+1.

Matching records provide evidence of a mutual declaration between the domain and contract administrators. They do not independently establish a legal corporate identity or the safety of a contract.

Additional explanation

The ERC-7529 hostname convention serves two purposes:

  • Resemble established mechanisms such as DKIM, making it familiar to DNS administrators.
  • Make the records easy for software to construct and parse.

DKIM publishes public keys and configuration in TXT records at predictable subdomains. ERC-7529 similarly uses a defined naming pattern.

text
ERC-7529.<chain_id>._domaincontracts

The chain_id is the decimal numeric ID of the target blockchain network. Ethereum mainnet uses 1 and Sepolia uses 11155111.

Target chain chain_id Example HOST
Ethereum Mainnet 1 ERC-7529.1._domaincontracts
Sepolia 11155111 ERC-7529.11155111._domaincontracts

The ERC-7529 prefix distinguishes these TXT records from records used for email or other authentication mechanisms.

Embedding the chain ID allows clients to:

  1. Construct the hostname using the domain and target chain ID.
  2. Query that hostname's TXT records through DoH.
  3. Interpret the returned values as a list of contract addresses.

This makes chain-specific declarations discoverable by software.

The design also supports cross-checking two information sources: DNS and blockchain state.

  • The contract's domains mapping is updated through addDomain and removeDomain. With appropriate access controls, only authorized contract administrators can modify it.
  • TXT records can be modified by parties with the relevant DNS administration privileges.

When the declarations match, they support the conclusion that the parties controlling the two resources have established a mutual association. The client can use this evidence when evaluating a domain-contract relationship.

Security

ERC-7529 relies in part on traditional DNS and is therefore exposed to risks such as domain hijacking, in which an attacker obtains control of DNS configuration.

A compromised domain could publish unauthorized contract references. Protecting domain administration and the resolution path is therefore essential.

Contract design matters as well. Functions such as addDomain and removeDomain need appropriate authorization checks, for example restricting changes to authorized owners or administrators. Without these controls, an attacker could make unauthorized domain claims.

The original article describes mutual verification as requiring consistent changes on both sides:

  1. The domain's DNS TXT record.
  2. The smart contract or its authorized domain-association state.

For a previously known domain-contract pair, an isolated unauthorized modification to one side may produce a detectable mismatch. However, this does not imply that every forgery requires compromising two pre-existing resources. An attacker controlling DNS could publish a new attacker-controlled contract that declares the same domain. Likewise, a contract-side claim alone is insufficient when the DNS record does not confirm it.

Clients should distinguish discovery from verification of a previously trusted address and apply an appropriate trust model. The optional on-chain check, correct chain selection, trusted DNS resolution, and independent knowledge of the intended organization all matter.

DNS compromise may also affect email infrastructure, including MX, SPF, DKIM, and DMARC records. These risks are shared with existing domain-based trust systems.

In summary, mutual declarations can provide stronger evidence than a single assertion in some circumstances, but domain security, contract authorization, and the client's trust assumptions remain essential.

Reference implementation

js
function checkDomain(
  string calldata domain
) external view returns (bool) {
return domains[keccak256(abi.encodePacked(domain))];
}

function addDomain(
  string memory domain
) external onlyRole(DEFAULT_ADMIN_ROLE) {
domains[keccak256(abi.encodePacked(domain))] = true;
emit AddDomain(domain);
}

function removeDomain(
string memory domain
) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(domains[keccak256(abi.encodePacked(domain))] == true, "ERC7529: eTLD+1 currently not associated with this contract"); 
domains[keccak256(abi.encodePacked(domain))] = false;
emit RemoveDomain(domain);
}

Citation

Todd Chapman (@tthebc01), Charlie Sibbach charlie@cwsoftware.com, Sean Sing (@seansing), "ERC-7529: Contract Discovery and eTLD+1 Association [DRAFT]," Ethereum Improvement Proposals, no. 7529, September 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7529.

Conclusion

ERC-7529 proposes discovering and checking domain-contract associations through DNS TXT records and optional on-chain verification.

If you have questions, feel free to contact me on Twitter.

Twitter @cardene777

I also publish material on the following platforms.