w3c-ccg / universal-wallet-interop-spec

A data model and abstract interfaces for digital wallets
http://w3id.org/wallet
Other
56 stars 13 forks source link

wallet interfaces for WACI - issuance flow #101

Open sudeshrshetty opened 2 years ago

sudeshrshetty commented 2 years ago

Based on recent progress in Wallet And Credential Interactions spec, I would like to propose few interfaces in universal wallet to support WACI issuance flow.

According to wallet and credential Interactions for issuance, flow between prover(wallet) & issuer looks like this,

WACI Issuance

From wallet's point of view above interactions can be grouped into 2 sections to accommodate user consent in between.

Proposed Interfaces in universal wallet: TBD

Example of issuance flow:

// accept invitation and initiate issuance interaction.
let offer = await wallet.proposeCredential(invitation, from, timeout)

const {thID, manifest, vc, domain, challenge, presentationDefinition} = offer

let query
if (presentationDefinition) {
      query = {
              type: "PresentationExchange",
              credentialQuery: presentationDefinition
              }
} else if (domain || challenge) {
    query = {
        type: "DIDAuth"
      }
}

const presentation = await wallet.query([query], {domain, challenge})

/* 
 display incoming VC using manifest and unsigned VC to wallet user and get consent from user.
*/

// add proof to presentation (existing interface)
let vp = await wallet.prove(presentation, proofOptions)

// send request credential message and wait for ack.
let fullfilment = await wallet.requestCredential(thID, presentation, true, someTimeout)
sudeshrshetty commented 2 years ago

@OR13 please have a look and let me know about your views.

OR13 commented 2 years ago

These look good, I think we should pull some fo the comments int the code out into paragraphs.