ENS Logo
Docs

Multichain

"the future is multichain"

Is what I heard some person say at some point at some conference and yeah that's how far we got.

But isn't ENS on mainnet?
ENS Multichain

Yes, technically. The resolution process always starts on mainnet. There needs to be, one source of truth after all. However, the name resolution process can branch off to other chains, offchain gateways and much more.
To read a more indepth explanation of how resolution works, checkout the section dedicated to the Resolution Process.

My dapp is on X but I want ENS
dApp Multichain

The ENS Protocol can be used on/for any chain! If you are building a non-mainnet dApp and want to use ENS names simply add a Mainnet RPC to your Wagmi config and specify chainId: 1 in your config like so:

import { useAccount, useEnsName, useEnsAvatar } from 'wagmi';

const Name = () => {
    const { data: ensName } = useEnsAddress({
        address: 'luc.eth',
        chainId: 1, // (1 = Ethereum, 5 = Goerli)
    });

    return <div>{ensName || address}</div>;
};

And voila! You can now resolve ENS names anywhere! 🎉

Contributors
Last Modified
2 months ago