Implementing ENS/Unstoppable Domains Support in Mobile Wallets
Addresses like 0x742d35Cc6634C0532925a3b8D4C9C3... nobody remembers or enters manually without mistakes. ENS and Unstoppable Domains solve this: vitalik.eth or myname.crypto resolve to an address. Implementing this in a mobile wallet requires understanding both systems—they work differently.
ENS: Ethereum Name Service
ENS is a decentralized naming system on Ethereum. .eth domains are stored in a smart contract at address 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e (mainnet). Resolving a name involves a sequence of contract calls.
The direct path using ethers.js (for backend or React Native with Web3 libraries):
const provider = new ethers.JsonRpcProvider('https://mainnet.infura.io/v3/YOUR_KEY');
const address = await provider.resolveName('vitalik.eth');
// returns '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
For native iOS/Android, use ENS REST API from public providers or your own RPC node. Resolution algorithm: ENS Registry → ENS Resolver → addr() method.
CCIP-Read (EIP-3668): modern ENS names may use offchain resolvers—the contract returns a URL for HTTP data requests. This complicates direct implementation. Use ready-made libraries: ensjs for JS, ENS Labs Swift SDK, or REST API https://api.ens.domains/.
Reverse resolution (address → name): reverseResolve(address) returns the Primary ENS Name if the user set one. Useful for displaying "vitalik.eth" instead of the address in UI.
Unstoppable Domains
Unstoppable Domains supports .crypto, .wallet, .nft, .blockchain, and other TLDs. Stored on Polygon (for most new ones) or Ethereum. Resolution protocol is UNS (Unstoppable Name Service).
The official approach uses Resolution Libraries. For iOS: resolution-swift from Unstoppable Domains; for Android: resolution-java.
import UnstoppableDomainsResolution
let resolution = try Resolution()
resolution.addr(domain: "brad.crypto", ticker: "ETH") { result in
switch result {
case .success(let address):
print(address)
case .failure(let error):
print("Error: \(error)")
}
}
Or use their REST API: https://resolve.unstoppabledomains.com/domains/brad.crypto—simpler integration, depends on their service.
What to Implement in the Wallet
When sending transactions: accept both 0x... addresses and ENS/UD domains in the address field. When a domain is entered, show a loader → resolve → display the resulting address for confirmation. Users must see the real address before sending.
vitalik.eth → [resolving...] → 0xd8dA...96045 ✓
Caching: cache resolution results with TTL. ENS TTL is stored in the contract itself (usually 300–3600 seconds). For Unstoppable Domains, cache for 5–10 minutes. Stale cache when sending a transaction is a risk of losing funds.
ENS Avatars: text(node, 'avatar') returns an avatar URI. Can be IPFS URI (ipfs://), HTTP URL, or NFT reference (eip155:1/erc721:0x...). Supporting all formats is needed for displaying avatars in user profiles.
Error Handling
Resolution can fail for several reasons: domain not registered, no record for the needed coin, RPC node unavailable. Show specific errors—"ETH address for this domain not found" instead of generic "Error".
Special case: ENS names are sensitive to normalization (ENSIP-15). VITALIK.ETH and vitalik.eth are one name, but passing an unnormalized name to the contract gives the wrong result. Normalization via ens-normalize library is mandatory.
Timeline: supporting either ENS or Unstoppable Domains separately—5–7 days. Both protocols with caching, avatars, and proper error handling—2–3 weeks.







