Skip to main content

Trust DID Web - Python

This repository includes Python libraries for working with did:tdw (Trust DID Web) DID documents and the underlying log format. Methods are provided for provisioning and updating DID documents as well as a resolving existing did:tdw DIDs. Currently, version 0.3 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:tdw DID can be minted using the provision command. This will create a new Askar keystore for handling the signing key.

python3 -m did_tdw.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_tdw.update --auto "did:tdw: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_tdw.resolver "did:tdw:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example"
python3 -m did_tdw.resolver "did:tdw:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example#key-1"
python3 -m did_tdw.resolver "did:tdw:QmRwq46VkGuCEx4dyYxxexmig7Fwbqbm9AB73iKUAHjMZH:domain.example/whois.vc"

For testing, this script also accepts the path to the local DID history file:

python3 -m did_tdw.resolver -f did.jsonl "did:tdw: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

Metadata

Release files for did-tdw-jamie-testing 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for did-tdw-jamie-testing 0.1.0
File Size Uploaded Provenance Actions
did_tdw_jamie_testing-0.1.0.tar.gz 25.4 kB Without provenance Details for did_tdw_jamie_testing-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for did-tdw-jamie-testing 0.1.0
File Interpreter ABI Platform Actions
did_tdw_jamie_testing-0.1.0-py3-none-any.whl Python 3 none any Details for did_tdw_jamie_testing-0.1.0-py3-none-any.whl

Total release size: 57.0 kB

Release files / did_tdw_jamie_testing-0.1.0.tar.gz

Download URL did_tdw_jamie_testing-0.1.0.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5b2b5d38aaf6ffa612bcd1ec745c25027f99b36880ac25785758ac5a4ef8e7d0
BLAKE2b-256 checksum
How to use checksums
e6eb2329a4827fa3184d97853716567e59d708976e22e1577f4bc1f59702e267
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / did_tdw_jamie_testing-0.1.0-py3-none-any.whl

Download URL did_tdw_jamie_testing-0.1.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c34ff3d49e89299b91d99c6f07ef67e4ddf7bdefce207516040236c04f03224
BLAKE2b-256 checksum
How to use checksums
61e275a9e2572aab920d72960d6271effe25d8341c2553dbfc3c990b2410413b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Security for did-tdw-jamie-testing 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page