Install
openclaw skills install aotrust-pdr-notarizationNotarize AI agent work output. Use when proving task completion, creating tamper-proof receipts, or attaching payment proof to a deliverable. Pays via x402 USDC (Base) or NEAR tokens. Flat $0.01 per PDR.
openclaw skills install aotrust-pdr-notarizationIssue a cryptographic proof (PDR) that you performed specific work, with payment attached. The PDR is anchored to NEAR blockchain and publicly verifiable.
For x402 (USDC on Base):
transferWithAuthorizationFor NEAR_DIRECT:
quote first for exact amount)For both paths — work_hash computation (must be deterministic):
sha256(output.encode('utf-8')).hexdigest()sha256(json.dumps(output, sort_keys=True, separators=(',',':')).encode('utf-8')).hexdigest()sha256(raw_bytes).hexdigest()0x prefix. Hash the ACTUAL output, not a description of it.Connect to: https://api.aotrust.link/mcp
Tools (all prefixed agent_notary_):
Note: Tool names follow the pattern
agent_notary_notary_{action}. The doublenotary_notaryis correct — MCP server prefix + tool group. Copy tool names exactly as shown.
agent_notary_notary_quote — get current NEAR price and payment addressagent_notary_notary_notarize — submit with NEAR payment (NEAR_DIRECT)agent_notary_notary_notarize_paid — submit with USDC payment (x402)agent_notary_notary_verify — check status by job_id or work_hash| Method | Type | Status |
|---|---|---|
| NEAR_DIRECT | NEAR_DIRECT (0x01) | Live |
| x402 (Base) | X402_BASE (0x05) | Live |
| Agent Market Escrow | NEAR_ESCROW_LOCK (0x04) → NEAR_ESCROW_SETTLED (0x09) | Beta (Advanced Workflow) |
Important: X402_BASE is 0x05, NOT 0x02.
Step 1: Probe
Call agent_notary_notary_notarize_paid with work_hash, WITHOUT payment header.
Receive HTTP 402 with: usdc_contract, payee_address, amount (10000 = $0.01), chain_id (8453), valid_until.
Step 2: Sign
Sign EIP-3009 transferWithAuthorization:
from: your walletto: payee_address from step 1value: 10000validAfter: current timestampvalidBefore: valid_until from step 1nonce: random 32-byte hexEncode as base64url JSON: {v, r, s, from, to, value, validAfter, validBefore, nonce}.
Step 3: Submit
Call agent_notary_notary_notarize_paid again with same work_hash + header x-payment: <base64url_json>.
Receive PDR with job_id, pdr_hash, pdr_status: "SETTLED", payment_anchor_type: "X402_BASE".
Step 1: Quote
Call agent_notary_notary_quote. Receive: quote_id, near_amount (yoctoNEAR), sink_address, expires_at (5 min TTL).
⚠️ The quote_id is mandatory in Step 3. It binds your payment to this specific notarization request. Do not reuse quote_ids or skip the quote step. If the quote expires before you complete Step 3, restart from Step 1. Payments sent to an expired quote will be refunded within 24h — contact aotrust.near if not received.
Step 2: Pay
Send exactly near_amount yoctoNEAR to sink_address. Get tx_hash (base58 NEAR transaction hash).
Step 3: Submit
Call agent_notary_notary_notarize with work_hash, tx_hash, quote_id.
Receive PDR with job_id, pdr_hash, pdr_status: "SETTLED", payment_anchor_type: "NEAR_DIRECT".
Check status:
Call agent_notary_notary_verify with job_id or work_hash.
"pending" — PDR issued, awaiting daily Merkle anchor (~24h max)"anchored" — permanently recorded on NEAR blockchain"failed" — contact aotrust.nearPublic verification (no MCP required):
GET https://api.aotrust.link/v1/pdr/verify/{pdr_hash_base64url}
Returns JSON: valid, work_hash, payment_anchor_type, timestamp, tx_hash, merkle_root, near_anchor_tx, on_chain_verified.
pdr_hash (SHA-256 of PDR) to Agent Marketjob_id to re-retrieve PDR anytime| Error | Action |
|---|---|
| 402 (no x-payment) | Expected on probe — proceed to sign |
| 400 invalid_work_hash | Re-compute as sha256hex with correct serialization |
| 400 quote_expired | Restart from quote step. Old payment refunded within 24h |
| 400 payment_verification_failed | Check payment tx on explorer |
| 409 duplicate_work_hash | Use verify with work_hash to retrieve existing PDR |
| 429 rate_limited | Wait 60s and retry once. 60 req/min per IP |
| 503 anchoring_delayed | PDR is valid, check back in 24h |
Two-phase escrow-based notarization for NEAR Agent Market (market.near.ai). Uses PROVISIONAL PDR (NEAR_ESCROW_LOCK, 0x04) at work completion and SETTLED PDR (NEAR_ESCROW_SETTLED, 0x09) after escrow release. Flat $0.01 equivalent. See docs.aotrust.link for integration details.
api.aotrust.link. Staging: api-staging.aotrust.link.notary-node.near.