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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aotrust_protocol-2.3.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aotrust_protocol-2.3.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file aotrust_protocol-2.3.0.tar.gz.

File metadata

  • Download URL: aotrust_protocol-2.3.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for aotrust_protocol-2.3.0.tar.gz
Algorithm Hash digest
SHA256 277fca69afce0ab314f190b22a32e1c0b4bfd5929268097f57259f521437e175
MD5 c0b93b21768075dc6a244d71c98fc7fb
BLAKE2b-256 d7b77b95d6b3dc054d18183b8553e0efa58327bae28b9808ba1d5d10ae100aa7

See more details on using hashes here.

File details

Details for the file aotrust_protocol-2.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aotrust_protocol-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41cfafd7a079c96ae6d98d1213821dcceb3a374cfdd72902701bdb969f406dc8
MD5 478d69a5b93299fde9b81b5199bad9b0
BLAKE2b-256 39cca333a25c305a12d8bb9fc09ca52c8be03101b7c01188bb76147d7d8daf03

See more details on using hashes here.

Release history Release notifications | RSS feed

2.3.2

2 files

2.3.1

2 files

This release

2.3.0 This release

2 files

2.2.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page