Skip to main content

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

Apache License Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

did_webvh-0.3.0.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

did_webvh-0.3.0-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file did_webvh-0.3.0.tar.gz.

File metadata

  • Download URL: did_webvh-0.3.0.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for did_webvh-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e71390280f2276651a40f18bb2a3cd8939de30a1d53f247536c539f80eb64fb5
MD5 56753d3ed4e55e7a08d00621ceea6f6f
BLAKE2b-256 29d6c279316e6fe94bdd9d42fa8df17e620c6e7d6371478e2ee6016a265c1be2

See more details on using hashes here.

Provenance

The following attestation bundles were made for did_webvh-0.3.0.tar.gz:

Publisher: publish-pypi.yml on decentralized-identity/didwebvh-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file did_webvh-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: did_webvh-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for did_webvh-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30a6b80e27a47631efc1ebd8b1731dce72230a279499f235a4d53ae72ac06d7c
MD5 66a006a9155a11783c3902876e0f6adb
BLAKE2b-256 9434b1034a4e68cccb7c76ecace5d78cec1b470e1511f54b71f757b97c171dcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for did_webvh-0.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on decentralized-identity/didwebvh-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page