Skip to content

Commit

Permalink
Process review comments
Browse files Browse the repository at this point in the history
Signed-off-by: artem.ivanov <[email protected]>
  • Loading branch information
Artemkaaas committed Nov 21, 2023
1 parent 6c85b5b commit 7cc81af
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 45 deletions.
4 changes: 2 additions & 2 deletions data/W3CCredential.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://raw.githubusercontent.com/DSRCorporation/anoncreds-spec/w3c-credentials/data/anoncreds-w3c-context.json"
"https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"
],
"type": [
"VerifiableCredential",
Expand All @@ -22,7 +22,7 @@
},
"proof": [
{
"type": "CLSignature2023",
"type": "AnonCredsProof2023",
"signature": "AAAgf9w5.....8Z_x3FqdwRHoWruiF0FlM"
},
{
Expand Down
40 changes: 40 additions & 0 deletions data/W3CCredentialWithRevocation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"
],
"type": [
"VerifiableCredential",
"AnonCredsCredential"
],
"issuer": "did:sov:3avoBCqDMFHFaKUHug9s8W",
"issuanceDate": "2023-10-26T01:17:32Z",
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0",
"encoding": "auto"
},
"credentialStatus":{
"type":"AnonCredsCredentialStatusList2023",
"id":"did:sov:3avoBCqDMFHFaKUHug9s8W:4:3avoBCqDMFHFaKUHug9s8W:3:CL:3avoBCqDMFHFaKUHug9s8W:2:basic_person:1.0:tag:CL_ACCUM:TAG_1"
},
"credentialSubject": {
"firstName": "Alice",
"lastName": "Jones",
"age": "18"
},
"proof": [
{
"type": "AnonCredsProof2023",
"signature": "AAAgf9w5.....8Z_x3FqdwRHoWruiF0FlM"
},
{
"type": "Ed25519Signature2020",
"created": "2021-11-13T18:19:39Z",
"verificationMethod": "did:sov:3avoBCqDMFHFaKUHug9s8W#key-1",
"proofPurpose": "assertionMethod",
"proofValue": "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz"
}
]
}
8 changes: 4 additions & 4 deletions data/W3CPresentation.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://raw.githubusercontent.com/DSRCorporation/anoncreds-spec/w3c-credentials/data/anoncreds-w3c-context.json"
"https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"
],
"type": [
"VerifiablePresentation",
Expand All @@ -11,7 +11,7 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://raw.githubusercontent.com/DSRCorporation/anoncreds-spec/w3c-credentials/data/anoncreds-w3c-context.json"
"https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"
],
"type": [
"VerifiableCredential",
Expand All @@ -28,8 +28,8 @@
"age": [
{
"type": "AnonCredsPredicate",
"p_type": ">=",
"p_value": 18
"predicate": ">=",
"value": 18
}
]
},
Expand Down
63 changes: 63 additions & 0 deletions data/W3CPresentationWithRevocation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"
],
"type": [
"VerifiablePresentation",
"AnonCredsPresentation"
],
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://raw.githubusercontent.com/hyperledger/anoncreds-spec/main/data/anoncreds-w3c-context.json"
],
"type": [
"VerifiableCredential",
"AnonCredsCredential"
],
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:basic_person:0.1.0",
"encoding": "auto"
},
"credentialStatus":{
"type":"AnonCredsCredentialStatusList2023",
"id":"did:sov:3avoBCqDMFHFaKUHug9s8W:4:3avoBCqDMFHFaKUHug9s8W:3:CL:3avoBCqDMFHFaKUHug9s8W:2:basic_person:1.0:tag:CL_ACCUM:TAG_1"
},
"credentialSubject": {
"firstName": "Alice",
"age": [
{
"type": "AnonCredsPredicate",
"predicate": ">=",
"value": 18
}
]
},
"issuanceDate": "2023-11-15T10:59:48.036203Z",
"issuer": "issuer:id/path=bar",
"proof": {
"type": "AnonCredsPresentationProof2023",
"mapping": {
"predicates": [
"predicate1_referent"
],
"revealedAttributeGroups": [],
"revealedAttributes": [
"attr1_referent"
],
"unrevealedAttributes": []
},
"proofValue": "eyJzdWJfcHJvb2Yi...zMTc1NzU0NDAzNDQ0ODUifX1dfX19"
}
}
],
"proof": {
"type": "AnonCredsPresentationProof2023",
"challenge": "413296376279822794586260",
"proofValue": "eyJhZ2dyZWdhdGVkIjp7ImNfaGFzaCI6IjEwMT...IsMzAsMTM1LDE4MywxMDcsMTYwXV19fQ=="
}
}
18 changes: 8 additions & 10 deletions data/anoncreds-w3c-context.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
"@id": "ac:schema",
"@type": "@id"
},
"revocationRegistry": {
"@id": "ac:revocationRegistry",
"@type": "@id"
},
"encoding": {
"@id": "ac:encoding",
"@type": "@vocab",
Expand All @@ -36,6 +32,8 @@
}
},

"AnonCredsCredentialStatusList2023": "ac:AnonCredsCredentialStatusList2023",

"AnonCredsPresentation": "ac:AnonCredsPresentation",

"AnonCredsPresentationProof2023": {
Expand All @@ -58,8 +56,8 @@
}
},

"CLSignature2023": {
"@id": "ac:CLSignature2023",
"AnonCredsProof2023": {
"@id": "ac:AnonCredsProof2023",
"@context": {
"@version": 1.1,
"@protected": true,
Expand All @@ -75,12 +73,12 @@
"@context": {
"@version": 1.1,
"@protected": true,
"p_type": {
"@id": "ac:p_type",
"predicate": {
"@id": "ac:predicate",
"@type": "xsd:string"
},
"p_value": {
"@id": "ac:p_value",
"value": {
"@id": "ac:value",
"@type": "xsd:decimal"
}
}
Expand Down
66 changes: 37 additions & 29 deletions spec/w3c_representation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Example AnonCreds W3C formatted credential:
},
"proof": [
{
"type": "CLSignature2023",
"type": "AnonCredsProof2023",
"signature": "AAAgf9w5.....8Z_x3FqdwRHoWruiF0FlM"
},
{
Expand Down Expand Up @@ -217,15 +217,15 @@ and [Non-AnonCreds Data Integrity](https://www.w3.org/TR/vc-data-model/#data-int

`AnonCreds CL` proof constructed from the `CL` signature of a verifiable credential.

The defined [@context](#context) includes a definition for the `CLSignature2023` type describing the format of the proof
The defined [@context](#context) includes a definition for the `AnonCredsProof2023` type describing the format of the proof
entry:

```
{
...
"proof": [
{
"type": "CLSignature2022",
"type": "AnonCredsProof2023",
"signature": "AAAgf9w5lZg....RYp8Z_x3FqdwRHoWruiF0FlM"
}
]
Expand All @@ -235,7 +235,7 @@ entry:

**Credential proof signature**

* `type` - `CLSignature2023`
* `type` - `AnonCredsProof2023`
* `signature` - credential signature received by
* building the following object from [cryptographic signature](./data_flow_issuance.md#the-credential-signature)
data:
Expand All @@ -257,41 +257,49 @@ of non-AnonCreds [Data Integrity Proof](https://www.w3.org/TR/vc-data-model/#dat
generated using one
of NIST-approved algorithms (RSA, ECDSA, EdDSA).
#### Expiration
#### Status
W3C [Expiration](https://www.w3.org/TR/vc-data-model/#expiration) section defines an optional capability to include
credential expiration information.
W3C [Status](https://www.w3.org/TR/vc-data-model/#status) section defines an optional capability to include
`credentialStatus` property to express credential status information, such as whether it is revoked.
In the case of W3C AnonCreds credentials, instead of including `expirationDate` property there is defined another
[Announced Revocation Data Flow](./data_flow_revocation.md).
In the case of W3C AnonCreds credentials, the `type` attribute of `credentialStatus` must
be `AnonCredsCredentialStatusList2023` (defined in the scope of [@context](#context)) pointing that
[AnonCreds Credential Revocation Flow](./data_flow_revocation.md) is used for credential issuance.
The `id` attribute of `credentialStatus` must contain id of revocation registry.
In order to satisfy this flow, id of `revocationRegistry` must be included into the `credentialSchema` and revocation
data (`rev_reg` and `witness`) must be included into the proof signature.
Also, credential revocation data including revocation registry and witness values (`rev_reg` and `witness`) must be
included into the credential proof signature as demonstrated above in [AnonCreds CL proof](#anoncreds-cl-proof) section.
```
{
...
"credentialSchema": {
"type": "AnonCredsDefinition",
"definition": "did:sov:3avoBCqDMFHFaKUHug9s8W:3:CL:13:default",
"schema": "did:sov:3avoBCqDMFHFaKUHug9s8W:2:fabername:0.1.0",
"revocationRegistry": "did:sov:NcYxiDXkpYi6ov5FcYDi1e:4:NcYxiDXkpYi6ov5FcYDi1e:3:CL:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag:CL_ACCUM:TAG_1",
"encoding": "auto"
"credentialStatus": {
"type": "AnonCredsCredentialStatusList2023",
"id": "did:sov:NcYxiDXkpYi6ov5FcYDi1e:4:NcYxiDXkpYi6ov5FcYDi1e:3:CL:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag:CL_ACCUM:TAG_1"
},
...
}
```
#### Status
#### Expiration
W3C [Status](https://www.w3.org/TR/vc-data-model/#status) section defines an optional capability to include credential
status information.
W3C [Expiration](https://www.w3.org/TR/vc-data-model/#expiration) section defines an optional capability to include
credential expiration information.
In the case of W3C AnonCreds credentials, instead of including `expirationDate` property there is defined another
[Announced Revocation Data Flow](./data_flow_revocation.md).
[Announced Revocation Data Flow](./data_flow_revocation.md) implementing through
the using if [`credentialStatus`](#status) property.
In order to satisfy this flow, id of `revocationRegistry` must be included into the `credentialSchema` and revocation
data (`rev_reg` and `witness`) must be included into the proof signature.
```
{
...
"credentialStatus": {
"type": "AnonCredsCredentialStatusList2023",
"id": "did:sov:NcYxiDXkpYi6ov5FcYDi1e:4:NcYxiDXkpYi6ov5FcYDi1e:3:CL:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag:CL_ACCUM:TAG_1"
},
...
}
```
### Presentation
Expand Down Expand Up @@ -331,8 +339,8 @@ Example AnonCreds W3C formatted presentation:
"age":[
{
"type":"AnonCredsPredicate",
"p_type":">=",
"p_value":18
"predicate":">=",
"value":18
}
]
},
Expand Down Expand Up @@ -439,17 +447,17 @@ kinds of values:
"age":[
{
"type":"AnonCredsPredicate",
"p_type":">=",
"p_value":18
"predicate":">=",
"value":18
}
]
...
}
```
* A predicate object consists of the following data:
* `type` - `AnonCredsPredicate` type defined in the scope of [@context](#context) and describes the format of the resolved predicate
* `p_type` - type of the predicate: [same as in request](./data_flow_presentation_create_request.md)
* `p_value` - value of the predicate: [same as in request](./data_flow_presentation_create_request.md)
* `predicate` - type of the predicate: [same as in request](./data_flow_presentation_create_request.md)
* `value` - value of the predicate: [same as in request](./data_flow_presentation_create_request.md)
##### Proof (Signature)
Expand Down

0 comments on commit 7cc81af

Please sign in to comment.