Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Latest commit

 

History

History
86 lines (62 loc) · 2.5 KB

File metadata and controls

86 lines (62 loc) · 2.5 KB

Flask Example

This project demonstrates use of verifiable credentials and presentation for an application.

Dependencies

Python dependencies

$ poetry install

Running

$ poetry run main

Step-By-Step

First, open your browser on the selected host (default is http://localhost:5001)

Note: This flask exemple creates a DID by default in key.jwk

From there, you should see 4 options available:

  1. Issue Verifiable Credential
  2. Verify Verifiable Credential
  3. Issue Verifiable Presentation
  4. Verify Verifiable Presentation

Issue a Verifiable Credential (VC)

The first step should be to generate a Verifiable Credential. To understand better what a VC is, please refer to SpruceID Glossary here

In order to simplify this example, there are only 2 ways to issue a VC:

  1. Read a QRcode via Credible
  2. Get server issued credential

On a real case scenario, a unsigned credential would be required so DIDKit can sign it. One can refer to this in the quickstart example here

The issued VC will be presented in JSON format. Store this value for later use.

Verify a Verifiable Credential (VC)

After successfully issuing a VC, the next step should be to verify it.

Copy and paste the issued VC from the first step and click on the button to verify it. The default response should be:

{
    "checks":["proof"],
    "errors":[],
    "warnings":[]
}

This means the given VC is valid.

Issue a Verifiable Presentation (VP)

Now, one can use the valid VC to generate a Verifiable Presentation. To understand better what a VP is, please refer to W3C exemple here

Note: in very brief terms, a VP can contain cherry-picked information from the original VC in order to preserve sensitive/unwanted verifiable information

To generate a VP using DIDKit, 3 variables are needed:

  1. The unsigned VP
  2. A valid VC
  3. The VC holder identifier (in this example, a DID:key)

One can refer to this in the CLI example here

The default response should be:

{
    "checks":["proof"],
    "errors":[],
    "warnings":[]
}

This means the given VP is valid.