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

Share API improvement ideas #315

Open
matheus23 opened this issue Jul 24, 2023 · 1 comment
Open

Share API improvement ideas #315

matheus23 opened this issue Jul 24, 2023 · 1 comment

Comments

@matheus23
Copy link
Member

matheus23 commented Jul 24, 2023

@appcypher and I had some ideas on how we could improve the share API.

Consider this a list of "may or may not be a good idea".

  • We should probably provide a (feature-gated) implementation of ExchangeKey. Feature-gated, because pulling in the RSA dependency may be undesired for WASM, where we might instead want to simply depend on WebCrypto (but in that case this needs re-thinking anyways, since that abstraction would require passing in an object from the JS side, not a static trait).
  • RsaError should probably be renamed to something more abstract when we add other protocols (e.g. Ed25519)
  • We should compute find_current_share_counter for the user (by default, at least). It can be made faster by caching previous results, but that doesn't mean the default case needs to be a more complicated API.
  • We probably don't need the Share struct. The share function is just fine. This struct was deleted.
  • Perhaps it's also possible to remove the receiver and sender modules, and simply merge them all into the share module.
@matheus23 matheus23 changed the title Share API improvments Share API improvement ideas Jul 24, 2023
@icidasset
Copy link
Member

icidasset commented Apr 3, 2024

Currently it's necessary to keep a global counter because of some issues with the API. The share() function expects a counter but a counter depends on a public key and a DID, the function however retrieves the public keys for you; so it would make sense if the share function also figured out the counter for you. The counter should be returned to the user.

That said, I think the counter should be the same for all the public keys in the same share. Reason being that the user will need to use the counter to retrieve older shares (ie. not the latest) (retrieving a share automatically uses the last counter) and having the counter different for every device (ie. exchange key) would mean a bunch of different counters to keep around for the same share. One counter to keep around would mean better UX.

Also, fetch_exchange_keys is missing on the wasm side.

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

No branches or pull requests

2 participants