Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 00dcf56

Browse files
chore: update vcwallet docs (#3211)
1 parent 071ce8f commit 00dcf56

File tree

1 file changed

+111
-2
lines changed

1 file changed

+111
-2
lines changed

docs/vc_wallet.md

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ Here are the major specification followed by aries verifiable credential wallet
88
* [Universal Wallet](https://w3c-ccg.github.io/universal-wallet-interop-spec/) - for wallet data models and interfaces.
99
* [Verifiable Presentation request Specifications](https://w3c-ccg.github.io/vp-request-spec/) - for credential queries.
1010
* [Presentation Exchange](https://identity.foundation/presentation-exchange/) - for credential queries.
11+
* [WACI Presentation Exchange](https://identity.foundation/waci-presentation-exchange/): Wallet and credential interaction standards using DIDComm.
12+
* [Verifiable Credentials Data Model v1.1](https://www.w3.org/TR/vc-data-model/): For all the verifiable credential data model operations.
13+
* [JSON-LD v1.1](https://w3c.github.io/json-ld-syntax/): For JSON-based Serialization for Linked Data.
14+
* [Linked Data Proofs v1.0](https://w3c-ccg.github.io/ld-proofs/): For generating JSON-LD based linked data proofs.
15+
* [Decentralized Identifiers (DIDs) v1.0](https://w3c.github.io/did-core/): For signing and verifying verifiable credentials and presentations.
16+
* [WebKMS v0.7](https://w3c-ccg.github.io/webkms/): For implementing cryptographic key management systems for the wallet.
17+
* [Decentralized Identifier Resolution (DID Resolution) v0.2](https://w3c-ccg.github.io/did-resolution/): Followed for resolving various decentralized identifiers.
18+
* [Aries RFCS](#aries-rfcs): it follows many aries RFCs features like DIDComm, Out-Of-Band Messaging, Issue Credential Protocol, Present Proof Protocol, Messaging, Mediators etc.
19+
* [DIDComm V2](https://identity.foundation/didcomm-messaging/spec/): Version 2 of DID Communication protocol for secured communication between wallet and issuer/relying party.
20+
* [Credential Manifest](https://identity.foundation/credential-manifest/): Credential Manifests are a resource format that defines preconditional requirements, Issuer style preferences, Credential Style preferences and other facets User Agents utilize to help articulate and select the inputs necessary for processing and issuance of a specified credential.
21+
1122

1223
## How it works
1324

@@ -45,6 +56,8 @@ and they will be discussed in detail in data models and interfaces sections belo
4556
The aries verifiable credential wallet provides various verifiable credentials operations based on universal wallet specifications like issue, prove, verify, derive etc.
4657
Refer data models and interfaces sections below for more details.
4758

59+
#### DIDComm Operations
60+
The aries verifiable credential wallet provides various DIDComm operations to perform secured exchange of credentials and other metadata between wallet and issuer/relying party.
4861

4962
## Creating and Updating Wallet Profiles
5063
* A wallet profile with local KMS can be created by providing passphrase or secret lock service option.
@@ -603,7 +616,7 @@ Returns,
603616
604617
// accept an invitation from wallet, perform DID connect, send propose presentation message, wait and
605618
// return request presentation message response from relying party.
606-
connectionID, err := myWallet.ProposePresentation(oobInvitation, wallet.WithPresentProofTimeout(80 * time.Second), wallet.WithFromDID("did:example:wallet"))
619+
connectionID, err := myWallet.ProposePresentation(oobInvitation, wallet.WithInitiateTimeout(80 * time.Second), wallet.WithFromDID("did:example:wallet"))
607620
608621
// close wallet.
609622
ok = myWallet.Close()
@@ -638,6 +651,97 @@ Returns,
638651
639652
```
640653

654+
#### [ProposeCredential](https://w3c-ccg.github.io/universal-wallet-interop-spec/#proposecredential)
655+
Sends propose credential message from wallet to issuer, waits for offer credential message from issuer and returns incoming message.
656+
657+
Params,
658+
* invitation - out of band invitation from inviter.
659+
* options - for sending propose presentation message.
660+
* FromDID - option to provide customized from DID for sending propose presentation message.
661+
* ConnectOptions - customized options for accepting invitation..
662+
* Timeout - option to provide timeout duration to wait for offer credential message from issuer.
663+
664+
Returns,
665+
* DIDCommMsg - offer credential message from issuer.
666+
* error - if operation fails.
667+
668+
> Aries Go SDK Sample for sending propose credential message from wallet to issuer.
669+
```
670+
// creating vcwallet instance.
671+
myWallet, err := vcwallet.New(sampleUserID, ctx)
672+
673+
// open wallet.
674+
err = myWallet.Open(...)
675+
676+
// accept an invitation from wallet, perform DID connect, send propose credential message, wait and
677+
// return offer credential message response from issuer.
678+
connectionID, err := myWallet.ProposeCredential(oobInvitation, wallet.WithInitiateTimeout(80 * time.Second), wallet.WithFromDID("did:example:wallet"))
679+
680+
// close wallet.
681+
ok = myWallet.Close()
682+
683+
```
684+
685+
686+
#### [RequestCredential](https://w3c-ccg.github.io/universal-wallet-interop-spec/#requestcredential)
687+
Sends request credential message from wallet to issuer and optionally waits for credential fulfillment.
688+
689+
Params:
690+
* thID: thread ID (action ID) of offer credential message previously received.
691+
* concludeInteractionOptions: options to conclude interaction like presentation to be shared etc.
692+
* rawPresentation - requesting credential from raw credential.
693+
* presentation presenting proof or requesting credential from verifiable presentation instance. This option takes precedence when provided with other options.
694+
* waitForDone - if provided then wallet will wait till it gets acknowledgement or problem report from other party.
695+
* timeout - time duration to wait for status to be done or abanoned.
696+
697+
Returns:
698+
* Credential interaction status containing status, redirectURL.
699+
* error if operation fails.
700+
701+
> Aries Go SDK Sample for sending request credential message from wallet to issuer.
702+
```
703+
// creating vcwallet instance.
704+
myWallet, err := vcwallet.New(sampleUserID, ctx)
705+
706+
// open wallet.
707+
err = myWallet.Open(...)
708+
709+
// send request credential message to issuer for ongoing credential interaction.
710+
connectionID, err := myWallet.RequestCredential(threadID, wallet.FromPresentation(application))
711+
712+
// close wallet.
713+
ok = myWallet.Close()
714+
715+
```
716+
717+
#### ResolveCredentialManifest
718+
Resolves given credential manifest by credential fulfillment or credential.
719+
Supports: https://identity.foundation/credential-manifest/
720+
721+
Params,
722+
* manifest: Credential manifest data model in raw format.
723+
* resolve: to provide credential fulfillment or credential to resolve.
724+
725+
Returns,
726+
* list of resolved descriptors.
727+
* error if operation fails.
728+
729+
> Aries Go SDK Sample for resolving credential manifest by fulfillment.
730+
```
731+
// creating vcwallet instance.
732+
myWallet, err := vcwallet.New(sampleUserID, ctx)
733+
734+
// open wallet.
735+
err = myWallet.Open(...)
736+
737+
// resolve credential manifest by raw credential fulfillment.
738+
connectionID, err := myWallet.ResolveCredentialManifest(threadID, wallet.ResolveRawFulfillment(fulfillment))
739+
740+
// close wallet.
741+
ok = myWallet.Close()
742+
743+
```
744+
641745
## Controller Bindings
642746
Aries command controller supports all verifiable credential wallet features with many more customization options like Authorization Capabilities (ZCAP-LD) feature for wallet's EDV and WebKMS components.
643747

@@ -732,12 +836,17 @@ let requestPresentationMsg = await agent.vcwallet.proposePresentation({userID, a
732836
// send present proof message from wallet for WACI share flow.
733837
await agent.vcwallet.presentProof({userID, auth, threadID, presentation})
734838
839+
// accept invitation, send propose credential message and wait for offer presentation.
840+
let offer = await wallet.proposeCredential(invitation, "did:example:holder", someTimeout)
841+
842+
// send request credential message, wait for ack and return credential fulfillment.
843+
let fulfilment = await wallet.requestCredential(thID, presentation, waitForAck, someTimeout)
844+
735845
// close wallet
736846
await agent.vcwallet.close({userID})
737847
738848
```
739849

740-
741850
#### REST
742851
Refer Aries Open API specifications for ``vcwallet`` operation ID.
743852

0 commit comments

Comments
 (0)