This repository provides a simplified process for creating your own
decentralized identifier (or DID), using the did:web
method. It generates a new key pair and creates a DID
document which uses the public key as an assertionMethod
.
The document will be hosted on GitHub pages, and the DID will have the
form did:web:github.io:USERNAME:did-web-demo
.
-
Fork this repository under your own GitHub user
-
Clone your fork to your local machine:
git clone https://github.com/USERNAME/did-web-demo # Or, if you prefer SSH-based authentication git clone [email protected]:USERNAME/did-web-demo.git
-
In a terminal, navigate to the cloned repository and run the
generate.sh
script:cd did-web-demo ./generate.sh
-
Push the repository to publish the newly created DID document
git push
-
After a few minutes, the DID should be ready to be used. You may try an online resolver such as uniresolver.io, using the DID that was printed to your console.
-
The
generate.sh
script will have created aprivate_key.pem
file in the current directory. This file is not published to GitHub, and should be kept secret. It can be used anywhere control of the newly created DID needs to be asserted.
The instructions above should work on macOS and any Linux distribution, or any
other POSIX-like environment. Windows users can run the generate.sh
using
WSL. Additionally, the git command and a Python 3 interpreter must be
available.