This repository contains the Java SDK for managing DID Documents & Verifiable Credentials registry using the Hedera Consensus Service.
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.
TODO: To be updated after release to MVN Repository.
<dependency>
<groupId>com.hedera.hashgraph</groupId>
<artifactId>identity</artifactId>
<version>1.0.0</version>
</dependency>
implementation group: 'com.hedera.hashgraph', name: 'identity', version: '1.0.0'
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.
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
ormainnet
) - MIRROR_PROVIDER=hedera (can be
hedera
orkabuto
(notekabuto
not available onpreviewnet
))
docker build -t did-demo .
docker run -p 5050:5050 did-demo:latest
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
ormainnet
) - MIRROR_PROVIDER=hedera (can be
hedera
orkabuto
(notekabuto
not available onpreviewnet
))
return to the identity-sdk
folder
cd ..
run the appnet example
./gradlew :appnet-api-server:run
We welcome participation from all developers! For instructions on how to contribute to this repo, please review the Contributing Guide.
Licensed under Apache License, Version 2.0.