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

Implement new contract with view function(s) for aggregating a user's sub-identities #8

Open
nanaknihal opened this issue Mar 17, 2022 · 1 comment
Labels
good first issue Good for newcomers

Comments

@nanaknihal
Copy link
Owner

Right now, we have a smart contract for ORCID. We will want to make one for Google, Facebook etc.

We also want a general contract.

It should have getAllAccounts(address user) which takes the address of a user as an argument, looks up their address in the ORCID, Google, Facebook, et al.'s 'credsForAddress' hashmap, and returns all of their accounts, in whatever format you want. It could be an array or struct, perhaps JSON string. I think struct is best though unless there's a strong reason otherwise. The credentials are stored as bytes, not a string, so it may be easiest to do a struct with lots of byte fields and let the frontend convert bytes to string.

It should also have getAccount(address user, string memory account) which gets a specific account's credentials, again in byte format.

It should ideally have getAccounts(address user, string[] accounts) which does the same but for multiple accounts and returns an array of credentials in byte format. The array will be in the same order as the arguments.

One thing which is annoying is that solidity can't take string arrays, so the string[] accounts won't actually work. So I'm thinking we should limit our accounts ('google', 'orcid', 'facebook', et al.) to a number of characters and take bytes[] or bytes16[] / bytes32[] etc.

@nanaknihal
Copy link
Owner Author

We will also want to add test cases for it

@nanaknihal nanaknihal added the good first issue Good for newcomers label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant