trustbloc / wallet-sdk

Verifiable Credential Wallet SDK and Demo/Reference Wallet App (Go / GoMobile | Android | iOS)
Apache License 2.0
21 stars 13 forks source link

What goes in "Serialized VC goes here"? #447

Open alberto-instnt opened 1 year ago

alberto-instnt commented 1 year ago

Hello im trying to understand how to grab a VC. I have an invitation link that generated by a ISSUER and I usually grab on to this link on other wallet apps. I want to be able to grab on to it through the wallet sdk.


import Walletsdk

var error: NSError?
let vc = VerifiableParseCredential("Serialized VC goes here", nil, &error)

How can I then also prove that I have the VC? Thank you

DRK3 commented 1 year ago

Hi @alberto-instnt, if you have an invitation link, and you're trying to get some credentials from an issuer, you'll want to create an Opendi4ciInteraction object and pass it in there. See https://github.com/trustbloc/wallet-sdk/blob/main/cmd/wallet-sdk-gomobile/docs/usage.md#creating-the-interaction-object for more info, including examples.

The VerifiableParseCredential function you have in your code block is for parsing a credential you already have in serialized form. If you already have a VC, you can pass it in (as a string) to VerifiableParseCredential in place of "Serialized VC goes here".

alberto-instnt commented 1 year ago

@DRK3 Thank you for this update, this is very good information we have been looking for. Do you know whether this repo has any relation to aries-go on hyperledger? These seem similar.

DRK3 commented 1 year ago

@alberto-instnt This repo imports Aries-Framework-Go and uses it for various lower-level operations (e.g. parsing Verifiable Credentials). Wallet-SDK and Aries-Framework-Go have support for different protocols and expose their implementations in different ways. Currently, Wallet-SDK is mainly focused on the OpenID4CI and OpenID4VP specifications, as well as other functionality to make using those protocols more convenient.

The other difference is in the approach used by both repos. Aries-Framework-Go is both a library and also an "agent" application (with different controllers), where in your code you'd create an "agent" and execute commands on the agent using your chosen controller. Aries-Framework-Go also has gomobile bindings for it, but I believe the bindings are only for the agent side of things. Wallet-SDK is more like a pure library instead (and has its functionality exposed via gomobile as well).