ethers-io / ethers.js

Complete Ethereum library and wallet implementation in JavaScript.
https://ethers.org/
MIT License
7.82k stars 1.8k forks source link

Support name resolution for systems that do not use namehash #3850

Open connorbode opened 1 year ago

connorbode commented 1 year ago

Describe the Feature

Ethers can currently be configured to resolve names on custom deployments of ENS (on Ethereum mainnet or on other networks). The current configuration options, to the best of our knowledge, use the namehash algorithm to prepare the name before interacting with the contracts.

The preparation of names using the namehash algorithm makes it impossible to connect ethers to naming systems that do not use namehash (unless there is a contract that knows every plaintext/namehash pair).

I would like to suggest a feature that allows users to easily configure name resolution such that the plaintext of the name is sent to the RPC for resolution. Such a feature would allow ethers to be connected to a wider variety of naming systems without making assumptions about how those systems work internally.

I would be happy to submit a pull request for this functionality - just gauging the interest of the ethers team before putting in the dev work.

connorbode commented 1 year ago

@ricmoo would love to get some feedback on whether this is something you guys would consider merging.

dirtycajunrice commented 1 year ago

I strongly advocate for this feature. ENS is currently king, but ethers is a decentralized library meant to service all EVM networks and the modified standard the Avvy Domains has deployed for Avalanche is a great example of progressive iteration on the original ens standard

Thank you in advance for the serious consideration 😁

ricmoo commented 1 year ago

If someone from the official Avalanche team wishes to reach out to me, there is a larger discussion regarding these types of integrations I would like to begin organizing. :)

The biggest issue with allowing non-ENS name resolution is that opens up the potential for name collisions. That must be avoided, so constraints are required to ensure systems don’t fatally degrade in the future.