JWS validation in the VC flow (prepare_credential function)

Hi all,

In the VC specification; prepare_credential should validate the JWS, I’m using JavaScript/TypeScript; so far I can decode the JWS; and have access to all the component inside: the signature; the headers, etc. How should this JWS be validated ? are there any minimum requirements for things to be validated to have the minimum of security?

1 Like

The preapre_credential is part of the issuer api, expected to be a canister. Are you developing a canister in Typescript? Are you developing an issuer or a relying party?

Did you check the Verifiable credentials overview | Internet Computer? “Become an issuer” will help you if you are building an issuer.

I can help you better if I understand the context :slight_smile:

I’m building an issuer in TypeScript using Azle, I read the specification and the doc on Dfinity, however I was refering to the demo written in rust, I saw the prepare_credential using extra from the rust vc_issuer rust lib.

Yes, that’s correct.

We have a Rust library to verify credentials in canisters. Will that help you?

I looked into it; I don’t really know how can I use it in JS without rewritting it, would you help me?

To become an issuer, you need a canister. At the moment, the most popular languages to write canisters are Motoko (not yet supported by the SDK) and Rust.

I will note your request and I’ll try to prioritize supporting Azle in the SDK. That would be very interesting for me as well.

I guess that you can reach out to the developers of Azle and ask them. Maybe they can submit a grant to add VC support in Azle.

1 Like

Yes, I’m building a canister issuer using Azle; the only big challenge I have now is the validation processes in the prepare credential function. Few days ago I asked if it can be possible to have functions in verifiable-credentials-sdk/rust-packages/ic-verifiable-credentials at main · dfinity/verifiable-credentials-sdk · GitHub as npm so it can be used for validating the JWS from an Azle canister. I saw that there is a way to have rust compile to wasm and deploy to NPM

I did try it BTW, but I wasnot successfull :slightly_smiling_face: , maybe you can try it as well on your side

Hi, I have some questions about VC Flow that I hope you can answer:

  1. Can I use package

@dfinity/verifiable-credentials

for standalone frontend: ReactJS, VueJS (not Rust frontend)? because I’m trying to implement it but it’s stuck at Internet Identity vc-flow with message: “Waiting for verification data”
2. When will Motoko language be able to use VC Flow.

Thank so much.

Yes, exactly, that is also our idea to release a JS version.

We did manage to convert to wasm a Rust package that is in the Internet Identity repository. Maybe that can help you.

I’m sorry, but I have other high priorities and I don’t have time for this. I hope we prioritize again the SDK. There is still so much more to do.

Are you building a project that will create credentials (issuer) or are you requesting credentials (relying party)?

@dfinity/verifiable-credentials is at the moment only for relying parties. It works with React or VueJS.

Yes, for relying party and now it’s working. Thanks.

About Motoko language, have any plans for releasing an Issuer version of Motoko? Please consider about this.

I’m sorry, but we haven’t been working on the VC SDK for the last couple of months. We had other priorities.

I’ll bring that feature request with the team. Thanks!

1 Like

Azle cannot execute Wasm like this currently, unfortunately. We would like to get to that but we are tied up trying to get the 1.0 release of the ICP APIs.

1 Like