bblurock / did-sdk-java

Support for the Hedera Hashgraph DID Method and Verifiable Credentials on the Hedera Java SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hedera™ Hashgraph DID - Java SDK

License: Apache-2.0 Documentation

LINE INSTRUCTION METHOD CLASS COMPLEXITY

This repository contains the Java SDK for managing DID Documents & Verifiable Credentials registry using the Hedera Consensus Service.

Table of Contents

Overview

Identity networks are set of artifacts on Hedera Consensus Service that allow applications to share common channels to publish and resolve DID documents, issue verifiable credentials and control their validity status. These artifacts include:

  • address book - a file on Hedera File Service that provides information about HCS topics and appnet servers,
  • DID topic - an HCS topic intended for publishing DID documents,
  • and VC topic - an HCS topic playing a role of verifiable credentials registry.

This SDK is designed to simplify :

  • creation of identity networks within appnets, that is: creation and initialization of the artifacts mentioned above,
  • generation of decentralized identifiers for Hedera DID Method and creation of their basic DID documents,
  • creation (publishing), update, deletion and resolution of DID documents in appnet identity networks,
  • issuance, revocation and status verification of Verifiable Credentials.

The SDK does not impose any particular way of how the DID or verifiable credential documents are constructed. Each appnet creators can choose their best way of creating those documents and as long as these are valid JSON-LD files adhering to W3C standards, they will be handled by the SDK.

Usage

Dependency Declaration

TODO: To be updated after release to MVN Repository.

Maven

<dependency>
  <groupId>com.hedera.hashgraph</groupId>
  <artifactId>identity</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle

implementation group: 'com.hedera.hashgraph', name: 'identity', version: '1.0.0'

Documentation

Getting Started Guides

Examples

The /examples/appnet-api-server folder contains an example implementation of an appnet that utilizes DID and VC SDK and exposes a REST API interface according to the Hedera DID Method Specification.

The appnet runs on localhost port 5050 be default. It does not expose any user interface, instead there is a collection of POSTMAN requests available here that demonstrate a full end-to-end flow of DID documents generation, publishing, update and deletion, as well as verifiable credential generation, issuance and revocation.

Please refer to the README file of the appnet project for more details.

With Docker

Install Docker for Mac, or Docker for Windows

cd identity-sdk/examples
cp .env.sample .env
nano .env

update the following environment variables with your testnet account details

  • OPERATOR_ID=0.0.xxxx
  • OPERATOR_KEY=302...

you may also edit the following to use a different network (ensure your OPERATOR_ID and OPERATOR_KEY are valid)

  • NETWORK=testnet (can be testnet, previewnet or mainnet)
  • MIRROR_PROVIDER=hedera (can be hedera or kabuto (note kabuto not available on previewnet))
docker build -t did-demo .
docker run -p 5050:5050 did-demo:latest

With Gradle

cd identity-sdk/examples
cp .env.sample .env
nano .env

update the following environment variables with your testnet account details

  • OPERATOR_ID=0.0.xxxx
  • OPERATOR_KEY=302...

you may also edit the following to use a different network (ensure your OPERATOR_ID and OPERATOR_KEY are valid)

  • NETWORK=testnet (can be testnet, previewnet or mainnet)
  • MIRROR_PROVIDER=hedera (can be hedera or kabuto (note kabuto not available on previewnet))

return to the identity-sdk folder

cd ..

run the appnet example

./gradlew :appnet-api-server:run

Contributing

We welcome participation from all developers! For instructions on how to contribute to this repo, please review the Contributing Guide.

License Information

Licensed under Apache License, Version 2.0.

References

About

Support for the Hedera Hashgraph DID Method and Verifiable Credentials on the Hedera Java SDK

License:Apache License 2.0


Languages

Language:Java 92.8%Language:XSLT 6.9%Language:Dockerfile 0.4%