The TrustBloc Wallet SDK repo contains APIs to receive and present W3C Verifiable Credentials(VCs) signed using W3C Decentralized Identifiers(DIDs). These APIs are useful for the holder role defined in the W3C VC Specification.
The project contains the following source code components and build scripts for SDKs.
- Go SDK
- Build native Go applications using the core pkg.
- Android and iOS SDK
- A gomobile-compatible Go SDK
- For generating gomobile-compatible bindings (see below).
- To jump straight to usage documentation, see here.
- Scripts to generate Android and iOS-compatible bindings
- Allows the Go SDK to be used in an Android or iOS app.
- A gomobile-compatible Go SDK
- EXPERIMENTAL: WebAssembly(WASM)/JavaScript(JS) SDK
- Scripts to generate JavaScript/WebAssembly(WASM) bindings
- Allows the Go SDK to be used in a Web Application. Refer SDK usage guide here.
- Scripts to generate JavaScript/WebAssembly(WASM) bindings
The repo also has code to generate a Reference iOS, Android or Web App built using the Flutter framework.
The TrustBloc Wallet SDK implements following specifications.
- W3C Verifiable Credential Data Model (VCDM)
- W3C Decentralized Identifier (DID)
- OIDF OpenID for Verifiable Credential Issuance
- Pre Authorization Code flow
- Authorization Code low
- OIDF OpenID for Verifiable Presentation
- DIF Presentation Exchange
- DIF Well Known DID Configuration
The Wallet SDK Android package is available on GitHub Maven Repository. Please refer wallet-sdk maven packages for the latest releases.
<dependency>
<groupId>dev.trustbloc</groupId>
<artifactId>vc-wallet-sdk</artifactId>
<version>1.0.0</version>
</dependency>
Refer here for using the android package in your project.
Add the following GitHub maven repository to dependencyResolutionManagement.repositories
maven {
url = $URL
credentials {
username = $GITHUB_USER
password = $GITHUB_TOKEN
}
}
Use the following URL based on snapshot or release dependency: RELEASE_REPO_URL=https://maven.pkg.github.com/trustbloc/wallet-sdk
The Wallet SDK iOS xcframework packages are distributed through Swift Package Manager (SPM). Please refer
wallet-sdk tags with the suffix -swift-pm
(e.g., 1.0.0-swift-pm
) for the
latest releases.
The Wallet SDK JS package is distributed through npm. Please refer to wallet-sdk-js package for the latest snapshot releases.
The distributed package contains the WASM build file (wallet-sdk.wasm
) inside node_modules/@trustbloc-cicd/wallet-sdk-js/dist
,
which you may want to store in a different location within your project along with other assets.
In such case, you need to provide the path to the location of the WASM build file through
the opts.assestPath
parameter when you create an Agent instance:
const kmsDatabase = await CreateDB("test")
agent = new Agent({assetsPath: "path-to-folder-with-wallet-sdk-wasm-file", didResolverURI:didResolverURI, kmsDatabase: kmsDatabase});
await agent.initialize();
The Go SDK is defined in pkg. If you want to build a native Go application, then this is what you'd use.
The gomobile
-compatible version of the aforementioned Go SDK is defined in cmd/wallet-sdk-gomobile. It's similar to the Go SDK, except that the various functions, methods, and interfaces only use a subset of Go types that are compatible with the gomobile
tool. The gomobile
-compatible SDK generally acts as a wrapper for the Go SDK. Internally, it converts between the gomobile
-compatible types and the types used by the Go SDK as needed.
Thank you for your interest in contributing. Please see our community contribution guidelines for more information.
Apache License, Version 2.0 (Apache-2.0). See the LICENSE file.