Identity Hub Reference Implementation
This repo contains an open source implementation of a DIF identity hub for evaluation purposes. It is not intended for production use. The APIs and protocols used throughout are part of a proposed standard for decentralized data storage.
Identity hubs provide durable storage for information and data "owned" by a decentralized identity (DID). Hubs can run in multiple different enviornments - in the cloud, on a server, or on an edge device. All instances of identity hubs that are associated with a DID synchronize data between each other to ensure consistency. Currently, identity hubs support simple read and write of JSON data.
A working identity hub implementation is composed of several layers, several of which are being developed as distinct repos:
|Standard APIs & Interfaces||hub-node-core||Protocol Explainer|
|Message Encryption & Authentication||did-auth-jose||Protocol Explainer|
|Edge Data Encryption||not yet implemented|
|Sync & Replicaition||not yet implemented|
|Pluggable Data Storage||hub-mongo-connector|
The reference implementation in this repo serves an identity hub as a simple HTTP web server using NodeJS and Express. MongoDB is used for data persistence.
To learn more about identity hubs, check out the identity-hub repo.
Run an identity hub
Follow these instructions to run an identity hub on your local machine:
Install MongoDB Community Server from this location. When prompted by the installer, choose a complete installation. Be sure to note the MongoDB data directory and installation location.
Run MongoDB on your machine using the
- Clone this repository:
git clone https://github.com/decentralized-identity/hub-node-reference
- Install all necessary packages:
Note: You may need to install python 2.7, and/or the node Windows build tools to complete this step.
If necessary, modify the MongoDB URL in the
index.jsfile. By default MongoDB runs at
Run the identity hub. This script will generate a key and register a DID for your identity hub, using a test DID method provided by Microsoft.
Note the DID output by the start script, and the private key generated in the
Run the sample app
To try out the identity hub, you can run a sample desktop app by following these instructions:
- Download and run the sample application by following the instructions at this repo: https://github.com/decentralized-identity/hub-sdk-js-sample.
- Enter the following options for the sample app, some of which are under "Advanced Options":
- For the hub DID, use the DID output by the start script above.
- For the hub URL, use
- For the resolver URL, use
- For the user private key, you may copy and paste the contents of
private.jwkor create an entirely new key.
- For the user DID, you may use the same DID from above or register an entirely new test DID.
Contribute to identity hub development
There's lots of work to be done in the area of decentralized data storage. If you'd like to get involved, consider joining the Decentralized Identity Foundation and participating in the Storage & Compute Working Group.