stls-identity
DID + Verifiable Credential identity layer for the STLS-AI ecosystem.
Fourth package in the monorepo, on top of stls-core: adds a
persistent, third-party-verifiable identity to agents — separate from
authorization — without touching stls-core, stls-a2a or
stls-mcp. ApiKeyManager/KeyRecord remain fully operational in
parallel throughout the migration.
What it does
| Capability | Module | Status |
|---|---|---|
DID Document (did:web), Ed25519 key bootstrap |
stls_id_did.py |
✅ tested |
Identity Credential (NetworkAuthorityCredential) |
stls_id_issuer.py |
✅ tested |
| Operational Credential — Grantor → Requestor delegation, depth-limit 1 | stls_id_delegation.py |
✅ tested |
| Revocation via status list (bitstring on Redis, 5 min MRI) | stls_id_status.py |
✅ tested (real Redis) |
| Verifiable Presentation (Identity + Operational bundle) | stls_id_presentation.py |
✅ tested |
| Identity Bridge (HTTP: DID Document + status list) | stls_id_bridge.py, stls_id_postgres_store.py |
✅ tested (real Postgres) |
| Trust Anchor Registry — recognized Authorities + key history | stls_id_trust_registry_*.py |
✅ tested (real Postgres), hooked up live to the Sentinel |
Verification (Sentinel) — signature, validity, revocation, delegation chain |
stls_id_verifier.py |
✅ tested |
Canonicalization: real RFC 8785 (JCS) via the rfc8785 library, not an
approximation — necessary so that bridges implemented independently on
different platforms converge on the same signed bytes. Signature:
Ed25519, proof type DataIntegrityProof /
cryptosuite: eddsa-jcs-2022.
What it does NOT do (yet)
Listed explicitly so it doesn't look like it was forgotten:
- VP bundle wire format inside
stls-a2a— the model (VerifiablePresentation) and the verification logic exist and are tested; how it travels in an actual A2A request (header? dedicated field?) is not yet specified instls-a2a. - Single-agent key rotation — key history only exists for Governing Authorities in the Trust Anchor Registry. An agent that rotates its own key doesn't have the same mechanism (its DID Documents have no history).
- Hardware-backed keystore —
IdentityKeystoreBaseonly has software backends (memory,redis); every credential honestly declareskeyStorageTier: TIER_1_SOFTWARE, never a higher tier. - Registry governance beyond Option A — only the centralized registry (operated by an anchor member) is implemented. Quorum (Option B) and the transparency log (Option C) remain design-only.
- PQC for identity signing — credentials are signed with Ed25519
only (classical). The Ed25519+ML-DSA hybrid discussed for alignment
with
stls-core's PQC handshake is not implemented. - Selective disclosure / ZKP, DIDComm receipts — explicitly Phase 5/Full, never in scope for this version.
Installation
In the monorepo, with uv:
cd python/stls-identity
uv venv
uv sync --extra dev
[tool.uv.sources] resolves stls-core from the sibling folder
(../stls-core) in editable mode — no extra manual step needed.
Quick usage
from stls_identity import (
IdentityManager, InMemoryIdentityKeystore,
bootstrap_signing_key, build_did_document,
)
keystore = InMemoryIdentityKeystore() # in production: RedisIdentityKeystore
key, pub, _ = bootstrap_signing_key("my-agent", keystore)
doc = build_did_document(
host="sofia.sparkle.example.com",
agent_path_segments=["agents", "my-agent"],
governing_authority_did="did:web:sofia.sparkle.example.com",
signing_public_key=pub,
)
Three complete, runnable examples in examples/:
basic_identity_and_delegation.py— DID, Identity Credential, Operational Credential, all in a single flowfederated_grantor_external_authority.py— an external Grantor (Operator C), with and without onboarding into the Trust Anchor Registryinternal_grantor_no_registry_needed.py— a Grantor internal to Sparkle: no external bridge, no registry involved
uv run python examples/basic_identity_and_delegation.py
Tests
uv run pytest -v
Requires reachable Redis and Postgres for the tests that actually use
them (test_status_list_redis.py, test_postgres_store.py,
test_trust_registry.py, test_bridge.py) — see .env.example for
the variables (IDENTITY_TEST_PG_DSN, STATUS_LIST_TEST_REDIS_URL,
loaded automatically by tests/conftest.py). Tests that don't touch
external infrastructure still run with nothing configured.
68 tests as of 0.1.0, all against real crypto/DB/cache where relevant — never against Python stubs for the parts that matter (signing, canonicalization, persistence, revocation).
Structure
src/stls_identity/
stls_id_models.py Pydantic models (DID, VC, VP, TrustAnchorEntry)
stls_id_did.py DID Document, key bootstrap, multibase encode/decode
stls_id_keystore.py signing-key persistence (no-TTL, not ArqitKeyStoreBase)
stls_id_issuer.py IdentityManager — Identity Credential issuance
stls_id_delegation.py DelegationManager — Operational Credential, depth-1
stls_id_status.py status list (Redis bitstring, MRI)
stls_id_presentation.py Verifiable Presentation construction/signing
stls_id_verifier.py Sentinel — all verifications
stls_id_postgres_store.py DID Document + status list cache (Postgres)
stls_id_bridge.py public HTTP endpoints (FastAPI)
stls_id_trust_registry_store.py Trust Anchor Registry, key history (Postgres)
stls_id_trust_registry_client.py cache/TTL, historical fallback for the Sentinel
stls_id_trust_registry_bridge.py read-only HTTP endpoint for the registry
examples/ three runnable scripts, real data generated by the code
tests/ 68 tests, same "against real infrastructure" discipline as the rest of the monorepo
License
Dual-licensed: GNU AGPLv3 or commercial license,
consistent with stls-core, stls-a2a and stls-mcp.
Metadata
Release files for stls-identity 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stls_identity-0.1.0.tar.gz | 68.1 kB | With provenance | Details for stls_identity-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stls_identity-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for stls_identity-0.1.0-py3-none-any.whl |
Total release size: 125.6 kB
Release files / stls_identity-0.1.0.tar.gz
| Download URL | stls_identity-0.1.0.tar.gz |
|---|---|
| Size | 68.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3163a24272a600ddfea900a325a88670776b73816638baba7667628262951696
|
|
BLAKE2b-256 checksum How to use checksums |
d3e8eac501fb3cbe9f804f4891f1deb064bde82d342733f24b15c1b8eff7435e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / stls_identity-0.1.0-py3-none-any.whl
| Download URL | stls_identity-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aba41f5f75cdc4a7c6043f28030f44390f607b287248492699b74cdb972d485a
|
|
BLAKE2b-256 checksum How to use checksums |
23a671c3cf863e56a89644bd293ac2be4af70de4131db92cbcd5b6bb8d064d9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for stls-identity 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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for stls_identity-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA 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.