Async Python SDK for the Walt.id Community Stack Wallet, Issuer, and Verifier APIs.
The package is distributed as pywaltid and imported as waltid.
uv add pywaltidOr with pip:
pip install pywaltidimport asyncio
from waltid import CredentialIssuer, EnterpriseAgentCredential, IssuerAPI, WalletAPI
async def main() -> None:
async with WalletAPI() as wallet, IssuerAPI() as issuer:
holder_did = await wallet.create_did()
claims = EnterpriseAgentCredential(
org_id="org-a",
org_name="Org A",
org_did="did:key:org-a",
agent_id="agent-1",
agent_did=holder_did,
spending_limit=100_000,
)
credential_id = await CredentialIssuer(
issuer=issuer,
wallet=wallet,
).issue(holder_did=holder_did, claims=claims)
print("Holder DID:", holder_did)
print("Credential ID:", credential_id)
asyncio.run(main())Run the example against mocked SDK responses:
WALTID_MOCK=true python example.pyFor real HTTP calls, run the Walt.id Community Stack APIs and keep the default local ports:
| Service | Default URL |
|---|---|
| Wallet API | http://localhost:7001 |
| Issuer API | http://localhost:7002 |
| Verifier API | http://localhost:7003 |
Settings are read from environment variables with the WALTID_ prefix.
| Variable | Default |
|---|---|
WALTID_WALLET_URL |
http://localhost:7001 |
WALTID_ISSUER_URL |
http://localhost:7002 |
WALTID_VERIFIER_URL |
http://localhost:7003 |
WALTID_ISSUER_CREDENTIAL_ISSUER_URL |
http://waltid-issuer:7002/openid4vci |
WALTID_VERIFIER_SESSION_URL |
http://waltid-verifier:7003/verification-session |
WALTID_TIMEOUT |
30.0 |
WALTID_MAX_RETRIES |
3 |
WALTID_MOCK |
false |
Low-level async adapters:
WalletAPIfor DID creation, credential import, credential offer receipt, and VP signing.IssuerAPIfor OID4VCI credential offers.VerifierAPIfor OID4VP session creation and result polling.
High-level facades:
CredentialIssuerissues anEnterpriseAgentCredentialto a wallet-held DID.PresentationVerifiercreates OID4VP challenges, asks a wallet to present, and verifies results.
uv sync
uv run ruff check .
uv run python -m build
uv run twine check dist/*Publish a release:
uv publish- PyPI: https://pypi.org/project/pywaltid/
- Source: https://github.com/ukw2d/pywaltid
- Issues: https://github.com/ukw2d/pywaltid/issues
MIT