Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

polaris-sdk-python

PyPI CI GitHub stars Discord

A server-side SDK for a relying party to verify Polaris identity credentials. It answers one narrow question about a credential a holder presented: is it authentic, and is it authoritative right now? It never returns a person's data.

Naming: this project installs the module polaris_verify (the library). The command-line verifier is the separate project polaris-verify (module polaris_verify_cli).

  • Authenticity (offline, cacheable): the ML-DSA-65 signature over SHA3-256(token_value), verified with cryptography (and liboqs as a second witness when present), optionally against trusted issuer anchor keys.
  • Authorization (online, fresh): the issuer's POST /api/v1/verify, authenticating as a registered organization with OAuth2 client-credentials.

accept requires both; without a reachable issuer the verdict is provisional. Self-contained: only cryptography plus the standard library.

from polaris_verify import PolarisVerifier

v = PolarisVerifier(
    issuer_url="https://issuer.example",
    client_id="rp_...", client_secret="...",         # from `polaris rp-register`
    anchors=["<issuer public key hex>"],             # optional trust anchors
)
verdict = v.verify_presentation(presentation)        # a wallet presentation, or a bare pack
print(verdict.decision)                              # "accept" | "reject" | "provisional"

Offline only (no issuer_url) yields a provisional verdict from authenticity alone. verify_authenticity(pack, anchors) exposes the offline check directly.

issuer_url must be https: the status check sends the client secret and a bearer token. allow_insecure_http=True admits http for a local test issuer. No redirect is followed, so neither secret reaches another host; configure the issuer's final URL.

A first run needs no issuer and no credential of your own: the repository publishes test vectors. --pre matters: this is a release candidate, and without it pip installs 0.1.0, which predates every fix in SECURITY.md.

pip install --pre polaris-sdk-python
base=https://raw.githubusercontent.com/EgorKhaklin/polaris-id/main/vectors
curl -sO $base/ml-dsa-65-valid.json && curl -sO $base/ml-dsa-65-tampered-signature.json
python3 -c "
import json
from polaris_verify import verify_authenticity
for f in ('ml-dsa-65-valid.json', 'ml-dsa-65-tampered-signature.json'):
    print(f, verify_authenticity(json.load(open(f)), None).authentic)"

The first prints True, the second False. Walked on 2026-09-23 from a clean virtualenv against the package on PyPI.

What it verifies

Everything below is offline and self-contained. Signatures are accepted under two FIPS 204 parameter sets, ML-DSA-65 (the default) and ML-DSA-87; ML-DSA-44 and any other value are refused (wire spec section 6).

Both SDKs, and the detached verifier, read the values they compare one way (wire spec section 1): a key or a digest is a hex string in any case; an agency or context id is a string or an integer of at most 2^53 - 1; a grant id, a nonce, an action or a token value is a string or such an integer, read as text. Anything else matches nothing, so the same bytes get one answer in every language.

  • verify_authenticity(pack, anchors): the authenticity pack.
  • verify_status_assertion(assertion, now): the short-lived signed status assertion.
  • verify_presentation(presentation, ...): a wallet presentation, or a bare pack.
  • verify_signed_artifact(obj, now): every other signed artifact of the wire spec: the epoch checkpoint, revocation feed, federation manifest, status bundle, transparency STH, timestamp, registry, exchange request, exchange receipt, mint statement, signed document, ID token and trust list (authenticity, freshness where windowed, and the artifact's commitment or self-consistency).
  • verify_cross_authority(...): the federation trust decision (accept / reject) under the relying party's trust anchors; with none, no manifest is trusted. By default it accepts a trust edge the attesting agency did not sign, as version 1 manifests carry; a relying party should pass require_signed_attestation=True to require that agency's signature.
  • verify_exchange_request(...), verify_exchange_receipt(...), verify_exchange_mint(...): an exchange artifact in use: whether it is by the party expected, whether the requester was attested in its context at a stated instant (and by whom, for a receipt), and whether the bodies held match the commitments.

The SDK passes every case of the conformance suite (281 cases, measured against the repository on 2026-10-01) and every case of the frozen version-1 set under scripts/polaris-compat-suite.py, which runs on every CI push.

Conformance

This SDK is the reference implementation of the Polaris verification conformance suite (../../conformance/). python -m polaris_verify.conformance implements the language-agnostic verifier CLI the suite drives; passing the suite is the integration contract. See conformance/SPEC.md.

Metadata

Release files for polaris-sdk-python 1.0.0rc9

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

Source distribution (sdist)

Source distribution for polaris-sdk-python 1.0.0rc9
File Size Uploaded Provenance Actions
polaris_sdk_python-1.0.0rc9.tar.gz 41.4 kB With provenance Details for polaris_sdk_python-1.0.0rc9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polaris-sdk-python 1.0.0rc9
File Interpreter ABI Platform Actions
polaris_sdk_python-1.0.0rc9-py3-none-any.whl Python 3 none any Details for polaris_sdk_python-1.0.0rc9-py3-none-any.whl

Total release size: 84.4 kB

Release files / polaris_sdk_python-1.0.0rc9.tar.gz

Download URL polaris_sdk_python-1.0.0rc9.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f3755675079a15894f544ff118008c1dadae5e77a4a45b9f12a4edca0ab2f83
BLAKE2b-256 checksum
How to use checksums
0fd542b4db269b64759998808414f38cca1683d705d4a876a0317c050557a097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 28, 2026.

Transparency log

Release files / polaris_sdk_python-1.0.0rc9-py3-none-any.whl

Download URL polaris_sdk_python-1.0.0rc9-py3-none-any.whl
Size 43.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e28c6397bd2e9fa274336070e918427df873c7fc62d689dec9dfac522b681483
BLAKE2b-256 checksum
How to use checksums
9ca938656f1e9a4fa3a082d14639ded1efef20a948c71f6ed8ef871b079e9f5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 28, 2026.

Transparency log

Security for polaris-sdk-python 1.0.0rc9

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.

Select from 2 files

Attestation for polaris_sdk_python-1.0.0rc9.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 Oct 28, 2026.

Transparency log

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.

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