I no longer post directly on Medium; to view the latest copy of this article please go to https://www.wealdtech.com/articles/domainsale-an-on-chain-secondary-ens-market/
The Ethereum Name Service (ENS) launched earlier this year to great success, with around 200,000 domains registered. Currently holders of domains have no on-chain way to resell them and this has become a much-requested feature
There is a real need for a secondary ENS market. 125 addresses hold half of the domains registered in ENS, and around 1,600 addresses hold more than 10 domains each. These figures point to a significant number of domains being purchased for reselling.
DomainSale provides a way for ENS domain holders to sell them in an open market. It is built as a smart contract, and ensures that no trust is required between the parties.
DomainSale has been developed with members of the original team behind ENS (Nick Johnson and Alex Van de Sande) to ensure that it integrates correctly.
The DomainSale process for domain sellers
To offer a domain for sale a seller transfers ownership of their domain’s deed to the DomainSale contract. This proves that the seller owns the domain in question, and allows the DomainSale contract to pass the deed on to the eventual winner.
Once ownership has been transferred to the DomainSale contract the seller can set either or both of a reserve price for auction and a purchase price for sale. The seller can change these prices as often as they like until the domain is purchased or an auction has started.
If a buyer buys a domain outright then the sale finishes immediately. If a buyer bids for a domain then it starts an auction. Once the auction has finished the buyer or seller can ask the DomainSale contract to end the sale by transferring the deed to the buyer and the funds (less referrer fees) to the seller.
Referrer fees are an important part of the DomainSale process. The purpose of referrer fees is to ensure that DomainSale adoption is as widespread as possible by encouraging developers of wallets, websites, and other tools to provide access to DomainSale in return for a share of the profits. 10% of the sale value of a domain, be it through direct purchase or auction, goes to referrers: 5% to the referrer who put the name up for sale and 5% to the referrer who provided the winning bid. This ensures that both sellers and buyers have a large enough marketplace to obtain the best range of domains at the best possible prices.
Note that it is impossible for a buyer to purchase a domain without providing the relevant funds to the DomainSale contract. This ensures that when you sell a domain you can be confident the funds will be delivered to you without any reliance on the buyer.
Also note that a seller can cancel the sale of a domain at any time prior to the start of an auction. This returns ownership of the relevant deed back to the seller and removes the domain from sale.
The selling process is shown graphically below:
In summary: sellers can list ENS domains they wish to sell for immediate purchase or for auction, make the information about such domains available to a widespread audience, and obtain the best price for said domains all within a trustless system without reliance on third parties.
The DomainSale process for domain buyers
When a buyer wishes to purchase a domain that is available for immediate purchase they pay the required amount and the domain is transferred to them.
When a buyer wishes to purchase a domain that is available for auction they place a bid that at least meets the minimum bid price. Placing a bid starts a 24-hour countdown during which additional bids can be received. Each additional bid resets the countdown, avoiding the issue of “sniping” where a bid is placed in the last few seconds of an auction and does not give other bidders a chance to respond. In order to prevent irrelevant bids, each new bid must be at least 10% higher than the last. To prevent interminable auctions, after 7 days that requirement becomes at least 50% higher than the last.
Note that it is impossible for a seller to offer a domain for sale before it has been handed over to the DomainSale contract. This ensures that when you bid on or buy a domain you can be confident the domain can be delivered to you without any reliance on the domain owner.
This process is shown graphically below:
In summary: buyers can browse ENS domains that are for sale, bid or buy on them outright, and obtain the domains that they want, all within a trustless system without reliance on third parties.
It is expected that DomainSale will be available from a number of common Ethereum tools and websites. Further details of DomainSale support will be available in the release announcement.
Working with DomainSale
DomainSale is a smart contract that is designed to make it easy for third-party tools to provide information about domain sales and both buy and sell domains.
Functions for buying and selling domains are designed to be as easy as possible to use. All bids are public, avoiding the issue of needing to reveal bids after they have been made and allowing competing bidders to see the real-time status of domains that they wish to acquire.
A full history of activity on DomainSale is available in its event logs. This allows any external application to obtain an up-to-date picture of the domains that are for sale along with any bids on them.
Developer documentation for the DomainSale smart contract is available at http://domainsale.readthedocs.io/.
If you are interested in building tools to list, buy, or sell domains, please visit the DomainSale gitter where we will be happy to help you.
DomainSale release schedule
DomainSale has completed a code audit and has been deployed to the ropsten network, where it is undergoing testing. This is expected to last for 1–2 weeks, at which point the contract will be launched on mainnet. Final testing will take place on mainnet prior to the contract being announced as generally available for domain sales.
If you are interested in testing the DomainSale process or are a potential buyer or seller of domain names and have questions, please visit the DomainSale gitter.