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 section about W3C Verifiable Credential/Presentation representation #185

Merged
merged 11 commits into from
Dec 7, 2023
3 changes: 1 addition & 2 deletions data/W3CCredential.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0",
"encoding": "auto"
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"
},
"credentialSubject": {
"firstName": "Alice",
Expand Down
3 changes: 1 addition & 2 deletions data/W3CCredentialWithRevocation.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0",
"encoding": "auto"
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"
},
"credentialStatus":{
"type":"AnonCredsCredentialStatusList2023",
Expand Down
3 changes: 1 addition & 2 deletions data/W3CPresentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0",
"encoding": "auto"
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"
},
"credentialSubject": {
"firstName": "Alice",
Expand Down
3 changes: 1 addition & 2 deletions data/W3CPresentationWithRevocation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0",
"encoding": "auto"
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0"
},
"credentialStatus":{
"type":"AnonCredsCredentialStatusList2023",
Expand Down
9 changes: 0 additions & 9 deletions data/anoncreds-w3c-context.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
"schema": {
"@id": "ac:schema",
"@type": "@id"
},
"encoding": {
"@id": "ac:encoding",
"@type": "@vocab",
"@context": {
"@version": 1.1,
"@protected": true,
"auto": "ac:autoEncoding"
}
}
}
},
Expand Down
13 changes: 3 additions & 10 deletions spec/w3c_representation.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ In the context of W3C AnonCreds credentials, credential subject property is comp
- So that `credentialSubject` property is always represented as an object entry, but not an array.
- Credentials claims are always represented as key value pairs, where `value` is the `raw` value of CL credential
attributes.
- encoded CL credential values are not included in the credential subject
- Encoded credential values are not included in the credential subject. Libraries implementing specification must use [the algorithm](https://github.com/hyperledger/aries-rfcs/tree/main/features/0592-indy-attachments#encoding-claims)
to generate encoded values during the signature generation and proof verification.

In the case of W3C AnonCreds credentials, the `credentialSubject` attribute looks the following:

Expand Down Expand Up @@ -118,8 +119,7 @@ schema in order to include the information about AnonCreds related definitions t
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:fabername:0.1.0",
"encoding": "auto"
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:fabername:0.1.0"
},
...
}
Expand All @@ -130,13 +130,6 @@ schema in order to include the information about AnonCreds related definitions t
* `type` - `AnonCredsDefinition`
* `schema` - id of [[ref: Schema]]
* `definition` - id of [[ref: Credential Definition]]
* `revocation_registry` - (Optional) id of [[ref: Revocation Registry Definition]]
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to remove revocation_registry as well here? Or was that not supposed to be there, since it is not in the example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems you look outdated version. revocation_registry is not there anymore.

Copy link
Member

Choose a reason for hiding this comment

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

That’s why I commented. This commit removed the encoding everywhere else, but in this one place it also removed the “revocation_registry” line — different from the intent of the commit. I’m sure it is fine, but just wanted to make sure you intended to do that. Sounds like you did.

* `encoding` - attributes encoding algorithm to apply for generating encoded credential values
* encoded credential attribute values (binary representation required for doing CL signatures) are not included
neither to `credentialSubject` or `signature`
* `encoding: auto` implies using the algorithm defined
at [Aries RFC 0592 Indy Attachments section](https://github.com/hyperledger/aries-rfcs/tree/main/features/0592-indy-attachments#encoding-claims)
to generate encoded values under the hood during the signature generation and proof verification.

#### Issuer

Expand Down