0xPolygonID / js-sdk

SDK to work with Polygon ID
https://0xpolygonid.github.io/js-sdk-tutorials/
Apache License 2.0
55 stars 28 forks source link

Request: is there a way to generate a credential without subject id? #242

Open marsouin opened 2 weeks ago

marsouin commented 2 weeks ago

Describe the bug

The issuer node allows for link generation where the subject is unknown at the time the credential is created. Is there a way to implement this use case with the JS SDK? Can we put something other than the subject DID in the credentialSubject? In our implementation, we do not necessarily have access to the issuer private key at the time the user clicks on the link to issue the credential, but there's no way to pre-sign the credential if we do not know the subject DID, right? Thank you!

vmidyllic commented 2 weeks ago

No, credential subject is required for not-self issued credentials. Signature is done over payload that is core claim representation of W3C credential.

If you do not have your user identifier yet, you can save credential data in some storage and create credential object after.

marsouin commented 2 weeks ago

Ok thank you, very clear. Is that how links are created and used in the issuer node?

vmidyllic commented 1 week ago

By following the flow I would say yes.