Code Monkey home page Code Monkey logo

hub-reference's Introduction

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:

Layer GitHub Repo Docs
Client SDK hub-sdk-js
Standard APIs & Interfaces hub-node-core Protocol Explainer
Message Encryption & Authentication did-auth-jose Protocol Explainer
Permissions/Authorization hub-node-core Explainer
Edge Data Encryption not yet implemented
Sync & Replicaition not yet implemented
Pluggable Data Storage hub-storage-mongo

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:

  1. 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.

  2. Run MongoDB on your machine using the mongod command:

mongod --dbpath="path-to-data-directory"
  1. Clone this repository:
git clone https://github.com/decentralized-identity/hub-node-reference 
  1. Install all necessary packages:
npm install

Note: You may need to install python 2.7, and/or the node Windows build tools to complete this step.

  1. If necessary, modify the MongoDB URL in the index.js file. By default MongoDB runs at mongodb://localhost:27017.

  2. 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.

npm start

Note the DID output by the start script, and the private key generated in the private.jwk file.

Run the sample app

To try out the identity hub, you can run a sample desktop app by following these instructions:

  1. Download and run the sample application by following the instructions at this repo: https://github.com/decentralized-identity/hub-sdk-js-sample.
  2. 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 http://localhost:8080
  • For the resolver URL, use https://beta.discover.did.microsoft.com/
  • For the user private key, you may copy and paste the contents of private.jwk or 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.

hub-reference's People

Contributors

csuwildcat avatar dstrockis avatar symorton avatar therecanbeonlyone1969 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.