Add "default" chain id 0 to ENSIP-11#32
Conversation
|
If we're editing, I think: export const convertCoinTypeToEVMChainId = (coinType: number) =>{
return (0x7fffffff & coinType) >> 0
}Should be: export function convertCoinTypeToEVMChainId(coinType: bigint): number {
const EVM_BIT = 0x8000_0000n;
if (coinType == 60n) return 1;
return coinType == BigInt.asUintN(32, coinType) && coinType & EVM_BIT ? Number(coinType ^ EVM_BIT) : 0;
}
convertCoinTypeToEVMChainId( 0) = 0
convertCoinTypeToEVMChainId( 1) = 0
convertCoinTypeToEVMChainId( 0x8000_0000) = 0
convertCoinTypeToEVMChainId( 60) = 1
convertCoinTypeToEVMChainId( 0x8000_0001) = 1
convertCoinTypeToEVMChainId( 0x8000_2105) = 8453
convertCoinTypeToEVMChainId(0x1_8000_2105) = 0https://github.com/ensdomains/ens-contracts/blob/staging/test/fixtures/ensip19.ts#L6-L11 |
|
Greg and I were internally talking about this:
I think this is the expected behavior now that we have a purpose for If it's part of the resolver logic, it would require full redeployment since revolvers are consulted directly and don't implement the fallback, however there is prior art for putting address logic in the resolver: The UR could implement this logic, but then clients can't tell if The UR could support a fake profile, like |
Why do clients need to care about which address is returned? IMO, the client is just trying to complete a resolution request and doesn't need to be context-aware under the hood.
Re: clients vs resolvers: i think that this should be implemented at first as a client spec. However, per my point above, if eventually resolvers implement the logic, then the clients will have less work to do. As a phased approach, this makes the most sense to me: start with client implementation and eventually resolvers new resolvers can do the lifting. |
|
I think the fallback logic here needs to be in the resolver just as it is for cointype 60, meaning a new resolver implementation and deployment will be required. We definitely don't want to force clients to implement it and then also force resolvers to implement it. If we went with the former it should be included in the universal resolver permanently. |
|
This has been added to the ENSIP-19 text. Closing |
The idea to use chain id 0 to represent a "default" ENSIP-11 was initially proposed in this complete ENSIP draft: #7.
This revision to ENSIP-11 attempts to make the spec more lightweight and land it where it is most relevant. At its core, this spec introduces: