Skip to content

[DRAFT] Introduce Chain Id 0 (EOA Chain Id)#7

Closed
lucemans wants to merge 9 commits into
masterfrom
ensip/chain-id-0
Closed

[DRAFT] Introduce Chain Id 0 (EOA Chain Id)#7
lucemans wants to merge 9 commits into
masterfrom
ensip/chain-id-0

Conversation

@lucemans
Copy link
Copy Markdown
Contributor

@lucemans lucemans commented Sep 23, 2024

TLDR; https://namespaces.chainagnostic.org/eip155/caip10#caip-10 assumes evm chain id 0 is "EOA" chain id.

We would like to extend this functionality into ENS leveraging the already existing ENSIP-9.

Still looking for feedback on:

  • naming choice: EOA vs ChainID-0 vs Fallback Address
  • client-side vs public resolver implementation

@lucemans lucemans marked this pull request as draft September 23, 2024 09:48
@lucemans lucemans marked this pull request as ready for review September 23, 2024 09:52
@lucemans lucemans changed the title Introduce Chain Id 0 (EOA Chain Id) [DRAFT] Introduce Chain Id 0 (EOA Chain Id) Sep 23, 2024
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Sep 23, 2024

Deploying ensips with  Cloudflare Pages  Cloudflare Pages

Latest commit: c325c9f
Status: ✅  Deploy successful!
Preview URL: https://f36242eb.ensips.pages.dev
Branch Preview URL: https://ensip-chain-id-0.ensips.pages.dev

View logs

@GriffGreen
Copy link
Copy Markdown

YAY!!! THIS IS GREAT! So glad it's moving forward.

Comment thread ensips/x.md Outdated

There are multiple routes around implementing this;

For the short-term; we can already use this specification in our apps today (see Appendix A).
Copy link
Copy Markdown
Member

@makoto makoto Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does out apps mean https://app.ens.domains/ or you mean anyone's app? Probably better to rephrase to be more explicit

Comment thread ensips/x.md

## Specification

This ENSIP aims to extend the functionality introduced in [ENSIP-9](./9) and [ENSIP-11](./11) and simply relies on the same functionality.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it should mention https://docs.ens.domains/ensip/19 as step 9 also incorporates chainid 0 as a fallback mechanism.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the draft fixes to ENSIP-19, it looks like the fallback mechanism is being cut. #13

Comment thread ensips/x.md

### Public Resolver

The public resolver could choose to implement a fallback mechanism for EOA addresses.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can UniversalResolver also implement the logic?

@stevieraykatz
Copy link
Copy Markdown
Contributor

I am VERY excited about this spec and would be happy to become its champion if you're not actively pursuing it @lucemans .

I'm partial to this being a client-side spec for ENSIP-11 address queries. The reason being:

  1. Data for fallback wallets can be written to modern address resolvers without contract changes
  2. Implementing the fallback logic at the contract level would require redeploying resolver contracts
  3. Client-side implementations are in the critical path for ENSIP-11 and ENSIP-19 already; I think an additional check for fallback address is reasonable additional overhead

@adraffy
Copy link
Copy Markdown
Member

adraffy commented May 1, 2025

I was under this assumption this is implied by ENSIP-11, although maybe we should give this default/fallback/EoA-thing a proper name?

I plan on codifying this in ENSIP19.sol.

Name CoinType chainFromCoinType() isEVMCoinType() reverseName()
Bitcoin 0 0 false "0.reverse"
Ethereum 60 1 true "addr.reverse"
default 0x8000_0000 0 true "default.reverse"
Base 0x8000_2105 8453 true "80002105.reverse"

parse() handles the edge cases: 80000000.reverse, 80000001.reverse, and 3c.reverse.

L1ReverseDefaultResolver.sol will sit on reverse and route any EVM coin type to the default registrar.


I think ENSIP-19 had a mistake (coinType = 0 should be chain = 0) but that's fixed in the latest draft.

I think ENSIP-19 is the correct place for the content of this ENSIP.

@stevieraykatz
Copy link
Copy Markdown
Contributor

stevieraykatz commented May 2, 2025

@adraffy Totally agree that this can live in the scope of ENSIP-19.

One thing I'd like to ensure is captured though is the following flow:

  1. A basename user sets their name for Address A on the L2ReverseRegistrar on Base
  2. The user sets their default forward resolution address to Address A and DOES NOT set the ENSIP-11 network-specific forward resolution address
  3. The user connects to an app which complies with ENSIP-19
  4. That app is able to fallback to using the default chainId to close the loop and complete the primary name lookup

From what you have written above, it sounds like the user would have to have some default reverse record set on L1 which is definitely less desirable than what I laid out above.

@adraffy
Copy link
Copy Markdown
Member

adraffy commented May 2, 2025

Unfortunately, A.default.reverse has to be on L1 since it doesn't know where to look for the default name().

  1. reverse(0x5105, 0x8000_0000 | 8453)
  2. resolve("5105.80002105.reverse", name())""
    • Since unset, try the default name:
      • resolve("5105.default.reverse", name())"raffy.base.eth"
    • Under the current design, the "fallback logic" is internal to the L1ReverseResolver so we don't know which coin type (Base or default) resulted in the supplied name() so the forward check uses the original coin type (Base).
      • There was a version where the UR did the fallback logic instead of the L1ReverseResolver but that required all non-UR users to implement the fallback logic in ENSIP-19.
      • There was also a version where both addr(0x8000_0000 | 8453) and addr(0x8000_0000) were called and the first one to exist was returned.
  3. resolve("raffy.base.eth", addr(0x8000_0000 | 8453))0x5105
  4. 0x5105 == 0x5105 ✔️ → primary = "raffy.base.eth"

Coin type 0x8000_0000 is only queried from the forward resolver if the original call is resolve(0x5105, 0x8000_0000).


I am open to using the fallback when checking forward resolution, but it does add some complexity. At the moment, you'll have to set an address for every EVM chain if you set a default.reverse name.

@adraffy
Copy link
Copy Markdown
Member

adraffy commented May 6, 2025

I have a PR where the UR is modified to query (2) forward addresses if the coin type was a non-zero EVM chain.

  • reverseNameCallback() resolves name() with [addr(coinType), addr(EVM_BIT)]
    • The resolutions happen in parallel via batch gateway as we haven't decided on resolve(multicall) feature detection, although it's only 2 calls.
  • reverseAddrCallback() uses the first non-null address that exists, with a special case so address(0) falls through.

With this change:

  • EoA-like users only need to set addr(EVM_BIT) instead of addr(x) ∀ chains
  • Clients not using the UR need to perform this additional logic (see ENSIP-19 and below.)

The open question is how does this get documented:

  • ENSIP-11 establishes chain 0 but doesn't remark about it.
  • ENSIP-19 needs modified to state that forward resolution has an additional check if the coin type is EVM.
  • Should we use this ENSIP to codify: chain 0 == coinType 0x8000_0000 == EoA/Default

@stevieraykatz
Copy link
Copy Markdown
Contributor

Great news @adraffy! This is a huge ux win for our users <3

My preference would be for us to codify this here in its own ENSIP primarily because it makes this chain id a "first class" spec that is imminently visible and not buried in the ENSIP-19 fallback logic. That being said, I think that ENSIP-19 should reference the fallback logic and use case.

Comment thread ensips/x.md

## Abstract

This ENSIP specifies a way to set an EOA/Fallback address for a name. This allows for users to set one address to be used for all chains, or as a fallback for when a chain-specific address record is not set.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This ENSIP specifies a way to set an EOA/Fallback address for a name. This allows for users to set one address to be used for all chains, or as a fallback for when a chain-specific address record is not set.
This ENSIP specifies a way to set an EOA/Fallback address for a name. This allows for users to set one address to be used for all EVM-compatible chains, or as a fallback for when a chain-specific address record is not set.

Comment thread ensips/x.md

With the rising interest and research around account abstraction, in addition to the maturation of the multi-chain ecosystem, there is a need for users to be able to set a single address to be used across all chains.

For a simple Externally Owned Account (EOA) user, this means setting their address once, and never having to worry about it again.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For a simple Externally Owned Account (EOA) user, this means setting their address once, and never having to worry about it again.
For a simple Externally Owned Account (EOA) user or a counterfactually deployed smart contract wallet, this means setting their address once, and never having to worry about it again.

Comment thread ensips/x.md
With the rising interest and research around account abstraction, in addition to the maturation of the multi-chain ecosystem, there is a need for users to be able to set a single address to be used across all chains.

For a simple Externally Owned Account (EOA) user, this means setting their address once, and never having to worry about it again.
For more advanced users, this means that chain-specific records can be used for smart-contract wallets, and an EOA can be specified as fallback.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For more advanced users, this means that chain-specific records can be used for smart-contract wallets, and an EOA can be specified as fallback.
For more advanced users, this means that chain-specific records can be used for smart-contract wallets, and a default address can be specified as fallback.

@adraffy
Copy link
Copy Markdown
Member

adraffy commented Sep 17, 2025

Covered by ENSIP-19.

@adraffy adraffy closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants