Comprehensive examples and tutorials for the walt.id Identity SDK, covering cryptographic operations, DID management, and verifiable credentials.
- Prerequisites
- Quick Start
- Project Structure
- Available Examples
- Running Examples
- Key Features
- Documentation
- Community
- License
- Java 11+ or Kotlin 1.8+
- Gradle 7.0+ (or Maven 3.6+)
- IDE (IntelliJ IDEA recommended)
-
Clone the repository:
git clone https://github.com/walt-id/waltid-examples.git cd waltid-examples -
Build the project:
./gradlew build
-
Run all examples (Kotlin):
./gradlew run -PmainClass=RunAllKt
-
Run all examples (Java):
./gradlew run -PmainClass=waltid.RunAll
-
Run individual examples:
# Generate cryptographic keys ./gradlew run -PmainClass=crypto.key.create.Ed25519Kt # Create a DID ./gradlew run -PmainClass=did.create.KeyKt # Sign a verifiable credential ./gradlew run -PmainClass=vc.jwt.SignKt
waltid-examples/
├── src/main/
│ ├── kotlin/ # Kotlin examples
│ │ ├── crypto/ # Cryptographic operations
│ │ │ ├── key/ # Key management
│ │ │ │ ├── create/ # Key generation
│ │ │ │ ├── decode/ # Key import (JWK, PEM, Raw)
│ │ │ │ └── encode/ # Key export (JWK, PEM, Raw)
│ │ │ └── signatures/ # Digital signatures
│ │ │ ├── jws/ # JSON Web Signatures
│ │ │ └── raw/ # Raw signatures
│ │ ├── did/ # Decentralized Identifiers
│ │ │ ├── create/ # DID creation methods
│ │ │ └── resolve/ # DID resolution
│ │ ├── vc/ # Verifiable Credentials
│ │ │ ├── jwt/ # JWT-based VCs
│ │ │ └── sdjwt/ # Selective Disclosure JWTs
│ │ └── vp/ # Verifiable Presentations
│ └── java/ # Java examples
│ └── waltid/ # Java implementation
└── build.gradle.kts # Build configuration
| Feature | Description | Kotlin | Java |
|---|---|---|---|
| Key Generation | Create cryptographic keys (Ed25519, RSA, Secp256k1, Secp256r1) | 📁 | 📄 |
| Key Import | Import keys from JWK, PEM, or raw formats | 📁 | 📄 |
| Key Export | Export keys to various formats | 📁 | 📄 |
| Raw Signatures | Sign and verify raw data | 📁 | 📄 |
| JWS Signatures | JSON Web Signature operations | 📁 | 📄 |
| Feature | Description | Kotlin | Java |
|---|---|---|---|
| DID Creation | Generate DIDs using various methods (did:key, did:web, did:jwk, did:cheqd) | 📁 | 📄 |
| DID Resolution | Resolve DIDs to DID documents | 📁 | 📄 |
| Feature | Description | Kotlin | Java |
|---|---|---|---|
| JWT VCs | Create and verify JWT-based verifiable credentials | 📁 | 📄 |
| SD-JWT VCs | Selective disclosure JWT credentials | 📁 | 📄 |
| Feature | Description | Kotlin | Java |
|---|---|---|---|
| VP Operations | Create and verify verifiable presentations | 📁 | 📄 |
Run all examples:
# Kotlin version
./gradlew run -PmainClass=RunAllKt
# Java version
./gradlew run -PmainClass=waltid.RunAllRun specific examples:
# Key generation
./gradlew run -PmainClass=crypto.key.create.Ed25519Kt
./gradlew run -PmainClass=crypto.key.create.RSAKt
# DID operations
./gradlew run -PmainClass=did.create.KeyKt
./gradlew run -PmainClass=did.resolve.KeyKt
# Verifiable credentials
./gradlew run -PmainClass=vc.jwt.SignKt
./gradlew run -PmainClass=vc.sdjwt.SignKt-
IntelliJ IDEA:
- Open the project
- Navigate to any example file
- Right-click and select "Run"
-
VS Code:
- Install Kotlin and Java extensions
- Use the integrated terminal to run Gradle commands
If you prefer Maven, add the walt.id repository to your pom.xml:
<repositories>
<repository>
<id>walt.id</id>
<url>https://maven.waltid.dev/releases</url>
</repository>
</repositories>- 🔐 Multi-algorithm Support: Ed25519, RSA, Secp256k1, Secp256r1
- 📦 Multiple Key Formats: JWK, PEM, Raw (Base58)
- 🆔 DID Methods: did:key, did:web, did:jwk, did:cheqd
- 🎫 VC Standards: JWT VCs, SD-JWT (Selective Disclosure)
- 🎭 VP Support: Verifiable Presentations
- 🌐 Cross-platform: Java and Kotlin implementations
- 📚 Comprehensive: From basic key generation to complex credential workflows
- walt.id SDK Documentation: https://docs.walt.id/
- Identity Repository: https://github.com/walt-id/waltid-identity
- Maven Repository: https://maven.waltid.dev/#/releases/id/walt
- API Reference: Available in the test directories of the identity repository
Connect with the walt.id community:
- 💬 Discord: Join our Discord server
- 📧 Newsletter: Subscribe to updates
- 📺 YouTube: Watch tutorials
- 🐦 Twitter: Follow @walt_id
- 💭 GitHub Discussions: Get help and discuss features
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Made with ❤️ by the walt.id team
Website • Documentation • GitHub • Discord