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

Identity refactor #19

Open
schronck opened this issue Mar 30, 2023 · 0 comments
Open

Identity refactor #19

schronck opened this issue Mar 30, 2023 · 0 comments
Assignees
Labels
f2-refactor optimizing and restructuring code while keeping its functionality

Comments

@schronck
Copy link
Contributor

          Not sure about how exactly `Identity` should look, but we can keep it this way. Although we should probably discuss it in another issue specifically targeting this.

Identities should also be defined in such way that the oracle can handle any type without having to restart it. If you check gn-common/src/identity/mod.rs, you can check how it's handled right now. There are basically three identity types that may contain most identity types. An Address32 is quite generic in the sense that it can contain any 32 byte long public key (e.g. what Solana and Near use). There's an Address20 for EVM addresses and there's an Other variant that may contain any other identity that fits 64 bytes.

This way, all types have a fixed size (great for on-chain applications) and doesn't allocate anything on the heap (contrary to String or Vec<u8>.

Currently we store discord and telegram ids as "discord:123456", "telegram:@xdfhre"` padded with zeros to 64 bytes. However, this might change, so we should address all this in another issue.

Originally posted by @PopcornPaws in #18 (comment)

@schronck schronck self-assigned this Apr 5, 2023
@schronck schronck added f2-refactor optimizing and restructuring code while keeping its functionality and removed enhancement labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f2-refactor optimizing and restructuring code while keeping its functionality
Projects
None yet
Development

No branches or pull requests

1 participant