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
  • Purpose
  • Flow
  • How to trigger a biometric verification
  • How to enable the biometric plugin in the wallet
  • Credential expiration
  • Credential types
  • How to bind a biometric to a credential
  • TrustX Biometric Plugin
  • Adding a custom biometric provider

Was this helpful?

Edit on GitHub
  1. Credential wallet
  2. Wallet SDK

Biometric plugin

Purpose

The biometrics plugin provides a way to perform credential verification using the user's biometric data. It is useful to guarantee that only the biometric holder can perform the verification.

Flow

The biometric plugin flow is the following:

sequenceDiagram
    autonumber
    participant User
    participant BiometricPlugin as Biometric Plugin
    participant MobileWallet as Mobile Wallet
    participant WalletAPI as Wallet API

    User ->> MobileWallet: Scan QR code
    note over User, MobileWallet: Poof Request from Truvera 
    activate MobileWallet
    MobileWallet ->> BiometricPlugin: Initialize Biometric Plugin
    deactivate MobileWallet
    activate BiometricPlugin
    BiometricPlugin ->> MobileWallet: Check for existing EnrollmentCredential VC
    
    alt Enrollment VC not found
        BiometricPlugin ->> MobileWallet: Fetch Wallet DID
        BiometricPlugin ->> BiometricPlugin: Perform Biometric Check
        BiometricPlugin -->> WalletAPI: Issue EnrollmentCredential VC
        BiometricPlugin -->> WalletAPI: Issue BiometricMatchCredential VC
        BiometricPlugin ->> MobileWallet: Store EnrollmentCredential VC
        BiometricPlugin ->> MobileWallet: Store BiometricMatchCredential VC
       
    else Enrollment VC exists
        BiometricPlugin ->> MobileWallet: Fetch Wallet DID
        BiometricPlugin ->> BiometricPlugin: Perform Biometric Check
        BiometricPlugin ->> MobileWallet: Fetch existing BiometricMatchCredential VC
        BiometricPlugin -->> WalletAPI: Issue BiometricMatchCredential VC
        BiometricPlugin ->> MobileWallet: Store BiometricMatchCredential VC
    end
    deactivate BiometricPlugin
    activate MobileWallet
    MobileWallet ->> MobileWallet: Redirect user to the verification flow
    MobileWallet ->> MobileWallet: User selects the biometric check credential
    MobileWallet ->> TruveraAPI: Verify BiometricMatchCredential VC
    TruveraAPI ->> MobileWallet: Return verification result
    deactivate MobileWallet

How to trigger a biometric verification

To trigger a biometric verification, you need to use a verification template that asks for the biometric attributes. Check the following example:

{
  "id": "Credential 1",
  "name": "Forsur Verification - Biometrics Enrollment",
  "purpose": "Forsur wants to verify the ownership of - Biometrics Enrollment and the validity of the Biometrics Credentials.",
  "constraints": {
    "fields": [
      {
        "path": ["$.credentialSubject.id"]
      },
      {
        "path": ["$.credentialSubject.biometric.id"]
      },
      {
        "path": ["$.credentialSubject.biometric.created"]
      },
      {
        "path": [
          "$.issuer.id",
          "$.issuer",
          "$.vc.issuer.id",
          "$.vc.issuer",
          "$.iss"
        ],
        "filter": {
          "const": "did:dock:5HLbQLSmirNuZVRsdWKbsgdajw9QTGzSFJABSVzMT5EBj5sb"
        },
        "predicate": "required"
      }
    ]
  }
}

The presence of the following fields should trigger the biometric check:

{
  "path": ["$.credentialSubject.biometric.id"]
},
{
  "path": ["$.credentialSubject.biometric.created"]
}

How to enable the biometric plugin in the wallet

To enable the biometric plugin in a white-label wallet, you need to edit the following file src/wallet-sdk-configs.ts and add your configuration:

import { BiometricsProviderConfigs, IDVProviderFactory, setConfigs } from '@docknetwork/wallet-sdk-core/src/biometric-provider';
import { createTruveraIDVProvider, TruveraIDVConfig } from '@docknetwork/wallet-sdk-react-native/lib/truvera-biometric-plugin';
import { IWallet } from '@docknetwork/wallet-sdk-core/src/types';
import { EventEmitter } from 'events';

export const biometricProviderConfigs: BiometricsProviderConfigs<TruveraIDVConfig> = {
  enrollmentCredentialType: 'ForSurBiometricEnrollment',
  biometricMatchCredentialType: 'ForSurBiometric',
  idvConfigs: {
    ecosystemID: '<Ecosystem ID>',
    issuerDID: '<Issuer DID>',
    enrollmentCredentialSchema: '<Enrollment Credential Schema>',
    biometricMatchCredentialSchema: '<Biometric Match Credential Schema>',
    biometricMatchExpirationMinutes: 2,
    walletApiUrl: '<Wallet API URL>',
  },
};

setConfigs(biometricProviderConfigs);

export const idvProviderFactory: IDVProviderFactory = {
  create: (eventEmitter: EventEmitter, wallet: IWallet) => {
    return createTruveraIDVProvider({
      eventEmitter,
      wallet,
      configs: biometricProviderConfigs.idvConfigs,
    });
  },
};

The truvera biometric plugin requires the following configs:

  • walletApiUrl: The URL of the wallet API that will be used to issue the credentials

  • ecosystemID: The ecosystem ID of the biometric service

  • issuerDID: The DID of the issuer

  • enrollmentCredentialSchema: The schema of the enrollment credential

  • biometricMatchCredentialSchema: The schema of the biometric match credential

  • biometricMatchExpirationMinutes: The expiration time of the biometric match credential

Credential expiration

Credential expiration allows the biometric service provider to specify a maximum length to the validity of a biometric check credential. If the verifier wants to force a refresh of the biometric check more frequently, the verifier can check the credential creation timestamp during verification to ensure it's within their business rules.

Credential types

This plugin uses two types of credentials to perform the biometric verification:

  • Enrollment Credential: This optional credential contains the biometric data of the user. The biometric data is stored in the credential subject field and will be used to perform the biometric match.

  • Biometric Match Credential: This credential is issued by the biometric plugin after the biometric match. It contains the biometric ID, the issuer, and the creation date. The verifier can use this credential to check if the biometric match was performed recently and by the same issuer, and it will not contain any biometric data.

How to bind a biometric to a credential

Before issuing a credential, the issuer may request to verify the biometric check credential. If a valid credential does not exist, the wallet will trigger the biometric plugin to confirm the biometric and issue a credential.

The biometric check credential needs a unique binding ID that can only be generated by that specific user. The issuer can then include in the primary credential, the biometric ID and biometric issuer as attributes that bind that credential to that holder's biometric.

At the time of verification, the verifier can request the biometric check credential along with the primary credential. If the biometric check credential is recent enough, from the same issuer, and contains the same biometric ID, then the verifier can know it is the same holder presenting the credential.

The biometric ID should not contain the user's actual biometric information. When enrolling a holder in the biometric service, it might be useful to issue an enrolment credential containing the biometric template, the generated biometric ID and any other needed information to identify a returning user. This credential can be verified to get the user's information before checking their biometric. By storing this information with the holder, it avoids the biometric service having to store that PII outside of the control of the holder. The holder should only share a biometric enrollment credential with the biometric service that issued it.

TrustX Biometric Plugin

The TrustX biometric plugin uses the TrustX API to perform biometric verification and implements the IDVProvider interface.

import { BiometricsProviderConfigs, IDVProviderFactory, setConfigs } from '@docknetwork/wallet-sdk-core/src/biometric-provider';
import { createTrustXIDVProvider, TrustXIDVConfig } from '@docknetwork/wallet-sdk-react-native/lib/trustx-biometric-plugin';
import { DataStoreConfigs } from '@docknetwork/wallet-sdk-data-store/src/types';
import { DEFAULT_WALLET_CONFIGS } from '@docknetwork/wallet-sdk-react-native/lib/wallet';
import { IWallet } from '@docknetwork/wallet-sdk-core/src/types';
import { EventEmitter } from 'events';

export const biometricProviderConfigs: BiometricsProviderConfigs<TrustXIDVConfig> = {
  enrollmentCredentialType: 'ForSurBiometricEnrollment',
  biometricMatchCredentialType: 'ForSurBiometric',
  idvConfigs: {
    walletApiUrl: 'https://bank-demo.truvera.io/api',
  },
};

setConfigs(biometricProviderConfigs);

export const idvProviderFactory: IDVProviderFactory = {
  create: (eventEmitter: EventEmitter, wallet: IWallet) => {
    return createTrustXIDVProvider({
      eventEmitter,
      wallet,
      configs: biometricProviderConfigs.idvConfigs,
    });
  },
};

export const dataStoreConfigs: DataStoreConfigs = DEFAULT_WALLET_CONFIGS;

Adding a custom biometric provider

  • enroll: Enrolls the biometric data. It should issue an enrollment credential and a match credential.

  • match: Performs the biometric match and if it is valid, returns a biometric match credential.

The plugin should be registered in the wallet-sdk-configs.ts file.

PreviousCloud walletNextEcosystem Tools

Last updated 19 hours ago

Was this helpful?

Adding a custom biometric provider will require the development of the plugin following the IDVProvider interface defined at . The plugin should implement the following methods:

packages/core/src/biometric-provider.ts