Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 0 — Set up your decentralised identity (DID)

Before you can request access to a protected dataset, you need a decentralised identifier — a cryptographic identity that stays with you across institutions.

What is a DID?

A DID is a URL-like string that points to a small JSON document containing your public key. Anyone who knows your DID can look up your public key and encrypt things specifically for you.

Example: did:web:yourname.github.io:my-did:researcher

This resolves to: https://yourname.github.io/my-did/researcher/did.json

The JSON file at that URL is your DID document — it contains your public key but never your private key.

Why not just use ORCID?

ORCID is great for attribution (who published what). But ORCID doesn’t give you a cryptographic key — you can’t encrypt a dataset key for an ORCID. DIDs add the key management layer that ORCID doesn’t provide.

In practice, a researcher has both: ORCID for citations, DID for data access.

Step 1 — Generate your keypair

This creates an EC P-256 keypair. The private key stays on your machine. The public key goes into your DID document.

Step 2 — Create your DID document

The DID document is a small JSON-LD file that maps your DID string to your public key. It follows the W3C DID Core specification.

The document above is what the world sees when they resolve your DID. It contains:

  • id — your DID string (the identifier)

  • verificationMethod — your public key in JWK format

  • authentication / assertionMethod — which key to use for authentication and signing

Notice: no private key anywhere in the document.

Step 3 — Publish the DID document

“Publishing” means putting the JSON file at the URL your DID resolves to. For did:web:yourname.github.io:my-did:researcher, the URL is:

https://yourname.github.io/my-did/researcher/did.json
# One-time setup
gh repo create my-did --public --description "My DID document"
cd my-did
mkdir -p researcher
# Copy the DID document generated above
cp /path/to/did.json researcher/did.json
git add . && git commit -m "Publish DID document"
git push
# Enable GitHub Pages on the repo (main branch, root directory)
gh repo edit --enable-pages --pages-branch main --pages-path /

After a minute, your DID is live at https://yourname.github.io/my-did/researcher/did.json

Option B: Institutional web server

Ask your IT department to serve did.json at an institutional URL, e.g. https://university.edu/researchers/alice/did.json. Your DID becomes did:web:university.edu:researchers:alice.

Option C: Personal website

If you have https://alice.example.com, put did.json at the root. Your DID is did:web:alice.example.com.


For this walkthrough, the example DID documents are already committed in keys/did/ and would be served via GitHub Pages at:

  • https://fair2adapt.github.io/fair-data-access/example-provider/did.json

  • https://fair2adapt.github.io/fair-data-access/example-consumer/did.json

Step 4 — Verify your DID resolves

Once published, anyone can resolve your DID and retrieve your public key. The fair_data_access library does this automatically when wrapping keys.

Summary

You now have:

WhatWhereWho can see it
Private keykeys/example-consumer-private.pem (your machine, gitignored)Only you
Public keykeys/example-consumer-public.pem (committed)Everyone
DID documentkeys/did/example-consumer.json (published via web)Everyone
DID stringdid:web:fair2adapt.github.io:fair-data-access:example-consumerEveryone

This identity is permanent and portable. You can use it to request access to any dataset protected by the FAIR2Adapt framework — or any other system that supports did:web resolution.

Next: Chapter 1 — Provider: encrypt and publish a policy