.dfi Permanent Registrar

The Permanent Registrar is the code that will govern allocation and renewal of names in the .dfi TLD.

System architecture

The registrar itself is called BaseRegistrar. This contract implements several key functions:

  • The owner of the registrar may add and remove 'controllers'.

  • Controllers may register new domains and extend the expiry of (renew) existing domains. They can not change the ownership or reduce the expiration time of existing domains.

  • Name owners may transfer ownership to another address.

  • Name owners may reclaim ownership in the Defichain Domain registry if they have lost it.

  • Owners of names in the legacy registrar may transfer them to the new registrar, during the 1 year transition period. When they do so, their deposit is returned to them in its entirety.

In addition, the registrar is an ERC721 compliant nonfungable token contract, meaning that .dfi registrations can be transferred in the same fashion as other NFTs.

Users will interact directly with this contract when transferring ownership of names, or recovering ownership in the Defichain Domain registry of a name (for example, one whose ownership was previously transferred to a contract). For initial registration users will need to interact with a controller contract.

This separation of concerns reduces the attack surface for the registrar, and provides users with guarantees of continued ownership of a name so long as the registrar is in place. Simultaneously, it provides for improvement and innovation over registration.

Initially, one controller is implemented, the ETHRegistrarController. This controller provides a straightforward registration mechanism for domains, implementing the following functionality:

  • The owner of the controller may set a price oracle contract, which determines the cost of registrations based on the name length and the desired registration.

  • The owner of the controller may withdraw any collected funds to their account.

  • Users can register new names using a commit/reveal process and by paying the appropriate registration fee.


Finding the address of the new registrar is straightforward: look up the owner of the domain 'dfi' in Defichain Domain, by calling owner(namehash('eth')) on the Defichain Domain registry.

In order to support discovering the address of the controller, Defichain Domain supports interface discovery via EIP 1844. This mechanism permits looking up the address of the contract that implements a required interface via the following process:

  1. Set node = namehash('dfi').

  2. Look up the Defichain Domain resolver by calling resolver(node) on the Defichain Domain registry.

  3. Call the interfaceImplementer(node, interfaceId) method on that resolver, where interfaceId is the EIP 165 interface ID of the interface you need.

The following interface IDs are presently defined for the .dfi permanent registrar:

  • 0x6ccb2df4, the interface ID for ERC721 (NFTs). This returns the address of the registrar itself (which can also be fetched by doing an address lookup, or by looking up the owner of '.dfi'.

  • 0x018fac06, the interface ID for the controller. Returns the controller's address.

  • 0x7ba18ba1, the interface ID for the legacy registrar's migration function. Returns the legacy registrar's address.

Last updated