Skip to content

Namespace dimension vs. lightweight IDs #5361

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

Open
s8sato opened this issue Mar 16, 2025 · 3 comments
Open

Namespace dimension vs. lightweight IDs #5361

s8sato opened this issue Mar 16, 2025 · 3 comments
Labels
api-changes Changes in the API for client libraries Optimization Something isn't working as well as it should question Further information is requested
Milestone

Comments

@s8sato
Copy link
Contributor

s8sato commented Mar 16, 2025

Current Design

  • Account keys and domain names are orthogonal in AccountId
  • Asset names and domain names are orthogonal in AssetDefinitionId
  • AssetId is a cartesian product of these elements

This design allows:

  • account@domain and account@another_domain to be completely separate wallets
  • asset#domain and asset#another_domain to be distinct assets without namespace conflicts

Alternative Approach

Instead of embedding relationships within primary entities, we could store relationships in separate tables.
For example, a table for account balances could focus only on account and asset primary keys, ignoring domain-level complexity.
This would reduce identifier size at the cost of reducing namespace depth and introducing an operational overhead similar to RDB's JOIN.

@s8sato s8sato added Optimization Something isn't working as well as it should question Further information is requested labels Mar 16, 2025
@s8sato s8sato added this to the 2.0.0-rc.2.0 milestone Mar 16, 2025
@0x009922
Copy link
Contributor

Do I understand correctly that this only affects internal representation and doesn't affect Iroha API?

@s8sato
Copy link
Contributor Author

s8sato commented Mar 17, 2025

It can affect APIs.
For example, asset#domain might work well as an output interface, but not as an input interface -- domain part is redundant as an identifier and could lead to unnecessary errors.

@0x009922
Copy link
Contributor

For example, asset#domain might work well as an output interface, but not as an input interface -- domain part is redundant as an identifier and could lead to unnecessary errors.

I am not sure I understand this. How API change would look like, specifically?

@s8sato s8sato added the api-changes Changes in the API for client libraries label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-changes Changes in the API for client libraries Optimization Something isn't working as well as it should question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants