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

Added methods to store and fetch by identity #165

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ehsan6sha
Copy link
Member

@ehsan6sha ehsan6sha commented Aug 3, 2023

We want to be able to store the root Cid of the encrypted hamt tree from WNFS in the backend. But it should be retrievable only with identity (which is something we can recreate) and app id (because each tree is unique for each app).

We added two methods for store and get. One receives the encrypted version of root Cid and returns the encrypted version and JAVA code must handle the encryption and decryption, and one receives an encryption key input as well and handles the decryption and encryption itself

Update 1: I tried to use the current Get and Put methods and also make it a link system like:
identity -> CID(appID -> encryptedRootCID)

We want to be able to store root Cid of encrypted hamt tree from WNFS in the backend. But it should be retrievable only with identiy (which is something we can recreate).

We added two methods for store and get. One receives the encrypted versio of root Cid and returns the encrypted version and JAVA code must handle the encryption and decryption, and one receives a key and handles the decryption and encryption itself
@ehsan6sha ehsan6sha self-assigned this Aug 3, 2023
@ehsan6sha ehsan6sha added the enhancement New feature or request label Aug 3, 2023
we need to also provide appId on top of identity as the WNFS tree for each appID is different
@ehsan6sha
Copy link
Member Author

A better approach might be having a link system like identity -> AppID -> encryptedAPPRootCID
but I did not have the knowledge for that

@ehsan6sha ehsan6sha requested a review from masih August 4, 2023 00:58
First try at
1- using current Put and Get
2- store it in an interconected link system, which right now is like:
`identity -> CID(appID -> encryptedRootCID)`
@ehsan6sha
Copy link
Member Author

ehsan6sha commented Aug 4, 2023

Although it seems we have an error on JAVA side: Error: invalid cid: expected 1 as the cid version number, got: 65
Also I now realized that we need something like IPNS to keep track of the cid of the identity as we cannot simply store CID as key!

We probabely need to change IPNS to DNSLink
@ehsan6sha
Copy link
Member Author

I think IPNI only supports valid CIDs and we cannot announce identity-CID pair to it nda later query CID by identity?

@masih
Copy link
Contributor

masih commented Aug 4, 2023

That's right identity cids by definition contain the data they represent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We should be able to store and retrieve root Cid of WNFS tree with identity and app id
2 participants