Best Practices for Integrating Domain Resolution
Here are best practices to ensure the proper integration of the Unstoppable Domains resolution features into your applications:
Don’t Hard-code UD Domain Endings Into Your Application
Unstoppable Domains periodically adds new domain endings, and our Resolution libraries and APIs are designed to detect and support them automatically. This means you do not need to implement a front-end filter in your application (e.g., by hard-coding specific domains or using a regex filter for only .crypto
, .nft
, etc.). We also provide an API endpoint to query for supported domain endings.
Display Resolved Addresses Near Domain Names
Always display the resolved crypto address near the domain name for additional security. Doing this helps your application's user detect and avoid Man-in-the-middle (MITM) attacks aimed at replacing the payment address with the attacker's own.
Don’t Overwrite the Input Field With Resolved Addresses
For the best user experience of your application, don't overwrite the domain input field with cryptocurrency addresses after resolving the domain. Doing this allows them to quickly fix typos if they make any without typing the domain name again because an address has replaced it.
Resolve Domains With the Provided Currency
When you don't find a currency address record for a domain, please do not make assumptions about the currency code and try others. Instead, inform the user that they have not set an address for the requested currency.
Handle Errors According to Their Type
When you encounter errors using any resolution method (Resolution Libraries, Resolution Service API, CLI, Blockchain Calls), handle them according to the error type rather than generically handling them or passing them silently. Please see the Resolution Libraries docs for language-specific error handling guides and library error codes you might encounter during integration.
Validate the Addresses Resolved From Domains
Always validate the addresses you resolve from domains using the resolution methods (Resolution Libraries, Resolution Service API, CLI, Blockchain Calls) because the user has complete control over the domain and can set invalid values for its records.
Remind Your Users That They Can Use Their Domain To Send Crypto
Add notes, hints, and placeholders in your application to remind users that they can use their UD domains to send crypto instead of using long wallet addresses every time.