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