Skip to main content

paxiom-receipts (Python Reference SDK — v0.3.0)

Zero-dependency Python 3.10+ reference implementation of paxiom.receipt.v0 — open MIT cryptographic proof-of-delivery receipts (Payment-Receipt / X-Paxiom-Receipt), seller key discovery (/.well-known/x402-keys.json), pre-payment x402 seller readiness checks, live Base USDC settlement verification, and FastAPI / Starlette ASGI middleware.

  • Zero required dependencies: Ships a pure-stdlib RFC 8032 Ed25519 implementation (automatically accelerating via OpenSSL cryptography when installed in the environment).
  • 100% byte-compatible with @paxiom/receipts (0.3.0, Node.js): Shares identical PKCS#8 PEM keys, RFC 8785 JCS (jcs-sha256) and non-JSON (raw-sha256) payload hashing, x402 v2 header auto-parsing (CAIP-2 EVM & Solana), Payment-Receipt + X-Paxiom-Receipt headers, and all 16 deterministic trust states (including unauthorized_issuer).
  • Inline PEP 561 types (py.typed): Full type hints for mypy, pyright, and IDE autocomplete.

Install

# From PyPI:
pip install paxiom-receipts

# Optional OpenSSL Ed25519 acceleration:
pip install "paxiom-receipts[fast]"

Seller Quickstart (FastAPI / Starlette / Litestar ASGI)

PaxiomReceiptMiddleware automatically decodes x402 v2 PAYMENT-SIGNATURE / PAYMENT-RESPONSE headers, hashes JSON (jcs-sha256) or Markdown/text/binary (raw-sha256) 2xx responses up to 256 KiB, and attaches signed Payment-Receipt and X-Paxiom-Receipt headers:

import os
from fastapi import FastAPI
from paxiom_receipts import PaxiomReceiptMiddleware

app = FastAPI()

if os.environ.get("PAXIOM_PRIVATE_KEY_PEM"):
    app.add_middleware(
        PaxiomReceiptMiddleware,
        private_key=os.environ["PAXIOM_PRIVATE_KEY_PEM"],
        issuer={
            "name": "acme-python-api",
            "uri": "https://api.acme.dev",
            "keyId": "seller-01",
            "payTo": "0x9786F5532ab7d7556CDa53E3f6c2d937c9b87Bc4",
            "keysUri": "https://api.acme.dev/.well-known/x402-keys.json",
        },
        service_name="Inference API",
    )

@app.post("/v1/infer")
async def infer():
    return {"answer": "42"}  # Emits signed Payment-Receipt + X-Paxiom-Receipt headers

Buyer Quickstart (LangGraph / CrewAI / httpx / requests)

from paxiom_receipts import (
    discover_issuer_keys,
    preflight_x402,
    verify_response_receipt,
    verify_receipt_live,
)

# 1. Free pre-payment seller safety scan via api.paxiom.org/v1/x402/preflight
scan = preflight_x402("https://seller.example/v1/infer", max_budget_atomic="50000")

# 2. Discover seller's published Ed25519 keys (/.well-known/x402-keys.json)
keys_doc = discover_issuer_keys("https://seller.example")

# 3. Offline verification with signer + payTo authorization on any httpx / requests response
check = verify_response_receipt(
    paid_response,
    output=paid_response.json(),
    expected_issuer_public_keys=keys_doc["publicKeys"] if keys_doc["ok"] else None,
    expected_pay_to="0xSellerAddress...",
)

# 4. Free live Base USDC settlement + counter-attestation via api.paxiom.org/v1/receipt/verify-live
if check["trustState"] == "settlement_claimed_not_checked":
    live = verify_receipt_live(
        check["receipt"],
        output=paid_response.json(),
        expected_pay_to="0xSellerAddress...",
    )

Metadata

Release files for paxiom-receipts 0.3.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 paxiom-receipts 0.3.0
File Size Uploaded Provenance Actions
paxiom_receipts-0.3.0.tar.gz 42.4 kB Without provenance Details for paxiom_receipts-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paxiom-receipts 0.3.0
File Interpreter ABI Platform Actions
paxiom_receipts-0.3.0-py3-none-any.whl Python 3 none any Details for paxiom_receipts-0.3.0-py3-none-any.whl

Total release size: 79.9 kB

Release files / paxiom_receipts-0.3.0.tar.gz

Download URL paxiom_receipts-0.3.0.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5b332ba5bb592339b2df864cc27d20a0f38b5a45a2df14a0ce39f2aee1dc83e2
BLAKE2b-256 checksum
How to use checksums
1636603e37b7ca5e45be334a11dec40346f9c7b26a9d608962c40da16c41a555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / paxiom_receipts-0.3.0-py3-none-any.whl

Download URL paxiom_receipts-0.3.0-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f47f571e50c74e96fa2fccddd78d81187472d10d744f96fdfa51cda81c82418
BLAKE2b-256 checksum
How to use checksums
85525d842afecce2e155b6efc017e3b189651c50306f5565bd665b0738143e60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for paxiom-receipts 0.3.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.

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