Name processing
When interacting with Nad Name Service smart-contracts directly, note that names are not stored in their human readable format. We must process the name before it can be used by a smart-contract by execute below steps in order:
Name normalization
Name hash
Name normalization
Normalization is the process of standardizing a name before passing it through the Namehash algorithm. It's crucial to normalize all input consistently, as even a small variation, such as a difference between uppercase and lowercase letters, can result in a completely different namehash.
For example, Salmo.Nad
normalizes to salmo.nad
. This ensures that no matter how the user types in the name, the correct node is used.
Using viem:
Using ethersjs(v6):
Namehash
Using viem:
Using ethersjs(v6):
Last updated