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

Upgrade Ceramic to ComposeDB #1249

Closed
1 of 5 tasks
Jkd-eth opened this issue May 9, 2023 · 7 comments
Closed
1 of 5 tasks

Upgrade Ceramic to ComposeDB #1249

Jkd-eth opened this issue May 9, 2023 · 7 comments

Comments

@Jkd-eth
Copy link
Contributor

Jkd-eth commented May 9, 2023

User Story:

As a member of the Passport workstream,
I want to transition our existing Ceramic node to ComposeDB,
So that I can utilize its indexing capabilities and a more robust decentralized environment, ensuring alignment with our Open Data principles.

Acceptance Criteria

GIVEN a Passport user is connected,
WHEN the user modifies their passport (either by adding or removing a credential),
THEN the comprehensive passport data (incl. existing stamps etc) should be recorded in our Ceramic node utilizing ComposeDB.

Tasks:

  • Ensure availability of the ComposeDB node spun up by Nick at Spin up ComposeDB node #1271
  • Adjust the Passport schema in line with the EAS standard, including the EIP712 signature. This schema has already been agreed upon.
  • Incorporate the new schema into the Ceramic node.
  • Revise the front end to be compatible with the new schema. This process should be swift.
    • Audit the new node
    • Record to the new schema
    • Update the IAM server to issue the new format VCs for writing
    • For existing VCs of the Passport holder in our DB, transfer all their stamps to the new ComposeDB node at the start of their session in the app.
    • Update the scorer to be able to validate the new VC schema.
  • Amend the documentation to indicate the availability of the GraphQL interface.

Tech Details:

Passport Schema Update(s): We need to adjust the Passport schema to accommodate the new JSON VC structure. The link within the metapointer is yet to be determined (TBD).

The agreed schema is as follows:

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://w3id.org/vc/status-list/2021/v1"
  ],
  "type": [
    "VerifiableCredential"
  ],
  "credentialSubject": {
    "id": "did:pkh:eip155:1:0x12FeD9f987bc340c6bE43fD80aD641E8cD740682",
    "@context": {
      "hash": "https://schema.org/Text",
      "metaPointer": "https://schema.org/URL",
      "provider": "https://schema.org/Text",
      "customInfo": "https://schema.org/Thing"
    },
    "hash": "v0.0.0:AjcRjxx7Hp3PKPSNwPeBJjR21pLyA14CVeQ1XijzxUc=",
    "provider": "Twitter",
    "metaPointer": "https://github.com/gitcoinco/passport-scorer/blob/main/api/scorer/settings/gitcoin_passport_weights.py",
    "customInfo": {}
  },
  "issuer": "did:ethr:0xd6fc34345bc8c8e5659a35bed9629d5558d48c4e",
  "issuanceDate": "2022-07-19T10:42:24.883Z",
  "expiryDate": "2023-12-31T23:59:59.000Z",
  "proof": {
    "@context": "https://w3id.org/security/suites/eip712sig-2021/v1",
    "type": "EthereumEip712Signature2021",
    "proofPurpose": "assertionMethod",
    "proofValue": "0x0afc5a42d51c0f75cde083f0f55f70273eed4191cbc92d8d6f6ad7bbcefa74ca4de68618757e2a77e85239819e393f912e515f0544d23278e3e9b9d4ebc9c9301c",
    "verificationMethod": "did:ethr:0xd6fc34345bc8c8e5659a35bed9629d5558d48c4e#controller",
    "created": "2023-05-16T07:28:56.083Z"
  },
  "credentialStatus": {
    "id": "https://example.edu/credentials/status/3#94567",
    "type": "StatusList2021Entry",
    "statusPurpose": "revocation",
    "statusListIndex": "94567",
    "statusListCredential": "https://example.edu/credentials/status/3"
  }
}

Open Questions:

Notes/Assumptions:

The migration of the Snapshot SDK is currently in progress with Sophia and Zakk, and is assumed to be completed soon.

@Jkd-eth Jkd-eth added this to Passport May 9, 2023
@Jkd-eth Jkd-eth moved this to Backlog in Passport May 9, 2023
@tim-schultz
Copy link
Collaborator

tim-schultz commented May 10, 2023

Heres an example using didkit, to issue VCs with an EIP712 signature https://github.com/schultztimothy/passport-vc-verification/blob/main/utils/sign.ts#L22. Didkit does not provide much documentation for this signature type so wanted to share an example.

@lucianHymer
Copy link
Collaborator

lucianHymer commented May 10, 2023

Here are some musings I found about DID revocation: https://github.com/Open-Attestation/adr/blob/master/did-certificate-revocation.md

I don't totally love either method outlined above, I think we could do sort of a hybrid: an online authority which signs proofs that can be checked offline.

I like the idea of having
{"revocationAuthority": <address> and "revocationStatus": http://<revocation_service_base_url>/<this_did_id>}
in our VC.

The URL will point to an API that they could call to check if this did has been revoked. We could sign something like
{id: <did_id>, timestamp: <now>, revoked: <status>}
If "revoked" is false, then users could take this revocation proof and their DID and together that can still act as a decentralized, offline proof that they have a sufficiently recently non-revoked DID.

We could support bulk requests or potentially let users download the full list as well.

@erichfi erichfi moved this from Backlog to Icebox / Needs Discussion in Passport May 11, 2023
@erichfi erichfi changed the title Ceramic ComposeDB node upgrade Upgrade Ceramic to ComposeDB May 16, 2023
@erichfi erichfi moved this from Icebox / Needs Discussion to Backlog in Passport May 16, 2023
@nutrina
Copy link
Collaborator

nutrina commented May 16, 2023

This is a gist that issues VCs in the new format with the new signature: https://gist.github.com/nutrina/9306e82080d34abc33aa696753c6c4f2

@erichfi erichfi moved this from Backlog to Blocked in Passport Jun 29, 2023
@Jkd-eth
Copy link
Contributor Author

Jkd-eth commented Jul 17, 2023

Need to create additional issues for all of the work needed to complete

@erichfi erichfi moved this from Blocked to Backlog in Passport Jul 24, 2023
@nutrina
Copy link
Collaborator

nutrina commented Jul 25, 2023

Have updated gist to account for the latest changes (includes the customInfo now): https://gist.github.com/nutrina/9306e82080d34abc33aa696753c6c4f2

@nutrina
Copy link
Collaborator

nutrina commented Aug 3, 2023

I would propose the following plan to get this implemented and released:

Release step 1 - roll out the tech in the backend services

This should be pushed to prod before the actual go-live.
This sill roll out the required tech on our backend services.

Release Step 2 - go live

This should be preferably be performed in a period of relatively low traffic (no new events launching that week).
This will result in a higher load in our service due to the on-the-fly conversion of stamps when reading from the Passport App. This means before rolling this out we should ensure higher compute power on our end. This should gradually go down, while old stamps will expires, and should be back to normal after 90 days.

Step 3 (post go-live cleanup)

Should be performed when we are confident that it is not relevant for the user any more to have the on-the-fly ocnversion of the stamps in place (for example after 90 days all old stamps of the users should be expired, so this should be safe to do):

@erichfi
Copy link
Collaborator

erichfi commented Aug 3, 2023

Thank you so much @nutrina -- closing this issue as we've broken it down into additional tasks.

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

5 participants