Multichain
"the future is multichain"
Is what I heard some person say at some point at some conference and yeah thats how far we got.
But isnt ENS on mainnet?ENS Multichain
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 explaination of how resolution works, checkout the section dedicated to the Resolution Process.
My dapp is on X but I want ENSdApp Multichain
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, 4 = Goerli)
});
return <div>{ensName || address}</div>;
};
And voila! You can now resolve ENS names anywhere! 🎉