For the complete documentation index, see llms.txt. This page is also available as Markdown.

On-Chain Domain Management

This guide walks through managing a domain that is already registered and tokenized on Doma, entirely from the wallet that holds its ownership token: updating nameservers and DNSSEC DS keys, managing DNS records, and claiming the domain (including using a claim to update the registrant's contact details).

Register vs. tokenize vs. manage. To register a brand-new name, see Domain Registration. To bring a domain you already own on-chain, see How to tokenize a domain. This guide starts where those end: you hold an ownership token and want to change the domain's settings without touching a registrar control panel.

How it works

Every management operation is one transaction from the token owner's wallet to the Proxy Doma Record contract on the chain where the ownership token lives. The proxy checks that you own the token, that it has not expired, that the domain carries the capability the operation needs, and that the protocol fee (if any) is attached. It then relays a cross-chain message to the Doma Record on Doma Chain, the authoritative record for every tokenized name.

Doma Chain validates the request again and emits an event. What happens next depends on the operation:

Operation
Who applies the change

Nameservers, DS keys

The domain's sponsoring registrar picks the request up (NAME_NAMESERVERS_UPDATE_REQUESTED / NAME_DS_KEYS_UPDATE_REQUESTED on the Poll API), applies it at the registry, and writes the result back to Doma Chain.

DNS records, domain on Doma nameservers

Doma validates the records and writes them to the zone it serves.

DNS records, domain on other nameservers

The registrar picks the request up (NAME_DNS_RR_SET_BATCH_UPDATE_REQUESTED) and applies it on its own DNS platform.

Claim

The registrar receives the claim request, retrieves the registrant's verified contacts, updates the registrant at the registry, and approves or rejects the claim on Doma Chain.

Prerequisites

  • An API key — same as for registration: create one at app-testnet.doma.xyz/account/developers (or app.doma.xyz/account/developers for mainnet) and send it in the Api-Key header. It is only needed to read state and to upload contacts for a claim; the on-chain calls need no key.

  • The wallet that owns the ownership token — every call is msg.sender-gated. Nameservers, DS keys and claims need the ownership token; synthetic tokens can only manage DNS records.

  • Native gas on the token's chain, plus the protocol fee for the operation if one is configured (see Protocol fees).

Right now, protocol fees are set to zero for all management operations on all chains.

Network details

Testnet
Mainnet

GraphQL API

https://api-testnet.doma.xyz/graphql

https://api.doma.xyz/graphql

Doma Chain ID

97476

97477

Doma CAIP-2

eip155:97476

eip155:97477

Doma RPC

https://rpc-testnet.doma.xyz

https://rpc.doma.xyz

Doma Explorer

https://explorer-testnet.doma.xyz

https://explorer.doma.xyz

Contracts

You call the Proxy Doma Record on the chain where your ownership token lives (ownershipToken.networkId in the API).

Testnet
Mainnet

Proxy Doma Record

0xC21C932BE327A6Ae32071f40e097612fd8D5b445

0xd0000000000067CB44aE7b6aC3AB5764dE20A3E2

Ownership Token

0x9a88adE7B61998dCF2A64A1D43B3377Ad1a62318

0xd000000000009E6bEa0bA0c5D964AE98d59ED318

Doma Record

0x6754B3F973A83d9B7A9Bfd3B5fC139ED7B9b1aAf

0xd000000000003eC7096c7B280b274F20b305b82a

Addresses are the same on every tokenization chain of a given environment; See Deployed Smart Contracts for the full list. The ABI is attached to the (EVM) Proxy Doma Record API page; the examples below use human-readable signatures with viem, so no ABI file is required.

All examples use testnet.

Resolve the token and check capabilities

Everything starts with the name's current on-chain state. One query returns the ownership token, who owns it, the capabilities the protocol grants the domain, and the current delegation:

ownershipToken.tokenId is the value every contract call takes. It is the namehash of the full name (ENS-style, computed over the lowercase punycode labels), so the API value and namehash('example.com') agree, but treat the API as the source of truth.

Capabilities

A domain can carry two capabilities. They are a bitmask on-chain and an enum in the API:

Capability
Bit
Unlocks
Granted by

REGISTRY_RECORDS_MANAGEMENT

1

setNameservers, setDSKeys

The registrar, for all names it sponsors on Doma.

DNS_RECORDS_MANAGEMENT

2

setDNSRRSet, setDNSRRSetBatch

The registrar per domain, or implicitly whenever every nameserver of the domain is a Doma nameserver (ns1.doma.xyz, ns2.doma.xyz on mainnet; ns1-stage.d3.dev, ns2-stage.d3.dev on testnet).

The effective set is the union of the registrar-level grant, the domain-level grant and the implicit Doma-nameserver grant. The API's capabilities field already applies all three, so if the capability is not in that list, the call will revert with InsufficientCapabilities(tokenId, requiredCapability).

If you prefer to check on-chain, the ownership token contract exposes the domain-level set (including the implicit grant) via domainCapabilitiesOf(tokenId) and hasCapability(tokenId, 2). The registrar-level grant lives on the Proxy Doma Record and is not exposed as a view, so for REGISTRY_RECORDS_MANAGEMENT simulate the call (eth_call) and check for the revert.

Checks every write perform: The caller must own the token (InvalidOwnerAddress), the token must not be expired (NameTokenHasExpired), and the protocol fee must match exactly (InvalidFee / FeeNotRequired). Nameservers, DS keys and claims additionally require the ownership token rather than a synthetic one (SyntheticTokenNotSupported).

Update nameservers

setNameservers(tokenId, nameservers) replaces the whole delegation. Pass every nameserver the domain should keep, not only the new ones. Requires REGISTRY_RECORDS_MANAGEMENT.

Rules the registry will enforce after the fact (the contract does not, so a bad set is accepted on-chain and bounced later):

  • Between 2 and 13 hostnames, no duplicates.

  • Lowercase LDH hostnames (ns1.example-dns.com), punycode for IDN hosts, no trailing dot.

  • Nameservers inside the domain itself need glue records at the registry; set those up through the host's registrar first.

What happens next: Doma Chain emits NameNameserversSet, the registrar receives NAME_NAMESERVERS_UPDATE_REQUESTED, updates the delegation at the registry, and reports the applied state back on-chain (NameUpdated). The API's nameservers field changes only at that point.

Verify, with the correlation id taken from the receipt (see Tracking a request):

The request is done when offChainConfirmation is APPROVED, the paired UPDATE_NAMESERVERS is SUCCEEDED, and nameservers shows the new set. An UPDATE_NAMESERVERS that ended FAILED carries a failureReason; a set the registry refused is never relayed, so the request stays at null and the delegation is unchanged.

Update DNSSEC DS keys

setDSKeys(tokenId, dsKeys) replaces the DS record set the registry publishes in the parent zone. An empty array removes DNSSEC for the domain. Requires REGISTRY_RECORDS_MANAGEMENT.

Each key is a struct:

Field
Type
Notes

keyTag

uint32

0–65535, from your signing key's DNSKEY record.

algorithm

uint8

DNSSEC algorithm number, e.g. 13 (ECDSAP256SHA256), 8 (RSASHA256).

digestType

uint8

2 (SHA-256) is accepted by every registry; 1 (SHA-1) and 4 (SHA-384) where the registry allows them.

digest

bytes

The digest as hex bytes, 0x-prefixed (64 hex characters for SHA-256).

Doma Chain emits NameDSKeysSet, the registrar receives NAME_DS_KEYS_UPDATE_REQUESTED, publishes the DS records at the registry and reports back with NameUpdated. See Tracking a request for more details.

On Doma nameservers you normally never call this. Doma signs the zone it serves and keeps the registry's DS records in sync with its own keys (the zone's keys are visible under name { zone { dsKeys } }). Set DS keys yourself only when the domain is delegated to nameservers you run or a third-party DNS provider that signs your zone, and remember to update them whenever you roll keys there.

Update DNS records

Requires DNS_RECORDS_MANAGEMENT, which in practice means either the domain is delegated to the Doma nameservers or the registrar granted the capability for its own DNS platform. Check capabilities first.

Read the current zone

The API reports the apex as host: "@" and values in their normalized form (TXT values quoted, CNAME/MX targets with a trailing dot).

Semantics

  • The unit of change is one record set, identified by (host, type). The values you pass replace that set. Sets you do not name are left untouched; this is never a full-zone replace.

  • An empty records array deletes the set (the TTL is ignored; send 0).

  • host is relative to the domain: www, mail.eu, _dmarc, or a leftmost * wildcard. Use the empty string "" for the apex; "@" is not a valid label on-chain and reverts with InvalidHost. Hosts are validated per RFC 2181/8552: lowercase letters, digits, hyphens and underscores, labels of at most 63 characters, 253 characters total.

  • Supported types: A, AAAA, CNAME, MX, TXT. NS and DS records for delegated child zones are accepted as well, but apex nameservers and the domain's own DS keys go through Update nameservers and Update DNSSEC DS keys.

  • Validation applied before the zone is written: A/AAAA must be valid IPs; CNAME cannot sit at the apex, cannot coexist with any other type at the same host, and cannot point to an IP or to itself; MX is "<priority> <hostname>", e.g. "10 mail.example.com"; TXT values are at most 255 characters each and are quoted for you. A request that fails these checks is rejected after the transaction: the command's offChainConfirmation becomes REJECTED and offChainRejectionReason carries the message.

  • setDNSRRSet writes one set; setDNSRRSetBatch writes many hosts in one transaction. Every hostInputs entry needs at least one record set.

Doma Chain emits NameDNSRRSetBatch with a useDomaNameservers flag. When it is true, Doma validates the sets against the current zone and writes them; when false, the registrar receives NAME_DNS_RR_SET_BATCH_UPDATE_REQUESTED and applies them on its DNS platform. Either way, track the REQUEST_DNS_RR_SET_UPDATE by correlation id and read recordSets once it is approved:

Synthetic and subdomain tokens. setDNSRRSet and setDNSRRSetBatch also accept a synthetic token. For a subdomain token, host is relative to the subdomain ("" is the subdomain's own apex), and a host that has an active subdomain token under a parent token is refused with SubdomainHostInUse.

Claim the domain and manage registrant contacts

Why a claim exists

A registered domain always has a registrant of record at the registry, with verified contact details that ICANN and the registries require. When a domain is tokenized, that registrant is the person who tokenized it, and the Doma Record stores their wallet as claimedBy.

The ownership token can then change hands freely: a sale on a marketplace, a transfer, a bridge. The registrar learns about the new holder from the chain but knows nothing about them, and cannot invent a registrant. So on every transfer of an ownership token the Doma Record resets claimedBy to the Doma proxy (the zero address on Doma Chain, e.g. eip155:97476:0x0000000000000000000000000000000000000000 on testnet) and the registrar puts Doma's proxy contact on the registration. The domain keeps resolving and stays registered, but it is in temporary custody: the on-chain owner is not the registrant of record.

A claim closes that gap. The token holder uploads verified contact details to Doma, receives a signed proof-of-contacts voucher, and submits it on-chain. The registrar retrieves the contacts, updates the registrant at the registry, and approves the claim, which sets claimedBy to the holder's wallet.

Until a name is claimed by its current owner:

  • It cannot be detokenized (the contract reverts with NameIsNotClaimed, and the registrar's API refuses with "Claimer and owner do not match").

  • The holder has no standing at the registrar: no registrar account control, no auth codes, no registrar-side support for the name.

  • The registrant of record is Doma's proxy, not the holder, which matters for compliance, for WHOIS/RDAP, and for any process that identifies the owner through registration data.

Transferring the token again invalidates any pending claim request.

Check the claim state

Compare claimedBy with the token owner:

claimedBy

Meaning

Equals ownershipToken.ownerAddress

Claimed by the current owner. No claim is required.

The zero address on Doma Chain (eip155:<domaChainId>:0x000…000)

Unclaimed. A claim is required to become the registrant of record.

To see whether a request is already in flight, look at the name's activities, where a CLAIM_REQUESTED not yet followed by CLAIM_APPROVED or CLAIM_REJECTED means the registrar still has it:

On-chain, the Doma Record on Doma Chain exposes claimRequests(sld, tld) (reverts with ClaimRequestNotFound when nothing is pending), and the Proxy Doma Record exposes claimRequestedAt(tokenId): the timestamp of the last claim submitted for the token. The proxy refuses a new claim within 10 minutes of it, and a registrar rejection resets it to zero.

You can also list unclaimed names for a wallet directly:

Upload contacts and get a proof-of-contacts voucher

This is the same contact step as in Domain Registration, with two differences: networkId is the chain of the ownership token (ownershipToken.networkId), and registrarIanaId is the name's current registrar (registrar.ianaId). The email on the contact must be verified, through initiateEmailVerification / completeEmailVerification (standard key) or a pre-verified upload (uploadVerifiedRegistrantContacts, privileged key).

Example variables:

The contact details themselves never go on-chain. Doma stores them encrypted to the registrar's public key, and the voucher carries only the registrantHandle that lets the registrar fetch them.

Submit the claim on-chain

Call claimOwnership(tokenId, voucher, signature) from the wallet that owns the ownership token, on the token's chain, with the CLAIM_OWNERSHIP fee attached:

Reverts you may see:

Error
Cause

InvalidOwnerAddress

The sender does not own the ownership token.

SyntheticTokenNotSupported

The token is synthetic; only the ownership token can claim.

VoucherExpired

expiresAt has passed. Upload the contact again for a fresh voucher.

NonceAlreadyUsed

The voucher was already submitted. Each voucher is single-use.

InvalidSigner

The signature is not from Doma's contacts signer (or the voucher was altered).

ClaimRequestTooRecent

A claim was submitted for this token less than 10 minutes ago.

InvalidFee / FeeNotRequired

msg.value does not match the quoted fee (see Protocol fees).

Track the claim

The proxy relays the request to Doma Chain, which stores it and emits NameClaimRequested. The registrar receives NAME_CLAIM_REQUESTED, fetches the encrypted contacts by registrantHandle, updates the registrant at the registry, and then either approves (NameClaimApproved, claimedBy becomes your wallet) or rejects (NameClaimRejected, the cooldown is cleared so you can submit again).

The claim is complete when offChainConfirmation is APPROVED, the paired APPROVE_CLAIM_REQUEST is SUCCEEDED, and claimedBy equals ownershipToken.ownerAddress. A REJECTED request paired with a REJECT_CLAIM_REQUEST means the registrar declined; the cooldown is cleared and you can submit again.

Using a claim to update registrant contacts

A claim is not only for unclaimed names. The protocol does not require the name to be unclaimed: the Proxy Doma Record checks only that you own the ownership token, that the voucher is valid and unused, that the cooldown has passed, and that the fee is attached. The Doma Record stores the request whatever claimedBy currently holds, and on approval it writes claimedBy again (to the same wallet) while the registrar applies the contacts behind the new registrantHandle at the registry.

So if your name is already claimed and you need to change the registrant's email, address or phone, repeat 5.1 to 5.3 with the new contact. The result is a registrant update at the registry, recorded on-chain as NAME_CLAIM_REQUESTED → NAME_CLAIM_APPROVED with the new handle.

Keep in mind:

  • The Doma Dashboard only offers "Claim" while a name is unclaimed. For a contact update on a claimed name, use the contract directly as shown here, or your registrar's own interface.

  • The 10-minute cooldown and the CLAIM_OWNERSHIP fee (when configured) apply to every submission.

  • Approval is the registrar's decision. The registrar can reject the request, and registrar or registry policy may apply to a registrant change, for example a temporary inter-registrar transfer lock after a change of registrant details.

  • The registrant handle and the voucher nonce are single-use; each update needs a new upload.

Protocol fees

Each operation can carry a protocol fee, quoted in USD and charged in the chain's native token through a Chainlink price feed. Read it right before sending and pass it as msg.value:

Operation names: SET_NAMESERVERS, SET_DS_KEYS, SET_DNS_RRSET, CLAIM_OWNERSHIP. The contract also exposes them as view functions (SET_NAMESERVERS_OPERATION() and so on) if you would rather not hash.

  • When the fee is 0, send value: 0n. Sending anything reverts with FeeNotRequired.

  • When a fee is configured, msg.value must equal the quote at the latest or the previous oracle round. If the price moved between your read and your transaction, the call reverts with InvalidFee(expectedFee, providedFee); re-read and retry.

  • A collected fee emits FeeCollected(feeWei, feeUsdCents, correlationId).

Tracking a request

Every write in this guide gets a correlation id: a 32-byte hex string the Proxy Doma Record generates per request and attaches to the cross-chain message. Doma indexes each request as a command keyed by that id, so it is the handle for everything that happens after your transaction is mined.

Get the correlation id from your transaction

Where it appears in the receipt depends on the chain the ownership token lives on:

  • Token on Doma Chain — the proxy calls the Doma Record in the same transaction, so the receipt carries the Doma Record's own event, whose last argument is the correlation id: NameNameserversSet, NameDSKeysSet, NameDNSRRSet / NameDNSRRSetBatch, NameClaimRequested.

  • Token on another chain (Base, Avalanche, …) — the receipt carries the Gateway's MessagePosted event instead. Its attributes hold the correlation id as the attribute whose first four bytes are 0xf23f601b (bytes4(keccak256("correlationId(bytes32)"))), followed by an ABI-encoded string.

  • When a protocol fee was charged, the proxy's FeeCollected(feeWei, feeUsdCents, correlationId) event carries it as well, on every chain.

Look up the command

The command exists once Doma's indexer has seen the Doma Chain event, usually within seconds of the transaction; until then the query answers "Command not found", so retry rather than treat it as an error.

Read the status

Two different things are tracked on a request:

Field
Set by
Meaning

status

Doma's indexer

Whether the request itself reached Doma Chain. A request sent from Doma Chain is SUCCEEDED as soon as it is indexed; from another chain it stays PENDING while the cross-chain message is in flight. It says nothing about the registry.

offChainConfirmation

The party that applies the change

null while nobody has acted on it, APPROVED once it was applied, REJECTED when it was refused, with the reason in offChainRejectionReason.

Who sets offChainConfirmation:

  • Nameservers, DS keys, claims — the registrar. APPROVED is recorded when the registrar relays its own command for your request (UPDATE_NAMESERVERS, UPDATE_DS_KEYS, APPROVE_CLAIM_REQUEST); REJECTED when it relays a REJECT_CLAIM_REQUEST. A registrar that has not acted yet, or that could not apply a nameserver or DS key change at the registry, leaves it null.

  • DNS records on Doma nameservers — Doma. APPROVED once the zone is written; REJECTED with the validation message (for example a CNAME coexistence conflict) when the change is invalid.

  • DNS records on other nameservers — the registrar, through its explicit confirmation API, with a reason on rejection.

lifecycle shows the same information as stages: SENT_TO_DOMA and SENT_TO_REGISTRAR, then REGISTRAR_APPROVAL (IN_PROGRESS, APPROVED or REJECTED), and for nameserver and DS key requests the registrar's on-chain execution (UPDATING_ON_DOMA, PROPAGATING_CAPABILITIES) with CONFIRMING, COMPLETED or FAILED and the Doma Chain transactionId.

Pair the request with the registrar's execution

The registrar's execution is a command of its own (UPDATE_NAMESERVERS, UPDATE_DS_KEYS, APPROVE_CLAIM_REQUEST, REJECT_CLAIM_REQUEST) whose confirmationForCommand points back at your request. List the name's commands and match on your correlation id:

This listing is also the fallback when you do not have the correlation id: it is sorted newest first, so the latest item of your request type is your request.

A request is done when:

Request
Done when

Nameservers

offChainConfirmation is APPROVED, the paired UPDATE_NAMESERVERS is SUCCEEDED, and name.nameservers shows the new set.

DS keys

offChainConfirmation is APPROVED, the paired UPDATE_DS_KEYS is SUCCEEDED, and name.dsKeys shows the new keys.

DNS records

offChainConfirmation is APPROVED and recordSets shows the change. There is no paired command: the zone is written off-chain.

Claim

offChainConfirmation is APPROVED, the paired APPROVE_CLAIM_REQUEST is SUCCEEDED, and name.claimedBy equals your wallet. REJECTED with a paired REJECT_CLAIM_REQUEST means you can submit a new claim.

Poll API can also be used to receive all events as they arrive. This is useful to track large number of domains at the same time.

Going to mainnet

Swap the endpoint, RPC, contract addresses and API key to the mainnet values above. The ownership token's networkId tells you which chain to transact on; the Proxy Doma Record address is the same on every mainnet tokenization chain. Everything else is identical.

Last updated