Is there an easy GUI way to get the namehash of an ENS subdomain name? I know how to get the needed namehashes from Geth console using the ensutils script, or writing javascript that uses web3 & eth-ens-namehash. But is there a way for people to get the namehash without using command line, simply via browser. I see that MEW will produce the label & namehash for domains, but there is no way to search subdomains. Does Solidity have a namehash function? Or would I have to write my own, recursively calling the sha3 (or is it keccak-256)?? It was one solution so that users could just interact with the contract via MEW to get namehashes. Any other ways to get the namehash without using command line??
3 Answers
Found it at https://etherscan.io/enslookup This site will give the required hashes needed for sub-domain creation. And the blog http://blog.rudikovac.com/create-an-ens-eth-subdomain/ gives instructions on how to use MEW to create the sub-domains
Etherscan tool has a limitation, it always appends the .eth
suffix.
There is another online tool where you can calculate the namehash of any domain, not only .eth
domains:
-
This is obfuscated code. She didn't make the repo public fully. Commented Aug 22, 2022 at 17:01
-
@ThickMiddleManager it is public, actually: github.com/Swolfeyes/ethereum-namehash-calculator Commented Aug 24, 2022 at 6:58
-
It's not made public. It's not in the repo. Anyway, answer is ethers.js and the namehash() function. For Old Registrar, use sha3() straight up. Commented Aug 25, 2022 at 15:08
-
1@ThickMiddleManager well it is a dependency and the code can be checked in github, in package.json you can see the dep: "eth-ens-namehash", then you can find it in NPM: npmjs.com/package/eth-ens-namehash and in github: github.com/Arachnid/eth-ens-namehash , implementation from Nick Johnson, basically the creator of ENS Commented Aug 26, 2022 at 16:37
-
npm is dynamic, but thanks for the link to the OG repo! Commented Aug 26, 2022 at 18:16
You can generate the various hashes associated with an ENS domain using the ENS Hash Generator Tool at EthTools.com.
It will show you the labelhash, namehash, and token ID for any inputted domain/subdomain.
Disclaimer: I built EthTools.com
The official ENS documentation for how the Namehashing algorithm works can be found here.
First, a domain is divided into labels by splitting on periods (‘.’). So, ‘vitalik.wallet.eth’ becomes the list [‘vitalik’, ‘wallet’, ‘eth’]. The namehash function is then defined recursively as follows:
namehash([]) = 0x0000000000000000000000000000000000000000000000000000000000000000 namehash([label, …]) = keccak256(namehash(…), keccak256(label))