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

Account alias resolution #4372

Open
s8sato opened this issue Mar 18, 2024 · 5 comments
Open

Account alias resolution #4372

s8sato opened this issue Mar 18, 2024 · 5 comments
Assignees
Labels
Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested
Milestone

Comments

@s8sato
Copy link
Contributor

s8sato commented Mar 18, 2024

Feature request

  1. Open a separate issue to discuss whether we want to implement alias as part of Iroha or delegate this to external service (I would prefer to keep alias resolution as a separate service outside Iroha to not complicate the codebase)

Motivation

#2085 (comment)

Who can help?

No response

@s8sato s8sato added Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST labels Mar 18, 2024
@mversic mversic closed this as completed Apr 22, 2024
@s8sato s8sato closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
@mversic mversic reopened this Apr 25, 2024
@mversic mversic added this to the 2.0.0-rc.1 milestone Apr 25, 2024
@s8sato
Copy link
Contributor Author

s8sato commented Apr 25, 2024

As long as transaction.payload.authority is AccountId, aliases should be resolved before the transaction building.
Otherwise the transaction signature will be affected by aliases, which means verifiers should consider alias history of the transaction authority

@s8sato s8sato self-assigned this Apr 25, 2024
@mversic
Copy link
Contributor

mversic commented Apr 25, 2024

you make a good point for the case of having alias resolution as external service

@mversic mversic added the question Further information is requested label Apr 25, 2024
@s8sato s8sato removed their assignment Apr 26, 2024
@s8sato s8sato self-assigned this Jun 13, 2024
@s8sato
Copy link
Contributor Author

s8sato commented Jul 8, 2024

My last post didn't say anything so let me redefine the motive to external name services:
Since the transaction authority is the client itself, it is already in the config in a resolved format.
Rather, the problem with having an internal name service (or an internal entrypoint for external name services) is that API has to accept aliases as a variant of other account IDs in the request (e.g. transfer destination).
If we want to treat aliases as optional, it should not affect the current API.

The problem then is that such an external name service needs to have the same security as Iroha:
Suppose the name service has been hacked. Your destination alias will resolve to the scammer's address. This would mean that the name service spoiled the security provided by Iroha.
So the name service would be a decentralized system. In blockchains, it seems to be common to use blockchain for name service.

My suggestion is to deploy another chain dedicated to aliases, and having clients communicate with it to resolve aliases as needed.
I think we can learn from ENSv2, which is moving core functionalities from the mainnet to L2

@s8sato
Copy link
Contributor Author

s8sato commented Jul 8, 2024

My last post didn't say anything

No, it said something:
if clients built a transaction with unresolved names, the signature should be verified with that unresolved names, which means the name resolution would penetrate deeper than the authentication, which would be a cost on every verifier

@s8sato
Copy link
Contributor Author

s8sato commented Jul 10, 2024

Draft happy path

Prerequisites:

  • A resolver is a Torii endpoint of a node of another Iroha network deployed as a name service
  • An alias is an asset (definition) in the name service

Resolution on sending requests:

  1. Client accepts AccountAddr as user input, which is either AccountAlias (e.g. alice@wonderland) or AccountId
  2. Client detects AccountAlias before building a transaction/query and query the resolver to resolve them
    • Request contains an array of FindAssetDefinitionById (e.g. alice#wonderland)
    • Response contains an array of AccountId (e.g. alice#wonderland.owner) which is the same order as the request
  3. Client replaces every AccountAlias with the AccountId and sign the transaction/query

Reverse-resolution on receiving responses:

  1. Client receives a query result
  2. Client detects AccountId and query the resolver to reverse-resolve them
    • Request contains an array of FindAccountKeyValueByIdAndKey (e.g. ed0120...@wonderland.aliases)
    • Response contains an array of JsonString which is the same order as the request
  3. Client replaces some AccountId with the primary AccountAlias (e.g. aliases.0) and show the query result

Questions

  • Do we assume that the name service will support multiple Iroha chains? If so, should aliases be unique across chains?
  • How does a single endpoint guarantee that aliases are correctly resolved?
  • How to prevent rewriting of the resolution requests/responses by intermediaries?

@s8sato s8sato removed their assignment Jul 29, 2024
@s8sato s8sato self-assigned this Aug 5, 2024
@mversic mversic added this to Iroha Oct 10, 2024
@mversic mversic moved this to Backlog in Iroha Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants