Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interoperable address spec #14

Open
wants to merge 4 commits into
base: feat/chain-specific-addresses
Choose a base branch
from

Conversation

0xteddybear
Copy link
Collaborator

@0xteddybear 0xteddybear commented Feb 13, 2025

I believe this is at a state where we can start a discussion. It is by no means final.

While resolver with id 3 is a good stopgap solution in my opinion, I believe we should iterate on this to:

  • define another interface which uses CAIP-10 addresses in the short term, and a resolver using it
  • define another resolver which resorts to something like ERC-7785 for chain identification in the longer term, to do away with the usage of centralized lists.

There are several lower-level items where I would greatly appreciate your ideas and feedback, see my own comments in the diff

An extensible way to describe an address specific to one chain which includes the information to condense it into a human-readable name in a secure way.

## Out of scope concerns
Similarly to CAIP-10, this specification is not concerned with the mapping from a chain id to a network name, which might not be surjective (eg: the case where if there are multiple EIP-155 chains with chain id 8453, which one should we call Base?), regarding that resolution a social-layer problem until a future ERC decides to tackle it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could reference docs/chain-registries.md here


This document, in its current state, aims to be the starting point for a future address format called 'Interoperable Address' whose aims & properties are fully described in [a separate document](../PROPERTIES.md)

Requires: CAIP-10
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should I list the standards required for the various resolvers as well? only CAIP-10 is required for the 'core' spec

```

## Rationale
- In order to guarantee future resolvers don't share prefixes with existing resolvers in an ambiguous way, and therefore human-readable names are always mappable to a single machine address, this standard defines the human-readable names to start with the resolver version. (TODO: ideally we should be smarter about this and resolve it in a way that doesnt expose this implementation quirk to users)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not like this, we should craft them in a way which allows users to not know they are using a particular schema (for which the version:: is almost a prompt) but is secretly unambiguous.

- The rules for wether to parse URL escaping in a resolver payload are specific to the resolver version
- The rules for wether to parse URL escaping in a CAIP-10 account address are specific to its CAIP-2 chain namespace
- To maintain the bijectivity of account ids and therefore interoperable addresses to on-chain addresses:
- In CAIP-2 namespaces where there is a canonicalization scheme (such as EIP-55 in EIP-155 chains) it SHOULD be used.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ideally I'd like to say MUST, but there would be no way to resolve it on chains with competing capitalization schemes. I sort of get now why many existing schemes (DID-pkh, ENSIP-11) resort to using raw public keys

- In CAIP-2 namespaces where addresses have an *optional* checksum field, it MUST be omitted and the checksum defined in the standard be used without redundancy
- In CAIP-2 namespaces where addresses are raw hexadecimal data without an EIP-55-equivalent capitalization scheme, the lowercase `a-f` characters MUST be used instead of uppercase ones.
- In the case of EIP-155 chains, EIP-55 canonicalization MUST be used
- The checksum MUST be the hexadecimal representation first four bytes of the keccak-256 hash of UTF-8 representation of the interoperable address from it's beginning up to and including the hash `#` character separating the checksum from the rest of the address.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have any good reason for choosing this, just chose something.

@0xteddybear 0xteddybear marked this pull request as ready for review February 19, 2025 17:48
@Joxess
Copy link
Collaborator

Joxess commented Feb 21, 2025

Raising awareness this is aligned to tackle #22

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.

2 participants