This project demonstrates use of verifiable credentials and presentation for an application.
- Poetry (installation instructions)
- Python 3.7 or higher
$ poetry install$ poetry run mainFirst, 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:
- Issue Verifiable Credential
- Verify Verifiable Credential
- Issue Verifiable Presentation
- Verify Verifiable Presentation
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:
- Read a QRcode via Credible
- 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.
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.
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:
- The unsigned VP
- A valid VC
- 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.