Check out the YouTube video for a complete walkthrough of the demo application and its workflows.
This demo uses Paradym, a workflow builder for developers that provides the infrastructure you need to use verifiable credentials in your solution. If you don't have an account yet, you can start with our quick start guide.
This demo also uses the Paradym Wallet, an open-source companion app to the Paradym platform available on the Apple App Store and Google Play Store.
Register the credential
First, we need to register the credential template. In this template, we define the properties of the credential we want to issue in our application.
- Create a new workflow in Paradym and navigate to the Templates tab.
- Look for the 'Register Credential Template' workflow, and click on 'use template'.
- Publish and run the workflow with the following attributes:
- Name:
Bank account credential
- Version:
1.0
- Attributes: (Make sure to capitalize the first character!)
Name
Email
- Name:
- Open the result of the
createCredentialDefinition
action and copy thecredentialDefinitionId
. Save the value for later.
User sign-up workflow
Now that we have the required credential definition Id, we can set up the sign-up workflow.
- Start on the Paradym dashboard and create a new workflow.
- Copy the contents from the
sign-up-user.yaml
file from the Paradym directory. - Replace the
<YOUR_CREDENTIAL_DEFINITION_ID>
value with thecredentialDefinitionId
value from the first workflow. - Publish the workflow.
User login workflow
Great, we now have a way to sign up new users. The last workflow will handle the login requests for existing users.
- Start on the Paradym dashboard and create a new workflow.
- Copy the contents from the
login-user.yaml
file from the Paradym directory. - Replace the
<YOUR_CREDENTIAL_DEFINITION_ID>
value with thecredentialDefinitionId
value from the first workflow. - Publish the workflow.
You can find your Paradym Project ID in the settings tab on the Paradym dashboard as described here.
You can generate your API key in the settings tab on the Paradym dashboard as described here.
The environment variables consist of your Paradym API Key, Paradym project ID, and the ID's of the workflows just created. Once you have created the workflows in the Paradym dashboard, you can copy the workflow ID's from Paradym and set them as environment variables.
cp .env.example .env
Variable | Description |
---|---|
PARADYM_API_KEY |
This is the API key used to send request to Paradym. You can generate your API key in the settings tab on the Paradym dashboard as described in here. |
PARADYM_PROJECT_ID |
This is your Paradym project identifier. It can be located in the settings tab on the Paradym dashboard as described here. |
SIGN_UP_WORKFLOW_ID |
This is the ID of the issue course credential workflow. Once you have created the workflow in Paradym you can copy the ID from the executions tab. |
LOGIN_WORKFLOW_ID |
This is the ID of the verify course credential workflow. Once you have created the workflow in Paradym you can copy the ID from the executions tab. |
Make sure to install the dependencies:
# bun
bun install
Initiate the data storage
npm exec drizzle-kit push:sqlite
You can then run the development server:
# bun
bun run dev
Open http://localhost:3000 with your browser to see the result.