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

feat(iam): EIP712 signed verifiable credentials #1662

Merged
merged 15 commits into from
Sep 6, 2023
Merged

Conversation

tim-schultz
Copy link
Collaborator

@tim-schultz tim-schultz commented Aug 30, 2023

fixes: #1540

To switch over to the new signature type update the env variables in app and iam to match the example values in this pr

@tim-schultz tim-schultz marked this pull request as draft August 30, 2023 23:31
hash: `${VERSION}:${hash}`,
},
});
// https://www.w3.org/TR/vc-status-list/#statuslist2021entry
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding this can be added later and should only be included if we would like to a add a revocation status.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is right, we should however consider it in the schema definition for compose-db.

@tim-schultz tim-schultz marked this pull request as ready for review September 1, 2023 22:26
@tim-schultz tim-schultz changed the title feat(iam): wip eip712 signature of stamp feat(iam): EIP712 signed verifiable credentials Sep 1, 2023
Comment on lines 216 to 217
metaPointer:
"https://github.com/gitcoinco/passport-scorer/blob/main/api/scorer/settings/gitcoin_passport_weights.py",
Copy link
Collaborator

@nutrina nutrina Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This metapointer should be another record variable, we should not hardcode it.
The general idea is that the metapointer points to a page with information about that specific provider.
So we can set the metapointer in the record returned by the verify method, and pass it down to the credential.
For now setting undefined is fine, but we should be able to change this (meaning update the provider to return a valid metapointer).

@@ -59,6 +67,7 @@ export type RequestPayload = {
jsonRpcSigner?: JsonRpcSigner;
challenge?: string;
issuer?: string;
signatureType?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's define a type for this.


const credential = await DIDKit.issueCredential(
JSON.stringify(credentialInput, undefined, 2),
JSON.stringify(signingDocument, undefined, 2),
Copy link
Collaborator

@nutrina nutrina Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to indent the JSON object here. Removing the undefined, 2 should work.

export const challengeSignatureDocument: ChallengeSignatureDocument<DocumentType> = {
type: "EthereumEip712Signature2021",
eip712Domain: {
domain: { name: "Passport" },
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add verification method

@tim-schultz tim-schultz merged commit 7e69aa0 into main Sep 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Implement New Credential Issuance Schema in IAM Server
2 participants