Skip to content

Commit fc2956b

Browse files
sownakgitbook-bot
authored andcommitted
GITBOOK-522: change request with no subject merged in GitBook
1 parent 3611227 commit fc2956b

File tree

1 file changed

+132
-12
lines changed

1 file changed

+132
-12
lines changed

sdk/veramo/payments/issue-paid-credential.md

Lines changed: 132 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,37 @@ Follow the tutorial here to create an encrypted Bitstring Status List Resource o
1616

1717
<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Charge for Status List</strong></mark></td><td>Create an encrypted Status List on cheqd with payment conditions, unlockable on payment of CHEQ</td><td><a href="charge.md">charge.md</a></td></tr></tbody></table>
1818

19-
### Step 2: Construct Credential Payload with Status List
19+
### Step 2: Choose index number for Credential
2020

21-
{% hint style="info" %}
22-
With Bitstring status lists, the indices are assigned as per the current usage state of the status list. Users do not need to pass index, as it may interfere with auto-assignments and return errors if mismatched.
21+
Each encrypted Status List is a [bitstring](https://en.wikipedia.org/wiki/Bit_array), where each bit represents a Credential which is either revoked or unrevoked (or suspended or unsuspended).
22+
23+
{% hint style="warning" %}
24+
Users should maintain and manage a list of which Credentials match with which specific bitstring indices to be able to revoke or suspend Credentials in the future, and to avoid collisions.
2325
{% endhint %}
2426

27+
When issuing a Credential, you have the choice of whether to manually specify an index for the Credential within the bitstring, or randomly generate an index number anywhere in the bitstring, or within a given range.
28+
29+
### Step 3: Construct Credential Payload with Status List
30+
2531
When constructing the payload for issuing a Credential just specify the purpose and the encrypted status list name.
2632

2733
The following parameters may be included:
2834

29-
| Parameter | Value | Optional |
30-
| --------------------- | ------------ | -------- |
31-
| `"statusPurpose"` | `"message"` | No |
32-
| `"statusListName"` | string | No |
33-
| `"statusListVersion"` | string | Yes |
35+
| Parameter | Value | Optional |
36+
| ------------------------ | ------------ | -------- |
37+
| `"statusPurpose"` | `"message"` | No |
38+
| `"statusListName"` | string | No |
39+
| `"statusListVersion"` | string | Yes |
40+
| `"statusListIndex"` | string | Yes |
41+
| `"statusListRangeStart"` | string | Yes |
42+
| `"statusListRangeEnd"` | string | Yes |
43+
| `"indexNotIn"` | Array | Yes |
3444

35-
Below is an example of how these parameters may be included in Credential payload files:
45+
Below are a set of examples of how these parameters may be included in Credential payload files for different purposes:
3646

3747
<details>
3848

39-
<summary>Example Request Format</summary>
49+
<summary>Example Request Format: Random Bitstring Index</summary>
4050

4151
```json
4252
{
@@ -69,19 +79,129 @@ Below is an example of how these parameters may be included in Credential payloa
6979

7080
</details>
7181

82+
<details>
83+
84+
<summary>Example Request Format: Bitstring index within a given range</summary>
85+
86+
```json
87+
{
88+
"issuanceOptions": {
89+
"credential": {
90+
"credentialSubject": {
91+
"name": "tweeddalex",
92+
"id": "did:key:z6MkvG4dpKVpYwYqnwcjRdw8VZ3km4Sisgxm1igaPCFzskxe"
93+
},
94+
"issuer": {
95+
"id": "did:cheqd:testnet:322761ea-587d-454a-a955-745200301b99"
96+
},
97+
"type": [
98+
"VerifiableCredential"
99+
],
100+
"@context": [
101+
"https://www.w3.org/2018/credentials/v1",
102+
"https://veramo.io/contexts/profile/v1"
103+
]
104+
}
105+
},
106+
"statusOptions": {
107+
"statusPurpose": "message",
108+
"statusListName": "status-list-encrypted",
109+
"statusListIndex": 1456
110+
}
111+
}
112+
113+
```
114+
115+
</details>
116+
117+
<details>
118+
119+
<summary>Example Request Format: Bitstring including omitted bits</summary>
120+
121+
```json
122+
{
123+
"issuanceOptions": {
124+
"credential": {
125+
"credentialSubject": {
126+
"name": "tweeddalex",
127+
"id": "did:key:z6MkvG4dpKVpYwYqnwcjRdw8VZ3km4Sisgxm1igaPCFzskxe"
128+
},
129+
"issuer": {
130+
"id": "did:cheqd:testnet:322761ea-587d-454a-a955-745200301b99"
131+
},
132+
"type": [
133+
"VerifiableCredential"
134+
],
135+
"@context": [
136+
"https://www.w3.org/2018/credentials/v1",
137+
"https://veramo.io/contexts/profile/v1"
138+
]
139+
}
140+
},
141+
"statusOptions": {
142+
"statusPurpose": "message",
143+
"statusListName": "status-list-encrypted",
144+
"statusListRangeStart": 2000,
145+
"statusListRangeEnd": 3000
146+
}
147+
}
148+
149+
```
150+
151+
</details>
152+
153+
<details>
154+
155+
<summary>Example Request Format: Specified Bitstring index</summary>
156+
157+
```json
158+
{
159+
"issuanceOptions": {
160+
"credential": {
161+
"credentialSubject": {
162+
"name": "tweeddalex",
163+
"id": "did:key:z6MkvG4dpKVpYwYqnwcjRdw8VZ3km4Sisgxm1igaPCFzskxe"
164+
},
165+
"issuer": {
166+
"id": "did:cheqd:testnet:322761ea-587d-454a-a955-745200301b99"
167+
},
168+
"type": [
169+
"VerifiableCredential"
170+
],
171+
"@context": [
172+
"https://www.w3.org/2018/credentials/v1",
173+
"https://veramo.io/contexts/profile/v1"
174+
]
175+
}
176+
},
177+
"statusOptions": {
178+
"statusPurpose": "message",
179+
"statusListName": "status-list-encrypted",
180+
"statusListRangeStart": 10,
181+
"statusListRangeEnd": 3000,
182+
"indexNotIn": 13, 1807, 2434
183+
}
184+
}
185+
186+
```
187+
188+
</details>
189+
72190
{% hint style="info" %}
73191
Ensure that the `"statusPurpose"` is `message` and `"statusListName"` is the same as the existing Status List on-ledger, [created in Step 1](issue-paid-credential.md#step-1-create-an-encrypted-status-list-on-ledger).&#x20;
74192
{% endhint %}
75193

76-
### Step 3: Execute the transaction
194+
Ensure that the `"statusPurpose"` is `message` and `"statusListName"` is the same as the existing Status List on-ledger, [created in Step 1](https://app.gitbook.com/o/-MiQSPMufVJdYEwQHd2c/s/PVAMvpKH7PYzvXA6u6Cn/~/diff/~/changes/519/sdk/veramo/payments/issue-paid-credential#step-1-create-an-encrypted-status-list-on-ledger).
195+
196+
### Step 4: Execute the transaction
77197

78198
Once you have constructed your payload file, and have saved it as a JSON file, use the transaction below to issue the Verifiable Credential.
79199

80200
```
81201
veramo execute -m cheqdIssueCredentialWithStatusList --argsFile path/to/payload.json
82202
```
83203

84-
### Response format
204+
#### Response format
85205

86206
If the transaction is successful, you will get returned a formatted Verifiable Credential, including a populated `"credentialStatus"` section.&#x20;
87207

0 commit comments

Comments
 (0)