Question about EIP-137 (Ethereum Name Service)

EthereumEthereum
$1,334.72
‑1.63%
1M Ago
self.ethereum
I am trying to build the namehash() algorithm in python for [https://eips.ethereum.org/EIPS/eip-137](https://eips.ethereum.org/EIPS/eip-137) A screenshot of the algorithm is below. I'm able to get the keccak/sha3 of a specific labelHash (like 'vitalik' and 'eth' for example). However, I can't for the life of me figure out how to do this recursively. I have tried about every way of adding the 2 hashes together and then hashing again with no luck. Basically, where it says >the previous output is concatenated with the label hash and hashed again Does anyone have any tips to do this, or better yet, a working python namehash function? https://preview.redd.it/mao12orfrim91.png?width=1763&format=png&auto=webp&s=f3a27a5769d69aa37fd9ec81021ccbb6d02c8878