Building Doma Protocol: Connecting Domains to Blockchain

Share
Building Doma Protocol: Connecting Domains to Blockchain
Developer Blog by Sam Ward, Senior Blockchain Engineer, D3

Domains. More Than Just NFTs

I’m Sam Ward, a software engineer who has spent the last 5 years working in blockchain, particularly around decentralised naming systems including ENS and Handshake.

I currently work on Doma Protocol across smart contracts and backend infrastructure. Having worked with web3 domains before joining Doma, I thought I had a fairly good idea of what tokenising a domain involved. It turns out that bringing real DNS domains onchain introduces a very different set of engineering problems.

The NFT Mental Model Breaks Quickly

When I first started working with tokenised domains, it was easy to think about them in the same way as any other NFT.

There is an asset, an owner, some metadata and a token representing ownership. Put that onchain and the problem looks mostly solved.

But domains are not that simple.

Domains Already Exist in a Real-World System

A .com domain already exists inside a large, mature system. It's registered through a registrar, it’s managed through registry infrastructure, it can expire, be renewed, transferred, locked and updated through systems that have nothing to do with a blockchain.

This is one of the main problems Doma is designed to solve.

Doma lets existing DNS domains become programmable onchain assets without trying to replace the traditional domain system. A domain should continue working as a normal domain while also having an onchain representation that can be transferred, traded and used by other protocols.

The Core Problem: Two Systems, Two Truths

The most difficult part is keeping those two worlds in sync.

With standard NFTs the blockchain contract is the source of truth. If it says that an address owns token 123 then that's the end of the story.

With a domain, there is another system that matters more.

If ownership changes onchain, the registrar needs to know about it. If something changes through the registrar, such as the domain expiring or being transferred, that needs to be reflected back into the blockchain.

So we are not just building an NFT system. We are connecting two state machines that both need to agree about the same real asset.

That changes how we think about the architecture.

Why Doma Chain Exists

Doma Chain acts as the coordination layer for domain ownership rather than making any one external blockchain the permanent home of the asset.

This distinction matters because domains are not inherently Ethereum, Base, Solana or any other blockchain asset. They already exist outside of those ecosystems. The blockchain is where we make them programmable but not where they originally come from.

From a developer point of view, we want the same asset to be useful across multiple ecosystems. From a registrar point of view, we also don't want to build a completely different integration every time another blockchain becomes important.

Having a dedicated coordination layer gives the protocol a consistent place to manage domain state while still allowing those assets to be exposed elsewhere.

UX: Making the Blockchain Invisible

One of our goals is that the blockchain underneath shouldn't dictate the user experience.

A user interacting with a domain doesn’t need a different journey depending on whether an operation touches Doma Chain, Ethereum, Base, Solana or another blockchain. From their point of view, they are still doing the same thing: managing, transferring or trading a domain.

This means that a lot of the engineering work is about abstracting away the differences between those systems.

Different chains have different wallets, gas models, transaction formats, confirmation times, ways of moving and storing information. These differences matter to us as developers, but ideally they should matter as little as possible to the user.

Transaction sponsorship, account abstraction, backend-assisted transaction flows and cross-chain / chain-agnostic infrastructure all help make that possible.

The best experience is one where the underlying infrastructure can change without forcing users to change how they interact with the product.

The System Is Bigger Than the Contracts

Working on Doma has made it clear that the smart contracts are only one part of the system. A contract can record that ownership of a domain has transferred, but that doesn't automatically mean the registrar has processed the change, a cross-chain message has arrived or all services have caught up with the new state.

The backend has to understand where an operation is in the lifecycle. It needs to know what’s completed, what is still pending, what can be retried safely and what should happen if one system succeeds while another fails.

That is where the problem stops looking like ordinary smart contract development and starts looking more like distributed systems engineering.

When Things Span Multiple Systems

A normal NFT transfer happens inside one blockchain. The transaction will either succeed or fail.

A domain operation can involve several systems.

You can have blockchain state, registrar state, cross-chain messages, APIs, indexers and other services all participating in what looks to the user like one simple action.

Then additional questions need asking:

  • What happens if the blockchain transaction succeeds but the registrar update fails?
  • What if a cross-chain message is delayed?
  • Can the operation be safely retried?
  • What happens if the same message arrives twice?
  • Which system should be treated as authoritative when two pieces of state temporarily disagree?

These are not really Solidity questions anymore. These are distributed systems questions.

The Real Engineering Problem

That has probably been one of the more interesting parts of working on the protocol for me. We start with something that looks like a smart contract problem and quickly find ourself thinking about consistency, retries, failure modes, idempotency and how much complexity should be exposed to developers using the system.

And all of this work is just the foundation.

What Is Possible

Putting a domain onchain is not especially interesting by itself. The impressive part is what becomes possible afterwards.

When domain ownership can be represented and transferred programmatically, this means other systems can interact with it directly. Domains can be traded through onchain marketplaces, used by other smart contracts, fractionalized and used in applications that would be difficult to build around traditional registrar APIs.

Closing Thought

Domains already have decades of infrastructure behind them and Doma can’t replace that.

Our engineering challenge is connecting this existing infrastructure to blockchains in a way that makes domains genuinely programmable, while keeping most of the complexity out of the way of the people actually using them.