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.5

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.5
File Size Uploaded
aotrust_protocol-2.3.5.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aotrust-protocol 2.3.5
File Interpreter ABI Platform
aotrust_protocol-2.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / aotrust_protocol-2.3.5.tar.gz

Download URL aotrust_protocol-2.3.5.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d0860e4091d6bbf150f609c0fe96269487803caa72cbb94ddde3620c9bffcf51
BLAKE2b-256 checksum
How to use checksums
c2f28e4cfdd0b55f88919ffbd6d8cfbbab807d0f2e9ce27011dae2b7d2042422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / aotrust_protocol-2.3.5-py3-none-any.whl

Download URL aotrust_protocol-2.3.5-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0a36f0b111b518b249b6e76cb788a557fdf3d987973f1bdbcea1780cd65d2de
BLAKE2b-256 checksum
How to use checksums
d48eb2aa3e9d5aa7f4dc4759b85c8cde615667da59b3a125939d4589c6f9e7e5
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

This release

2.3.5 This release

2 release files

2.3.4

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