Truvera Documentation portal
WebsiteTruvera Workspace
  • Truvera overview
    • Decentralized identity explained
    • Roadmap
    • Subscription plans & billing
  • Solutions
    • Biometric-Bound Credentials
  • Truvera Workspace
    • Create an organization profile (DID)
    • Issue verifiable credentials
      • Filtering, downloading and deleting credentials
    • Verify credentials
    • Create a schema
    • Create a design
    • Team management
      • Inviting a team member
      • Removing a team member
      • Changing team member roles
      • Data retention policies
      • Sub-accounts
    • Revoking credentials
    • Ecosystem Tools
      • Ecosystem set up
      • Ecosystem example
    • Monetizing credentials
      • Setting up monetizable credentials
    • Creating API keys and webhook endpoints
    • Transaction history
    • Custom branded distribution emails
    • Truvera Workspace release notes
      • 2025 Release notes
        • Release notes Q1 2025
      • 2024 Release notes
        • Release Notes February 2024
        • Release Notes March 2024
        • Release Notes April 2024
        • Release Notes May 2024
        • Release Notes June 2024
        • Release Notes July 2024
        • Release Notes August 2024
        • Release Notes September 2024
        • Release Notes October 2024
        • Release notes November 2024
        • Release notes December 2024
  • Truvera API
    • Getting started
    • Webhooks
      • Webhooks API endpoints
    • Sample Postman collections
      • Issue-Store-Verify sample flow
      • Create ecosystems
      • Issue monetizable credentials
      • Create sub-accounts
      • Issue OpenID credentials
    • Truvera Swagger UI
    • DIDs
    • Profiles
    • Credentials
    • Presentations
      • Proof templates
      • Proof requests
      • Other proof endpoints
    • Registries
    • Revocation Status
    • Credential Schemas
    • Jobs
    • Templates
    • Sub-accounts
    • Teams
    • Messaging
    • OpenID
      • OpenID Issuance and Verification Integration Guide
    • iden3comm
    • Ecosystem Tools
      • Trust Registry Integration Guide
      • Creating a Trust Registry
      • Inviting participants
      • Verifiers and Public info
      • Trust Registry Schemas
      • Trust Registry Proof Templates
      • Reports
      • Updating and Deleting Trust Registry
    • Issuing paid credentials (KVAC algorithm integration)
    • Data
    • Verify
    • Keys
    • Schemas
  • System architecture
    • Proposed architecture with Truvera
    • Revocation
    • System scalability
    • Security policies
    • How data is processed and stored
  • Supported standards
    • Interoperability with OpenID
  • Credential wallet
    • Create and manage DIDs in the Truvera Wallet
    • Truvera Wallet release notes
      • Release Notes 2025Q1
      • Release Notes 2024Q4
      • Release Notes 2024Q3
        • Release Notes September 2024
        • Release Notes August 2024
        • Release Notes July 2024
      • Release Notes June 2024
      • Release Notes May 2024
      • Release Notes April 2024
    • White label wallet
      • Configuration
        • Enabling and Disabling Features
        • Customizing the Styling
        • Configuring for Android Builds
        • Configuring iOS Builds
      • Publishing in App Stores
        • Android Build Testing and Publishing
        • iOS Build Testing and Publishing
    • Wallet SDK
      • Getting started
        • Example Credential
        • Presentation definition
        • Verify credentials
      • Cloud wallet
      • Biometric plugin
      • Ecosystem Tools
    • Download Truvera Wallet
  • Open source community
    • Code of Conduct
    • Truvera Credential SDK
    • Blockchain archives
      • DOCK token
        • Migration terms and conditions
  • Support
    • System Status
    • Discord
    • Support services
    • Security policy
Powered by GitBook
On this page
  • Prerequisites
  • Step-by-Step Guide
  • 1. Invite Participants to Trust Registry (issuer and verifier)
  • 2. Assign Prices to Schemas
  • 3. List Schemas with Prices
  • 4. Issue Credentials
  • 5. Create Proof Template
  • 6. Add the Proof Template to the Trust Registry
  • 7. Create Proof Request
  • 8. Verify Presentation
  • 9. Retrieve Trust Registry Reports
  • 10. Assigning additional schemas to participants

Was this helpful?

Edit on GitHub
  1. Truvera API

Issuing paid credentials (KVAC algorithm integration)

PreviousUpdating and Deleting Trust RegistryNextData

Last updated 4 months ago

Was this helpful?

This guide provides step-by-step instructions for implementing the KVAC algorithm to issue and verify paid credentials using a series of API endpoints. Follow these instructions to integrate KVAC into your system effectively.

Download a sample Postman collection .

Prerequisites

Before starting, ensure you have:

  • DIDs for issuer (did:dock:issuer) and verifier (did:dock:verifier)

  • A trust registry (trust_registry_id)

  • A schema (http://example.org/schema/kvac)

Step-by-Step Guide

1. Invite Participants to Trust Registry (issuer and verifier)

Invite issuers and verifiers to the trust registry and assign them the schema that will be used in the KVAC credential.

POST /trust-registries/{trust_registry_id}/participants This endpoint invites a participant to the trust registry with specified schemas they are allowed to issue or verify. Will be called by the trust registry convenor.

Body:

{
  "issuerSchemas": ["http://example.org/schema/kvac"]
}

POST /trust-registries/invitations/accept This endpoint accepts an invitation to join a trust registry using a provided token. Will be called by a trust registry future member.

Body:

{
  "did": "did:dock:issuer",
  "infoUrl": "https://info.org/issuer",
  "token": "inviteTokenIssuer"
}

POST /trust-registries/{trust_registry_id}/participants This endpoint invites a participant to the trust registry with specified schemas they are allowed to issue or verify. Will be called by the trust registry convenor.

Body:

{
  "verifierSchemas": ["http://example.org/schema/kvac"]
}

POST /trust-registries/invitations/accept This endpoint accepts an invitation to join a trust registry using a provided token. Will be called by a trust registry future member.

Body:

{
  "did": "did:dock:verifier",
  "infoUrl": "https://info.org/verifier",
  "token": "inviteTokenVerifier"
}

2. Assign Prices to Schemas

Assign a price to the schema in the trust registry. Prices are specified in "digits" to support fractional cents, where 1 cent is represented as 1,000,000 digits. This ensures precision in transactions and avoids issues related to floating-point arithmetic.

POST /trust-registries/{trust_registry_id}/schemas/{schema_id}/price This endpoint assigns a price to a schema within the trust registry, enabling it to be used for paid credentials.

Body:

{
  "currency": "USD",
  "digits": 1000000  // Represents 1 cent
}

3. List Schemas with Prices

Retrieve and verify the list of schemas with their assigned prices.

GET /trust-registries/{trust_registry_id}/schemas This endpoint retrieves all schemas within a trust registry, including the prices assigned to each schema.

Response:

[
  {
    "schema": "http://example.org/schema/kvac",
    "prices": [
      {
        "digits": 1000000,
        "currency": "USD",
        "trustRegistryId": "trust_registry_id",
        "trustRegistryMetadata": {
          ...
        }
      }
    ]
  }
]

4. Issue Credentials

Issue credentials using the schemas. The credential must be a KVAC credential to enable paid credentials. The use of the bbdt16 algorithm is required to enable KVAC and paid credentials.

POST /credentials This endpoint issues a KVAC credential based on the specified schema and issuer details.

Body:

{
  "algorithm": "bbdt16",
  "credential": {
    "schema": "http://example.org/schema/kvac",
    "issuer": "did:dock:issuer",
    "name": "KVAC Credential",
    "issuanceDate": "2019-12-03T12:19:52Z",
    "expirationDate": "2029-12-03T12:19:52Z",
    "subject": {
      "id": "did:dock:subject",
      "name": "Subject Name",
      "favouriteDrink": "Coffee"
    }
  }
}

5. Create Proof Template

Create a proof template using the schema with a price associated and request for verification.

POST /proof-templates This endpoint creates a proof template specifying the requirements for verifying a credential.

Body:

{
  "name": "KVAC Proof Template",
  "nonce": "1234567890",
  "request": {
    "name": "KVAC Request",
    "purpose": "KVAC Purpose",
    "input_descriptors": [
      {
        "id": "Credential 1",
        "name": "KVAC Request",
        "purpose": "KVAC Purpose",
        "constraints": {
          "fields": [
            { "path": ["$.credentialSchema.id"], "filter": { "const": "http://example.org/schema/kvac" } }
          ]
        }
      }
    ]
  }
}

6. Add the Proof Template to the Trust Registry

Add the proof template to the trust registry to enable it being used by other participants.

POST /trust-registries/{trust_registry_id}/proof-templates This endpoint adds a proof template to the trust registry, enabling it to be used for verification.

Body:

{
  "id": "proof_template_id",
}

7. Create Proof Request

Create a proof request based on the proof template to verify the credential.

POST /proof-templates/{template_id}/request This endpoint creates a proof request based on the specified proof template, which can then be used to verify a credential.

Body:

{
  "did": "did:dock:verifier"
}

Note: Verifier DID is required when using paid schemas.

Errors:

  • If using a did that is part of the trust registry but is not assigned as a verifier for that schema the verification process on step 6 will fail with the following error message: Presentation could not be verified: Error: Verifier DID does not have permission to verify this credential

  • If using a did that is not part of the trust registry the verification process on step 6 will fail with the following message: Presentation could not be verified: Error: This credential can only be verified by participants in the ${trust_registry_name} ecosystem. You can learn about the ecosystem by visiting this website: ${trust_registry_url}

8. Verify Presentation

9. Retrieve Trust Registry Reports

Fetch and verify trust registry reports to ensure proper billing and tracking.

GET /trust-registries/{trust_registry_id}/reports This endpoint retrieves reports from the trust registry, detailing verifications, fees, and other relevant information for auditing purposes.

Response:

[
  {
    "trustRegistryId": "trust_registry_id",
    "verificationId": "572350a8-673a-490a-bed3-c001aa3f58a0",
    "verifierDID": "did:dock:verifier",
    "issuerDID": "did:dock:issuer",
    "schemaId": "http://example.org/schema/kvac",
    "currency": "USD",
    "verifierFee": "123456",
    "vendorFee": "6172",
    "created": "2024-08-08T08:53:50.524Z"
  }
]

10. Assigning additional schemas to participants

Add new schemas to the Ecosystem by assigning them to each participant.

PATCH/trust-registries/{registryId}/participants/{participantId} This endpoint allows updating the Trust Registry participant.

{
  "name": "string",
  "logoUrl": "string",
  "infoUrl": "string",
  "status": "string",
  "suspendedAt": "string",
  "issuerSchemas": [
    "http://example.org/schema/kvac2",
    "http://example.org/schema/kvac3"
  ],
  "verifierSchemas": [
    "http://example.org/schema/kvac2",
    "http://example.org/schema/kvac3"
  ]
}

Using the , scan the QR code received and follow the process to submit the verification.

here
Truvera Wallet