@@ -7,8 +7,8 @@ This document describes how to create v1 verifiable presentations and how to ver
77- [ Build Statement] ( #build-statement )
88 - [ Identity/account credential statements] ( #identityaccount-credential-statements )
99- [ JSON representation] ( #json-representation )
10- - [ Verifiable Presentation Request (proof request) ] ( #verifiable-presentation-request-proof -request )
11- - [ Verifiable Presentation (proof) ] ( #verifiable-presentation-proof )
10+ - [ Verification Request] ( #verification -request )
11+ - [ Verifiable Presentation] ( #verifiable-presentation )
1212- [ Verifiable Audit Record] ( #verifiable-audit-record )
1313<!-- toc:end-->
1414
@@ -131,7 +131,7 @@ Note that this type of statement is only allowed for the following attributes:
131131
132132## JSON representation
133133
134- The ` VerifiablePresentationRequestV1 ` , ` VerifiablePresentationV1 ` , and ` VerifiableAuditRecordV1 ` can be represented as
134+ The ` VerificationRequestV1 ` , ` VerifiablePresentationV1 ` , and ` VerifiableAuditRecordV1 ` can be represented as
135135JSON by calling the associated ` .toJSON ` method (will also be called implicitly with ` JSON.stringify ` ). Correspondingly,
136136parsing the JSON values can be done with the ` .fromJSON ` function exposed for each type.
137137
@@ -142,13 +142,13 @@ Example: service serializes presentation request in response to frontend; fronte
142142``` ts
143143const json = JSON .stringify (presentationRequest ); // service sends back presentation request to frontend
144144...
145- const presentationRequest = VerifiablePresentationRequestV1 .fromJSON (JSON .parse (json )); // frontend parses the JSON.
145+ const presentationRequest = VerificationRequestV1 .fromJSON (JSON .parse (json )); // frontend parses the JSON.
146146```
147147
148- ## Verifiable Presentation Request (proof request)
148+ ## Verification Request
149149
150150To get a _ verifiable presentation_ of one or more _ verifiable credentials_ owned by a user, the entity requesting
151- the information must first build a _ verifiable presentation request_ . In the V1 protocol, this is done in the following
151+ the information must first build a _ verification request_ . In the V1 protocol, this is done in the following
152152sequence:
153153
1541541 . Make the _ request context_ , consisting of
@@ -166,9 +166,9 @@ Once this is done, the request must be _anchored_ on chain with a transaction. T
166166const nonce = Uint8Array .from (... ) // randomly generated 32-byte value
167167const connectionID = ... // e.g. a wallet-connect ID
168168const contextString = ' My compliant web3 wine shop'
169- const context = VerifiablePresentationRequestV1 .createSimpleContext (nonce , connectionID , contextString )
169+ const context = VerificationRequestV1 .createSimpleContext (nonce , connectionID , contextString )
170170
171- const statement = new VerifiablePresentationRequestV1 .statementBuilder ()...
171+ const statement = new VerificationRequestV1 .statementBuilder ()...
172172
173173// a GRPC client connected a node on the network the anchor should be registered on
174174const grpcClient: ConcordiumGRPCClient = ... ;
@@ -177,8 +177,8 @@ const sender: AccountAddress.Type = ...;
177177// the keys for the account to sign the anchor transaction
178178const signer: Signer = ... ;
179179
180- // create the presentation request with an on-chain anchor, which can be checked by the owner of the credentials.
181- const presentationRequest = await VerifiablePresentationRequestV1 .createAndAchor (
180+ // create the verification request with an on-chain anchor, which can be checked by the owner of the credentials.
181+ const verificationRequest = await VerificationRequestV1 .createAndAchor (
182182 grpcClient ,
183183 sender ,
184184 signer ,
@@ -187,24 +187,24 @@ const presentationRequest = await VerifiablePresentationRequestV1.createAndAchor
187187);
188188```
189189
190- ## Verifiable Presentation (proof)
190+ ## Verifiable Presentation
191191
192192Computing a _ verifiable presentation_ from a _ verifiable presentation request_ is a process of the following sequence
193193for each credential statement in the request:
194194
195- 1 . Identify valid credentials for the statement by looking at the ID qualifier of the ` VerfiablePresentationRequest .Statement` .
195+ 1 . Identify valid credentials for the statement by looking at the ID qualifier of the ` VerificationRequestV1 .Statement` .
1961962 . Validate the attributes of the credential in the context of the statement.
1971973 . Construct a ` VerifiablePresentationV1.Statement ` corresponding to the credential. This is is _ not_ the same as the
198- ` VerfiablePresentationRequest .Statement` we built for the ` VerfiablePresentationRequest ` previously; here we're working with
198+ ` VerificationRequestV1 .Statement` we built for the ` VerificationRequestV1 ` previously; here we're working with
199199 a specific credential, e.g. from the users wallet.
200- a. for ` VerfiablePresentationRequest .IdentityStatement` s, the ` source ` also needs to be taken into account. This
200+ a. for ` VerificationRequestV1 .IdentityStatement` s, the ` source ` also needs to be taken into account. This
201201 specifies the type of credential requested by the dapp. This can either be set to
202202 ` ["Identity"] | ["Account"] | ["Identity", "Account"] ` , where the latter means that the application constructing
203203 the proof can decide which proof to construct for the statement.
204204
205205When this is done for all credential statements in the request, we construct the _ proof context_ corresponding to the
206206_ request context_ of the request, specifying values for each requested context value in
207- ` VerifiablePresentationRequestV1 .Context.requested` .
207+ ` VerificationRequestV1 .Context.requested` .
208208
209209``` ts
210210// specify the resource ID (e.g. website URL or fingerprint of TLS certificate that the wallet is connected to)
@@ -213,14 +213,14 @@ _request context_ of the request, specifying values for each requested context v
213213// request.
214214const contextValues: GivenContext [] = [{label: ' ResourceID' , context: ... }];
215215
216- // The application goes through each statement in the presentation request, and constructs a corresponding statement
216+ // The application goes through each statement in the verification request, and constructs a corresponding statement
217217// used as input to the presentation. The difference between the two statement types boil down to the presence of an ID
218218// qualifier vs. an ID (selected by the application based on the id qualifier).
219- const statements: VerifiablePresentationV1 .Statement [] = presentationRequest .credentialStatements .map ((entry ) => {
219+ const statements: VerifiablePresentationV1 .SubjectClaims [] = verificationRequest .credentialStatements .map ((entry ) => {
220220 // prioritize creating identity based proofs, as these are more privacy-preserving
221221 if (entry .source .includes (' identity' ))
222- return {id: createIdentityStatementDID (... ), statement: entry .statement } ;
223- return {id: createAccountDID (... ), statement: entry .statement } ;
222+ return VerifiablePresentationV1 . createIdentityClaims (... , entry .statement ) ;
223+ return VerifiablePresentation . createAccountClaims (... , entry .statement ) ;
224224});
225225
226226// the inputs for the credential owned by the user, i.e. credential attribute values. For each
@@ -232,24 +232,24 @@ const inputs: CommitmentInput[] = [
232232
233233const presentation = await VerifiablePresentationV1 .createFromAnchor (
234234 grpcClient ,
235- presentationRequest ,
235+ verificationRequest ,
236236 statements ,
237237 inputs ,
238238 contextValues
239239);
240240
241241// verify the presentation elsewhere
242- const result = VerifiablePresentationV1 .verifyWithNode (presentation , presentationRequest , grpcClient , network );
242+ const result = VerifiablePresentationV1 .verifyWithNode (presentation , verificationRequest , grpcClient , network );
243243```
244244
245245## Verifiable Audit Record
246246
247- Services can opt in to create a _ verification audit record_ from the _ verifiable presentation request_ and corresponding
247+ Services can opt in to create a _ verification audit record_ from the _ verification request_ and corresponding
248248_ verifiable presentation_ . This exists as a record and a corresponding anchor. The record should be stored by the dapp backend (e.g. in a database),
249249and the anchor should be registered on chain. The transacton hash of the anchor registration should be stored along the record.
250250
251251``` ts
252252const uuid: string = ... ;
253- const record = VerificationAuditRecordV1 .create (uuid , presentationRequest , presentation );
253+ const record = VerificationAuditRecordV1 .create (uuid , verificationRequest , presentation );
254254const anchorTransactionHash = await VerificationAuditRecordV1 .registerAnchor (record , grpcClient , sender , signer );
255255```
0 commit comments