Create metadata service for ENS as NFT (Draft)

Summary

Current ENS (.eth) is already NFT and the new ENS NFT Fuse wrapper allows any ENS names (including subdomain and DNS names) but these NFTs don’t have metadata.

This proposal is to build a metadata service that returns metada such as images.

Flow

  1. GET URL http://metadata.ens.domains/namewrapper/{id}.json
  2. The metadata service lookup ENS and get metadata from text record
const name = 'matoken.eth'
const namehash = '0x80ee077a908dffcf32972ba13c2df16b42688e1de21bcf17d3469a8507895eae'
const namehashInt = '69845409642262400928105080645461410625829953013136762866921256534530425483455'
const resolver = ens.resolver(namehash)
const image = resolver.getText('image')
return {
	"name": name,
	"description": `${name} ENS name`,
	"image": image,
    "external_link": `https://ens.domains/name/${name}`
}
  • name
  • have default image with name (svg)
  • expiry date.
  • exprity_link

Open Questions

  • How to set URI to the fuse NFT? ERC1155 allows you to set url at construction time constructor (string memory uri_) but our fuse controller only takes registry and registrar address like constructor(ENS _ens, BaseRegistrarEx _registrar). There seems no overriding _setURI
  • We can’t always decode name from namehash. Are there better way?
  • Should we add other information such as register/expiry date, owner, and social info? Should we even display all records?

This seems reasonable. We should fetch name data from the subgraph (and update the subgraph so it’s aware of the wrapper). With the recent changes to the wrapper, it will always be possible to fully reverse any name that’s wrapped with the wrapper, using events emitted by it.

We should include whatever seems useful from ENS records in the metadata - we can evolve and improve this over time.

1 Like