Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Web5 SDK Mono Repo
This monorepo houses the core components of the Web5 platform containing the core Rust code with Kotlin bindings. It features libraries for building applications with decentralized identifiers (DIDs), verifiable credentials (VCs), presentation exchange (PEX), and much more.
Table of Contents
Features
Getting Started
To start developing applications and services with the Web5 RS SDK, the following steps will guide
you through setting up your local development environment.
For detailed documentation on usage refer to the
API reference documentation. Additionally, comprehensive
guides can be found at the TBD Developer site to enhance
your understanding of the underlying concepts and how to implement them effectively.
Cloning
This repository uses git submodules. To clone this repo with submodules:
Or to add submodules after cloning:
Development Prerequisites
Hermit
This project uses hermit to manage tooling like the Rust compiler, Java Development Kit and Maven project management system.
See this page to set up Hermit on your machine - make sure to
download the open source build and activate it for the project.
Once you've installed Hermit and before running builds on this repo,
run from the root:
source ./bin/activate-hermit
This will set your environment up correctly in the
terminal emulator you're on. Executing
just
commands should "just work", nomatter the underlying tooling used (ie.
rustc
,cargo
,mvn
,java
, etc).Building and Testing
To run, find a build target from the table below and use
just
:$> just [buildTarget]
setup
git
submodules,rustup
, etc.build
test
lint
bind
bind-kotlin
test-bound
test-kotlin
For instance:
$> just build
Binding Process
The binding process follows these key steps:
Core Rust Development
All the core logic for working with DIDs, verifiable credentials, and cryptographic signing and verification is implemented in Rust. Rust is chosen as the core layer for its memory safety, performance, and cross-platform capabilities.
Building the Kotlin Bindings
The Kotlin bindings are generated from the core Rust code and live in the
bound/kotlin
directory. These bindings allow Kotlin applications to access the functionality of the core Rust libraries through idiomatic Kotlin APIs.Packaging & Distribution
The Kotlin bindings are packaged and distributed as a Kotlin library, which can be imported and used in Kotlin applications just like any other dependency.
API Documentation
For the full detailed API design and usage examples, refer to the API Design Document
Basic Usage
The SDK allows developers to work with decentralized identifiers (DIDs), verifiable credentials, and presentation exchanges. Below are the key use cases:
DidJwk Creation
You can create DIDs using the
Did::create
method.Verifiable Credential Creation & Signing
Create a verifiable credential using
VerifiableCredential::create
and sign it with a DID.Verifiable Presentation Creation & Signing
Use the SDK to create and sign verifiable presentations with
VerifiablePresentation::create
andsign
.Presentation Exchange
Select the appropriate credentials and generate presentations based on the presentation definitions using
PresentationDefinition::select_credentials
andcreate_presentation_from_credentials
.Rust Examples
Instantiate a new
did:jwk
Simple Verifiable Credential Creation & Signing
Kotlin Examples
Instantiate a new
did:jwk
Simple Verifiable Credential Creation & Signing