Skip to main content

This repository includes Python libraries for working with `did:webvh` (Trust DID Web) DID documents and the underlying log format.

Project description

DID Web Verified Hostory - 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.vc"

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_jamie_testing-0.2.1.tar.gz (28.0 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_jamie_testing-0.2.1-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file did_webvh_jamie_testing-0.2.1.tar.gz.

File metadata

  • Download URL: did_webvh_jamie_testing-0.2.1.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for did_webvh_jamie_testing-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6869505c0577527af30ebbaae8a5b811ed7f189161b67a73e0a715e85f806537
MD5 34264f575145b409d54092eb9e9f98cd
BLAKE2b-256 7ea842ddfee57fc346d42ac7dfb85b4c5f8f181e6b4b9039fc416fc890edc3a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for did_webvh_jamie_testing-0.2.1.tar.gz:

Publisher: publish-pypi.yml on jamshale/trustdidweb-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_jamie_testing-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for did_webvh_jamie_testing-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab42d9e273ffc2387016c3243cee1d51d5b999d3b7d29e619341107270fbfc29
MD5 d68c4fc95e27353a97d838af52ead886
BLAKE2b-256 f42b74070ce450f01a9ca0a44d1d471e3abf53a284b13a139f2ae2fe424e82ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for did_webvh_jamie_testing-0.2.1-py3-none-any.whl:

Publisher: publish-pypi.yml on jamshale/trustdidweb-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