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.3
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.3.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aotrust_protocol-2.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / aotrust_protocol-2.3.3.tar.gz
| Download URL | aotrust_protocol-2.3.3.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1e31f747dffce8572bed7d9e1daa16bed1102cc5c28a921ed67d25bf5683af4
|
|
BLAKE2b-256 checksum How to use checksums |
349810f53f9b1263e1ae18dd49d76e6085d38c16f77dc6e0926592838645b1dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / aotrust_protocol-2.3.3-py3-none-any.whl
| Download URL | aotrust_protocol-2.3.3-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b1a18a74a28c34bc2e4bcb1edbb3ecf8f1e94f64e55ff4b73281b4681060318
|
|
BLAKE2b-256 checksum How to use checksums |
bc2206d16e0e0b2d169523193b7dad586256bdea790776114f112b4304cb82e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|