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.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aotrust_protocol-2.3.6.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aotrust_protocol-2.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / aotrust_protocol-2.3.6.tar.gz
| Download URL | aotrust_protocol-2.3.6.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7db6e25a6d4ab5c329a6585614d9a9aec3b961f5c8cf3260d613ffcbac6ce8d5
|
|
BLAKE2b-256 checksum How to use checksums |
28235fab3d9e1e5bc157ac355caefae1dbdeac122118215f754c24d03b4c8ab6
|
| 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.6-py3-none-any.whl
| Download URL | aotrust_protocol-2.3.6-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3114721a9fb6f13cd9af434ce5249dfd642b5ab75417d44cdcbcb38ae636e47
|
|
BLAKE2b-256 checksum How to use checksums |
9d82c45ff7e2ca2516927a85a4c22b5ffb07a5cadb6fdfdf3027a0875e2a2b96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|