Resolving an Algorand address to an NFD name / avatar
Last updated
Last updated
The API used for reverse address lookup is quite simple.
For any given address, return the preferred verified linked address associated with that account.
If there are no verified addresses, there is exactly 1 unverified address and allowUnverified=true is passed to the lookup endpoint, then return that. Integrators ideally should have some indicator to show the address is unverified !
If more than 1 unverified match is found and only unverified, return nothing - it will be treated as if nothing was found.
The /nfd/lookup endpoint returns a single NFD match PER provided Address. The 'tiny' view is used by default - with the information returned per match. Use other views like thumbnail to also include basic avatar info. See for information on the view parameter.
If nothing is matched, a 404 (Not Found) is returned. This is a valid return status, and also helps performance due to CDN negative caching.
Up to 20 addresses can be batched per GET request.
Results are cached by the CDN for up to 2 minutes so changes to linked NFDs may appear delayed.
In NFD V1: If multiple NFDs are linked to the same address, the 'most recently changed' NFD is what's used. In NFD v2: The 'primary NFD' chosen by the user in the manage account dropdown is what is used for the specified address.
If you have the ability, use the image link provided in properties.userDefined.avatar, or properties.verified.avatar (special badging for 'verified' avatars is preferable but not required). The image links may often be ipfs://xxxxxx[/...] links so platforms that regularly deal with ipfs links [nft marketplaces for eg] are likely better equipped to handle this improved UX. The ASA ID is also a property for verified avatars if you have your own caching by ID.
For block explorers such as algoexplorer, goalseeker, algoscan or dApps showing transaction histories for themselves, simply use the lookup endpoint batching up to 20 addresses per request. If your site can easily show avatars, then use the thumbnail view to get the asaid and root url of the ASA assigned as the NFDs avatar.
If an NFD is returned for the connected account, show the NFD name instead of or in addition to the account.
Here's a portion of the screenshot for the NFDomains wallet dropdown demonstrating this.
For Algorand NFTs (ASAs), sites should use the creator address to look up the NFD associated with that creators account. Because NFDs allow numerous verifications, they provide the means for users to see the creator of an NFT as an NFD name they recognize and if not, click through to that NFD name, and see all the additional information the creator added to their NFD to prove they are the real project creator/owner.
As this becomes prevalent, users can easily know that a particular NFT is a fraud, because the image from a known collection isn't shown as being created by that well known NFD, but instead a random address (or possibly some 'lookalike' NFD name, with nothing in it matching the twitter / website / discord etc of the creator).
Get the primary NFD for an address. Must be verified address, or if allowUnverified is set, it may match against an unverified address
OK response.
NFD contains all known information about an NFD record