Skip to main content

yadacoin-agent-auth (Python)

Server-side Python SDK for the YadaCoin KEL Agent Auth Protocol.

Implements protocol version 1.2.

Install

# Core (uses public REST API for KEL lookup — no local node required)
pip install yadacoin-agent-auth[rest]

# With a locally running YadaCoin node
pip install yadacoin-agent-auth[node]

Quick start (Tornado)

import os
from yadacoin_agent_auth import AgentAuthValidator, YadaCoinRestKelProvider, AuthError

validator = AgentAuthValidator(
    challenge_secret=os.environ["YADACOIN_AGENT_SECRET"].encode(),
    kel_provider=YadaCoinRestKelProvider("https://yadacoin.io"),
)

# GET /challenge?public_key=<hex>
class ChallengeHandler(BaseHandler):
    async def get(self):
        public_key = self.get_argument("public_key")
        self.write(validator.make_challenge(public_key))

# POST /action
class ActionHandler(BaseHandler):
    async def post(self):
        body = json.loads(self.request.body)
        try:
            auth = await validator.validate(
                public_key=body["public_key"],
                challenge=body["challenge"],
                signature=body["signature"],
            )
        except AuthError as exc:
            self.set_status(exc.http_status)
            return self.write({"error": str(exc)})

        # auth.scope — normalised from W3C VC 2.0 or legacy flat format
        # auth.address — P2PKH address of the verified agent key
        validator.enforce_scope(auth, services=body.get("services"), dest=body.get("dest"))
        # ... your service logic ...

Credential status modes

VCs issued with credentialStatus.mode: "rotation" (default) are one-time-use — the key is revoked once it appears in the KEL. VCs with mode: "temporal" survive key rotations; the verifier instead checks that the VP is signed with the current active key per the KEL.

See §5.1 of the spec for full semantics.

Related

License

YadaCoin Open Source License (YOSL) v1.1 — Copyright © 2017-2026 Matthew Vogel, Inc.

Metadata

Release files for yadacoin-agent-auth 1.3.1

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

Source distribution (sdist)

Source distribution for yadacoin-agent-auth 1.3.1
File Size Uploaded Provenance
yadacoin_agent_auth-1.3.1.tar.gz 9.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yadacoin-agent-auth 1.3.1
File Interpreter ABI Platform
yadacoin_agent_auth-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / yadacoin_agent_auth-1.3.1.tar.gz

Download URL yadacoin_agent_auth-1.3.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a1637f86f9f53626987aab315aa96e4b3a9e8f5a94bce65aecd245f9abe1c23e
BLAKE2b-256 checksum
How to use checksums
54b4c14823e0a1c50c9ea1ed632e14d623b5921754947449ee020df030fc5457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 4, 2026.

Transparency log

Release files / yadacoin_agent_auth-1.3.1-py3-none-any.whl

Download URL yadacoin_agent_auth-1.3.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
786f3f7bfcfb133ff833d600779a5992f28e74d6dae3fb76a57f11d324053cbd
BLAKE2b-256 checksum
How to use checksums
16552131189c8bae77c51af3a113d184f7c120ff5bda45237980585475235bfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 4, 2026.

Transparency log

Security for yadacoin-agent-auth 1.3.1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yadacoin_agent_auth-1.3.1.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 May 4, 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