ERC-2525 ENS Domain Wallet Login (ENSLogin)

Stagnant · Accounts & wallets · created 2020-02-19

A method that lets a user log in by entering only one ENS domain, reading that domain's metadata to automatically connect any wallet.

Why it is needed

Ethereum has countless wallets with different connection methods, from wallets like MetaMask that connect automatically in the browser, to wallets like Fortis or Torus that require the dapp to write separate integration code, to hardware wallets like Ledger. For a dapp to support multiple wallets, the user has to pick which wallet they use themselves, and as the number of wallet types grows, this choice becomes increasingly difficult, especially for beginner users. Also, when a dapp selectively supports only certain wallets, it gives an advantage to already established wallets, making it harder for new wallets to gain adoption from dapps, which reduces competition and stifles innovation in the wallet market.

What to implement

In depth

Text record key and fallback

ENSLogin records the wallet provider's code location under the 'enslogin' key of an EIP-634 text record. If the target domain has no value for this key, it falls back to the 'enslogin-default' key value of the parent node. When looking up username.domain.eth, it first tries resolver.at(ens.owner(nodehash("username.domain.eth"))).text(nodehash("username.domain.eth"), 'enslogin'), and if there is no value, it looks up resolver.at(ens.owner(nodehash("domain.eth"))).text(nodehash("domain.eth"), 'enslogin-default'). The original text states that this key name is subject to change.

Specifying the provider code location

The format pointing to the wallet provider's code is a string in the form scheme://path. Examples given are ipfs://Qm.../60/js and https://server.com/enslogin-module-someprovider/60/js. The 60 appended after the path denotes the blockchain type (Ethereum) per SLIP 44, and the js that follows is a suffix denoting the language. This suffix structure is compatible with both http/https and IPFS, but the original text notes that this storage specification is not yet fully defined.

Provider instantiation

In a JavaScript/Ethereum environment, the downloaded file must inject the global function global.provider: (config) => Promise<web3provider>. For EVM blockchains, the object this function returns must conform to EIP-1193. Specification for other blockchains or languages is left to be detailed later.

Configuration object structure

In addition to the username (ENS domain), a dapp can pass a configuration object to the wallet instantiation function. The common body contains target chain information (network name/node, ENS entry point address, etc.), and if a value is missing, it falls back to mainnet defaults or things like bootstrapping an in-browser IPFS node. Fields starting with a single underscore (_) are wallet-provider-specific parameters, and fields starting with a double underscore (__) are used to pass SDK-specific callbacks such as resolved, loading, and loaded.

Decentralized structure

The SDK contains only the logic for Ethereum lookups and https/ipfs storage access, and does not include any wallet-provider-specific code. Any wallet provider that follows the defined structure and is accessible via a supported protocol automatically becomes compatible with every ENSLogin dapp, without any centralized approval process. The protocol only requires permission over the user's control of their own ENS metadata, and through a fallback mechanism the user can also have a wallet provider update it on their behalf.

Remaining limitations

ENSLogin lets a dapp accept login from any wallet, but the dapp must still decide which wallet to recommend during signup (registration). The original text notes that this choice can be supplemented with components like Web3Connect or BlockNative.

Proposal status

This proposal is in Stagnant status. Several items remain as TODOs, including the provider code location specification, adding a SLIP 44 based chain description field for multichain support, and the ENS Login issuance procedure (how to obtain an ENS domain), making this a proposal that is still subject to change or has stalled.

Original ERC · ← ERCs