Sign In

aotrust-protocol

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aotrust-protocol

Asyncio-native SDK for A&O Trust Layer — Agent Notary Service

pipPyPI
Version
2.3.2
Weekly downloads
509
Maintainers
1
Created

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 VarConstructor ArgDescription
NOTARY_API_KEYapi_keyAPI key for auth
NOTARY_API_URLbase_urlAPI base URL
NOTARY_PUBKEYnotary_pubkeyNotary Ed25519 public key (hex)

Endpoints

MethodPathDescription
POST/v1/notarizeSubmit notarization
GET/v1/status/{job_id}Poll job status
GET/v1/pdr/{job_id}Get PDR
POST/v1/notarize/quoteGet price quote
GET/.well-known/agent.jsonMCP Server Card
GET/openapi.jsonOpenAPI 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

FAQs

Related posts