How to Set NFT as ENS Avatar
mhrsntrk / August 17, 2022
I personally don't like NFTs (at least the trading/owning an artwork part), but I really like Ethereum Name Service (ENS). I have both ENS domain and my profile picture as NFT, which I minted a while ago to test things out. Today, we can try to link them together to get rid of standard avatar.
This method only supports ERC-721 and ERC-1155 NFTs on the Ethereum blockchain.
Step 1: Set primary ENS domain
Make sure that your Primary ENS Name (reverse record) is set. You can do that by going to app.ens.domains, then My Account, and using the tool on that page to set it.
Step 2: Add avatar record
Go to app.ens.domains and then My Account to get to its records page. Then click “Add/Edit Records”. Scroll down to the “Text” section, where you’ll find the avatar record.
Go to etherscan or a NFT marketplace to find your NFT details. Then modify the string below based on your NFT contract details.
NFT standard can be either
erc721
orerc1155
eip155:1/[NFT standard]:[NFT contract address]/[token ID]
Step 3: Confirm and sign
Since you are modifying a record on your ENS domain, it means that you have to interact with a smart contract. When you hit the "Confirm" button, the system will ask you to send a transaction.
Step 4: Validate
You can see resolve your ENS domain to see your avatar record show something like below.
eip155:1/erc721:0xabefbc9fd2f806065b4f3c237d4b59d9a97bcac7/27324