TrustWeave Use Case Scenarios

Version: 1.0.0-SNAPSHOT Complete end-to-end workflows demonstrating TrustWeave in real-world applications.

Overview

Each scenario provides a complete, runnable example showing how to use TrustWeave for specific use cases. All scenarios follow the same pattern:

  1. Setup – Create TrustWeave instance and configure components
  2. DID Creation – Create identifiers for actors (issuers, holders, verifiers)
  3. Credential Operations – Issue, store, and verify credentials
  4. Advanced Features – Wallet organization, presentations, blockchain anchoring
  5. Verification – Complete verification workflows

Get started quickly with these commonly used scenarios:

Scenarios by Domain

Scenarios are organized by industry domain and use case. Each scenario includes a complete, runnable example with industry context and best practices.

🆔 Identity & Access Management

Digital Identity:

  • Government Digital Identity ⭐ Citizens receive, store, and present official IDs. Complete workflow for government-issued digital identity.

  • Professional Identity ⭐ Professional credential wallet management. Demonstrates storing and organizing professional certifications and licenses.

Authentication & Authorization:

  • Zero Trust Continuous Authentication ⭐ Continuous authentication system without traditional sessions. Short-lived credentials, device attestation, risk-based access control, and continuous re-authentication.

  • Security Clearance & Access Control ⭐ Privacy-preserving security clearance verification for classified systems. Multi-level access control (Top Secret, Secret, Confidential) with selective disclosure.

  • Biometric Verification ⭐ Complete biometric verification system with fingerprint, face, and voice. Privacy-preserving biometric templates with liveness detection and multi-modal verification.

Identity Verification:

  • Age Verification ⭐ Privacy-preserving age verification for age-restricted services. Verify age without revealing personal information. Includes photo association for face verification.

  • Web of Trust ⭐ Build trust networks and reputation systems. Demonstrate how entities establish and verify trust relationships.

🎓 Education & Professional Development

Academic Credentials:

  • Academic Credentials ⭐ University credential issuance and verification. Demonstrates degree credentials, transcript management, and wallet organization.

  • National Education Credentials Algeria ⭐ AlgeroPass national-level education credential system. Shows how to build a national credential infrastructure.

Professional Development:

🏥 Healthcare

  • Healthcare Medical Records ⭐ Share consented medical data across providers with audit trails. Patient credential workflows and privacy-preserving data sharing.

  • Vaccination and Health Passports ⭐ Vaccination credential issuance and health passport verification. Privacy-preserving health credentials for travel and access control.

💰 Financial Services

  • Financial Services (KYC) ⭐ Streamline onboarding and reuse credentials across institutions. KYC/AML compliance workflows.

🏛️ Government & Public Sector

📦 Supply Chain & Logistics

Physical Supply Chain:

  • Supply Chain Traceability ⭐ Follow goods from origin to shelf with verifiable checkpoints. Complete supply chain provenance tracking.

  • Supply Chain & EUDR Compliance ⭐ EU Deforestation Regulation (EUDR) compliance with EO data. Digital Product Passports (DPP) using verifiable credentials. Automated compliance verification for 2025 EUDR requirements.

Digital Provenance:

  • Digital Workflow & Provenance ⭐ PROV-O workflow provenance tracking for digital information. Track information flow through complex workflows.

  • Software Supply Chain Security ⭐ Software provenance, build attestation, and SBOM verification. Prevent supply chain attacks with cryptographic proof of software authenticity and dependency verification.

📍 Geospatial & Earth Observation

Location Services:

  • Proof of Location ⭐ Capture sensor evidence, notarise location, and present proofs. Geospatial location proofs and verification.

  • Spatial Web Authorization ⭐ Grant AR/VR permissions using verifiable policies. DID-based authorization for spatial entities.

Earth Observation:

  • Earth Observation ⭐ Manage satellite imagery provenance with digest anchoring. Complete EO data integrity workflow with Linksets.

  • Field Data Collection ⭐ Collect and verify field data with worker authorization credentials. Issue verifiable credentials for collection events, anchor data to blockchain for tamper-proof records, and verify data integrity. Applicable to forestry, agriculture, infrastructure inspection, and environmental monitoring.

🌍 Climate & Environmental

Carbon Markets:

  • Carbon Markets & Digital MRV (dMRV) ⭐ Digital Measurement, Reporting, and Verification for carbon markets using EO data. Prevent double counting with blockchain-anchored credentials. Track carbon credit lifecycle from issuance to retirement. Supports nested climate accounting (Nation → City → Company) and Token Taxonomy Framework (TTF) integration.

Regulatory Compliance:

  • Supply Chain & EUDR Compliance ⭐ EU Deforestation Regulation (EUDR) compliance using EO data for geospatial non-deforestation proof. Build Digital Product Passports (DPP) with verifiable credentials. Automated compliance verification with Climate TRACE integration. Meet 2025 EUDR requirements with cryptographic proof.

🛡️ Insurance

Traditional Insurance:

  • Insurance Claims and Verification ⭐ Complete insurance claims verification system. Demonstrates claim credentials, damage assessment, repair verification, and fraud prevention.

Parametric Insurance:

  • Parametric Insurance with Earth Observation ⭐ Build parametric insurance systems using EO data credentials. Solve the “Oracle Problem” by enabling standardized, multi-provider data ecosystems. Accept data from any certified provider (ESA, Planet, NASA) without custom integrations. Prevents replay attacks and data corruption for $50M+ payouts.

  • Parametric Insurance for Travel Disruptions ⭐ Build parametric travel insurance system similar to Chubb Travel Pro using TrustWeave. Automatic payouts for flight delays, weather guarantees, baggage delays, and medical emergencies. Accept data from multiple providers (airlines, IATA, weather services) without custom integrations. Prevents fraud and enables quick payouts.

  • Smart Contract: Parametric Insurance ⭐ Parametric insurance using TrustWeave Smart Contracts abstraction. Demonstrates contract lifecycle, automatic execution based on EO data triggers, verifiable credentials, and blockchain anchoring. Complete workflow from contract creation to automatic payout.

🔌 IoT & Devices

Device Identity & Management:

  • IoT Device Identity ⭐ Connected device onboarding and identity management. Provision devices, rotate keys, and secure telemetry feeds.

  • IoT Device Ownership Transfer ⭐ Secure device ownership transfer with complete audit trail. Transfer authorization, previous owner revocation, and ownership history tracking.

Sensor Data & Provenance:

Firmware & Updates:

  • IoT Firmware Update Verification ⭐ Verify firmware authenticity and update authorization. Firmware attestation, update policies, version control, and rollback support.

📰 Media & Content

  • News Industry ⭐ Content provenance and authenticity verification for news media. Anchor articles, trace updates, and verify journalistic sources.

  • Event Ticketing and Access Control ⭐ Verifiable event tickets with transfer control and access verification. Prevent fraud and scalping with cryptographic proof.

💾 Data Management

  • Data Catalog & DCAT ⭐ Verifiable data catalog system using DCAT for government and enterprise. Metadata provenance and catalog management.

🔒 Cybersecurity & Compliance

Compliance:

  • SOC2 Compliance ⭐ Build SOC2 Type II compliant systems using TrustWeave. Immutable audit trails with blockchain anchoring, access control with verifiable credentials, key rotation with history preservation, change management, and automated compliance reporting. Demonstrates how to achieve SOC2 certification with verifiable proof.

Security:

  • Software Supply Chain Security ⭐ Software provenance, build attestation, and SBOM verification. Prevent supply chain attacks with cryptographic proof of software authenticity and dependency verification.

  • Security Training & Certification Verification ⭐ Instant verification of security certifications (CISSP, CEH, Security+, etc.) and training credentials. Privacy-preserving verification for HR and compliance.

How to Use These Scenarios

  1. Start with Quick Start – If you haven’t already, complete the Quick Start Guide to understand the basics.

  2. Choose Your Scenario – Pick a scenario that matches your use case or domain.

  3. Run the Example – Each scenario includes a complete, runnable main() function you can copy and execute.

  4. Customize – Adapt the examples to your specific requirements.

  5. Explore Patterns – See Common Patterns for reusable code patterns.

Scenario Structure

Each scenario follows this structure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
fun main() = runBlocking {
    // 1. Setup
    val TrustWeave = TrustWeave.create()

    // 2. Create DIDs
    import com.trustweave.trust.types.DidCreationResult
    import com.trustweave.trust.types.IssuanceResult
    import com.trustweave.trust.types.WalletCreationResult
    
    val issuerDidResult = trustWeave.createDid { method("key") }
    val issuerDid = when (issuerDidResult) {
        is DidCreationResult.Success -> issuerDidResult.did
        else -> throw IllegalStateException("Failed to create issuer DID: ${issuerDidResult.reason}")
    }
    
    val holderDidResult = trustWeave.createDid { method("key") }
    val holderDid = when (holderDidResult) {
        is DidCreationResult.Success -> holderDidResult.did
        else -> throw IllegalStateException("Failed to create holder DID: ${holderDidResult.reason}")
    }

    // 3. Issue Credential
    val issuanceResult = trustWeave.issue {
        credential {
            issuer(issuerDid.value)
            subject { id(holderDid.value) }
            issued(Instant.now())
        }
        signedBy(issuerDid = issuerDid.value, keyId = "key-1")
    }
    
    val credential = when (issuanceResult) {
        is IssuanceResult.Success -> issuanceResult.credential
        else -> throw IllegalStateException("Failed to issue credential: ${issuanceResult.reason}")
    }

    // 4. Store in Wallet
    val walletResult = trustWeave.wallet {
        holder(holderDid.value)
    }
    
    val wallet = when (walletResult) {
        is WalletCreationResult.Success -> walletResult.wallet
        else -> throw IllegalStateException("Failed to create wallet: ${walletResult.reason}")
    }
    val credentialId = wallet.store(credential)

    // 5. Verify
    val verification = TrustWeave.verifyCredential(credential).getOrThrow()

    // 6. Advanced features (scenario-specific)
    // ...
}

Prerequisites

  • Java 21+
  • Kotlin 2.2.0+
  • TrustWeave dependency (see Installation)

Contributing Scenarios

Have a use case that’s not covered? See Contributing for guidelines on creating new scenarios.