Skip to content

Commit 4cf4a08

Browse files
authored
fix auth response. (#29)
* fix auth response. add contract response. remove unused types
1 parent 67bc14a commit 4cf4a08

File tree

5 files changed

+168
-212
lines changed

5 files changed

+168
-212
lines changed

mkdocs/docs/authorization/1.0/response.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ Authorization response to verification proof in a resource.
1111
}
1212
```
1313

14-
| Field | Description | Type | Required |
15-
| --- | --- | --- | --- |
16-
| did_doc | User`s DID documen | JSON ||
17-
| message | Payload for an authorization request | string ||
18-
| scope | List of objects with zkpoorf and public inputs | *list of objects ||
19-
| scope.id | Unique id to present unique authorization request | uint32 ||
20-
| scope.circuitId | Information that circuit was used for generating zk proof | string ||
21-
| scope.vp | Information that user wants to disclosure | JSON ||
22-
| scope.ZKProof.Proof | ZKProof | JSON ||
23-
| scope.ZKProof.PubSignals | A list of public inputs was utilized in the generation of the Zero-Knowledge Proof (ZKProof). | list of strings ||
14+
| Field | Description | Type | Required |
15+
|-------------------------|-----------------------------------------------------------------------------------------------|------------------|----------|
16+
| did_doc | User`s DID documen | JSON | |
17+
| message | Payload for an authorization request | string | |
18+
| scope | List of objects with zkproo f and public inputs | *list of objects | |
19+
| scope.id | Unique id to present unique authorization request | uint32 | |
20+
| scope.circuitId | Information that circuit was used for generating zk proof | string | |
21+
| scope.vp | Information that user wants to disclosure | JSON | |
22+
| scope[i].proof | proof | JSON | |
23+
| scope[i].public_signals | A list of public inputs was utilized in the generation of the Zero-Knowledge Proof (ZKProof). | list of strings | |
2424

2525
The `scope` field contains a list of zero-knowledge proofs and public inputs for authorization on a resource. More about scope contnet: https://github.com/iden3/go-circuits
2626

mkdocs/docs/credentials/0.1/proposal-request.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ Request for proposal is created by user and sent to issuer to receive instructio
1010
"context": "<vc_ld_context>"
1111
}
1212
],
13-
"metadata": {
14-
"type": "TransactionInfo",
15-
"data": "json1"
16-
},
1713
"did_doc": {
1814
"@context": [
1915
"..."
@@ -26,7 +22,6 @@ Request for proposal is created by user and sent to issuer to receive instructio
2622

2723
| Field | Description | Type | Required |
2824
|------------------------|-----------------------------------------------------------|--------|-----------|
29-
| metadata | Type specific metadata regarding current proposal request | object ||
3025
| did_doc | User did document | JSON ||
3126
| credentials | List of credentials that user requests for | list ||
3227
| credentials[i].type | type of VC | string ||
@@ -51,10 +46,6 @@ Request for proposal is created by user and sent to issuer to receive instructio
5146
"context": "<context_url>"
5247
}
5348
],
54-
"metadata": {
55-
"type": "TransactionInfo",
56-
"data": "json1"
57-
},
5849
"did_doc": {
5950
"@context": [
6051
"..."
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
2+
type: `/proofs/1.0/contract-invoke-response`
3+
4+
Response to contract invoke request with a zero-knowledge proof that could be sent or not.
5+
In case proof response has been sent, then txHash property MUST be included to scope object of the generated proof.
6+
7+
8+
```json
9+
{
10+
"did_doc": "<did_doc>",
11+
"scope": ["<generated zero knowledge proofs with or without txHash>"],
12+
"transaction_data": "{<information_about_smart_contract>}"
13+
}
14+
```
15+
16+
| Field | Description | Type | Required |
17+
|-----------------------------------|------------------------------------------------------------------------------------|------------------|----------|
18+
| did_doc | Resource did doc | JSON ||
19+
| scope | List of objects with zkpoorf and public inputs | list of objects ||
20+
| scope.id | Unique id to present unique authorization request | uint32 ||
21+
| scope.circuitId | Information that circuit was used for generating zk proof | string ||
22+
| scope.vp | Information that user wants to disclosure | JSON ||
23+
| scope.txHash | transaction hash if proof is sent to chain | JSON ||
24+
| scope[i].proof | zero-knowledge proof | JSON ||
25+
| scope[i].pub_signals | A list of public inputs was utilized in the generation of the Zero-Knowledge Proof | list of strings ||
26+
| transaction_data.contract_address | Smart contract address | string ||
27+
| transaction_data.method_id | Smart contract method (function signature | string ||
28+
| transaction_data.chain_id | Chain identification | string ||
29+
| transaction_data.network | Chain network | string ||
30+
31+
- **Example of contract invoke response:**
32+
33+
```json
34+
{
35+
"id": "f8aee09d-f592-4fcc-8d2a-8938aa26676c",
36+
"typ": "application/iden3comm-plain-json",
37+
"type": "https://iden3-communication.io/proofs/1.0/contract-invoke-response",
38+
"thid": "f8aee09d-f592-4fcc-8d2a-8938aa26676c",
39+
"from": "did:polygonid:polygon:mumbai:2qFroxB5kwgCxgVrNGUM6EW3khJgCdHHnKTr3VnTcp",
40+
"body": {
41+
"transaction_data": {
42+
"contract_address": "0x13d67dc5f3ef3f5327b60b824d66f27c9b03316862ec27a330ccab5ea3b28cc1",
43+
"method_id":"b68967e2",
44+
"chain_id": 80002,
45+
"network": "polygon-amoy"
46+
},
47+
"scope": [
48+
{
49+
"id": 1,
50+
"circuitId": "credentialAtomicQuerySigV2",
51+
"txHash": "0xe826f870852d7eeeb79b2c030298f9b5daa8c8a3",
52+
"proof": {
53+
"pi_a": [
54+
"9742806134969392226546322490560630802447930806537100408086160321763928272376",
55+
"21455791203277003434494375277451189817937636213176444019767120099596514163982",
56+
"1"
57+
],
58+
"pi_b": [
59+
[
60+
"10380825203862480352812509276126714433521593951138343399902602814224203230644",
61+
"3258713202006941217475014546591342349864153477480289203741647764981122849969"
62+
],
63+
[
64+
"1822645146824926970539316997069683858010941097218414131904374790154170166572",
65+
"10353710770765315368364178270577963995559055291780726291909607243297495512681"
66+
],
67+
[
68+
"1",
69+
"0"
70+
]
71+
],
72+
"pi_c": [
73+
"9484567403290042082168690530225028055268796074940883562365588128103915644358",
74+
"6661326208907807355087503512595101570698136414120018064634575604679380099060",
75+
"1"
76+
],
77+
"protocol": "groth16"
78+
},
79+
"pub_signals": [
80+
"379949150130214723420589610911161895495647789006649785264738141299135414272",
81+
"18656147546666944484453899241916469544090258810192803949522794490493271005313",
82+
"1",
83+
"17339270624307006522829587570402128825147845744601780689258033623056405933706",
84+
"26599707002460144379092755370384635496563807452878989192352627271768342528",
85+
"17339270624307006522829587570402128825147845744601780689258033623056405933706",
86+
"1642074362",
87+
"106590880073303418818490710639556704462",
88+
"0",
89+
"0",
90+
"0",
91+
"0",
92+
"0",
93+
"0",
94+
"0",
95+
"0",
96+
"0",
97+
"0",
98+
"0",
99+
"0",
100+
"0",
101+
"0",
102+
"0",
103+
"0",
104+
"0",
105+
"0",
106+
"0",
107+
"0",
108+
"0",
109+
"0",
110+
"0",
111+
"0",
112+
"0",
113+
"0",
114+
"0",
115+
"0",
116+
"0",
117+
"0",
118+
"0",
119+
"0",
120+
"0",
121+
"0",
122+
"0",
123+
"0",
124+
"0",
125+
"0",
126+
"0",
127+
"0",
128+
"0",
129+
"0",
130+
"0",
131+
"0",
132+
"0",
133+
"0",
134+
"0",
135+
"0",
136+
"0",
137+
"0",
138+
"0",
139+
"0",
140+
"0",
141+
"0",
142+
"0",
143+
"0",
144+
"0",
145+
"0",
146+
"0",
147+
"0",
148+
"0",
149+
"0",
150+
"0",
151+
"0",
152+
"0",
153+
"0"
154+
]
155+
}]
156+
}
157+
}
158+
```

mkdocs/docs/proofs/1.0/request.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)