This repository includes Python libraries for working with `did:webvh` (did:web + Verified History) DID documents and the underlying log format.
Project description
DID Web + Verified History - Python
This repository includes Python libraries for working with did:webvh (did:web + Verified History) DID documents and the underlying log format. Methods are provided for provisioning and updating DID documents as well as a resolving existing did:webvh DIDs. Currently, version 0.4 of the specification is implemented.
Prerequisites
This library requires Python 3.10 or later. Dependencies are listed in pyproject.toml and can be installed via:
poetry install
Usage
A new did:webvh DID can be minted using the provision command. This will create a new Askar keystore for handling the signing key.
python3 -m did_webvh.provision --auto "domain.example"
This will output a new directory named after the new DID, containing did.jsonl (the DID log) and did.json (the current state of the document).
To automatically update the DID, edit did.json and execute the update command (use the identifier output from the provision command):
python3 -m did_webvh.update --auto "did:webvh:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example"
DID Resolution
The resolver script may be invoked via the command line, and supports dereferencing of fragments and paths:
python3 -m did_webvh.resolver "did:webvh:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example"
python3 -m did_webvh.resolver "did:webvh:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example#key-1"
python3 -m did_webvh.resolver "did:webvh:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example/whois.vp"
For testing, this script also accepts the path to the local DID history file:
python3 -m did_webvh.resolver -f did.jsonl "did:webvh:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example"
Demo
For demo purposes, a new DID can be minted along with a series of test updates applied using the included demo script:
python3 demo.py domain.example
Contributing
Pull requests are welcome! Please read our contributions guide and submit your PRs. We enforce developer certificate of origin (DCO) commit signing — guidance on this is available. We also welcome issues submitted about problems you encounter in using Trust DID Web - Python.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file did_webvh-1.0.0.tar.gz.
File metadata
- Download URL: did_webvh-1.0.0.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
025f1a9e9efcc879b17c03456bcc00776cc20d703ad477e2adc1d35cfbe3bd8b
|
|
| MD5 |
40461d61dcff309b6de572a056c1e947
|
|
| BLAKE2b-256 |
ae538dc84f4955867d3b8783cf1563b89fe0192dbbd66fa16560a5a11f2a22cb
|
Provenance
The following attestation bundles were made for did_webvh-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on decentralized-identity/didwebvh-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
did_webvh-1.0.0.tar.gz -
Subject digest:
025f1a9e9efcc879b17c03456bcc00776cc20d703ad477e2adc1d35cfbe3bd8b - Sigstore transparency entry: 422729161
- Sigstore integration time:
-
Permalink:
decentralized-identity/didwebvh-py@b0702fb18323a2f604fe693947297115febb57d3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/decentralized-identity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b0702fb18323a2f604fe693947297115febb57d3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file did_webvh-1.0.0-py3-none-any.whl.
File metadata
- Download URL: did_webvh-1.0.0-py3-none-any.whl
- Upload date:
- Size: 47.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d47c2ecb46839db9140e4dd2c756254b3d3691e27353ad3a2b5ce854054d000
|
|
| MD5 |
f180a230a56229353868c23d548f0edd
|
|
| BLAKE2b-256 |
b5b32532e55192ada5561255dfde08e06e82dce37fce35df3d639f236308b5d3
|
Provenance
The following attestation bundles were made for did_webvh-1.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on decentralized-identity/didwebvh-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
did_webvh-1.0.0-py3-none-any.whl -
Subject digest:
8d47c2ecb46839db9140e4dd2c756254b3d3691e27353ad3a2b5ce854054d000 - Sigstore transparency entry: 422729171
- Sigstore integration time:
-
Permalink:
decentralized-identity/didwebvh-py@b0702fb18323a2f604fe693947297115febb57d3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/decentralized-identity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b0702fb18323a2f604fe693947297115febb57d3 -
Trigger Event:
workflow_dispatch
-
Statement type: