Skip to main content

aotrust-protocol SDK

Asyncio-native Python SDK for the AOTrust Notary API — cryptographic proof-of-existence for AI agent outputs.

Install

pip install aotrust-protocol

Quickstart

import asyncio
from agent_notary import NotaryClient, NotarizeRequest

async def main():
    client = NotaryClient(
        api_key="your-api-key",
        base_url="https://api.aotrust.link/v1"
    )

    # Submit notarization
    req = NotarizeRequest(
        tx_hash="EzrfDW5b...",
        work_hash="599d6999...",
        agent_sig="base64_sig_A...",
        agent_pubkey="aff91a18...",
    )
    result = await client.notarize(req)
    print(f"Job: {result.job_id}")

    # Poll for PDR
    status = await client.wait_for_pdr(result.job_id, timeout=60)
    if status.is_anchored:
        pdr = await client.get_pdr(result.job_id)
        assert pdr.verify(client.notary_pubkey)
        print("PDR Valid: YES")

asyncio.run(main())

Configuration

Env Var Constructor Arg Description
NOTARY_API_KEY api_key API key for auth
NOTARY_API_URL base_url API base URL
NOTARY_PUBKEY notary_pubkey Notary Ed25519 public key (hex)

Endpoints

Method Path Description
POST /v1/notarize Submit notarization
GET /v1/status/{job_id} Poll job status
GET /v1/pdr/{job_id} Get PDR
POST /v1/notarize/quote Get price quote
GET /.well-known/agent.json MCP Server Card
GET /openapi.json OpenAPI 3.0 spec

PDR Verification

pdr = await client.get_pdr(job_id)
is_valid = pdr.verify(notary_pubkey_hex="9c7d64bb...")

Uses NEP-413 raw-buffer verification. No SHA256 pre-hash.

Error Handling

from agent_notary.exceptions import NotaryAuthError, NotaryPaymentError, NotaryNotFoundError

try:
    result = await client.notarize(req)
except NotaryAuthError:
    print("Invalid API key")
except NotaryPaymentError as e:
    print(f"Payment/sig failed: {e}")

Development

pip install -e ".[dev]"
pytest tests/ -v

Metadata

Release files for aotrust-protocol 2.3.4

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

Source distribution (sdist)

Source distribution for aotrust-protocol 2.3.4
File Size Uploaded
aotrust_protocol-2.3.4.tar.gz 12.3 kB Details

Release files / aotrust_protocol-2.3.4.tar.gz

Download URL aotrust_protocol-2.3.4.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
16193e0541d40753cca62d84e5a4f72cb253ac354e9ca18460de44aecf2f0b36
BLAKE2b-256 checksum
How to use checksums
30a431636401b7c36a889befc67de627fd786a040c3d1a78bdfe1c518ca9c6d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

2.3.7

2 release files

2.3.6

2 release files

2.3.5

2 release files

This release

2.3.4 This release

1 release file

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

1 release file

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