You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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.
The text was updated successfully, but these errors were encountered:
matheus23
changed the title
Share API improvments
Share API improvement ideas
Jul 24, 2023
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.
@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".
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)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 theThis struct was deleted.Share
struct. Theshare
function is just fine.receiver
andsender
modules, and simply merge them all into theshare
module.The text was updated successfully, but these errors were encountered: