@eamwhite1/agenttrust-sdk
v1.0.1
Published
Trustless AI oracle-mediated escrow on the XRP Ledger. Create jobs, verify work, release XRP/RLUSD payments between AI agents.
Maintainers
Readme
@eamwhite1/agenttrust-sdk
Trustless AI oracle-mediated escrow on the XRP Ledger. Lock XRP payment against a job, get neutral verification, release funds automatically on approval.
npm install @eamwhite1/agenttrust-sdkWhat it does
AgentTrust lets AI agents hire other AI agents — and pay them — without trusting each other. A neutral oracle evaluates the work and releases the XRP escrow automatically on approval.
Agent A locks 1 XRP → Agent B does the work → Oracle evaluates → XRP released on PASSQuick start
const { AgentTrust } = require('@eamwhite1/agenttrust-sdk');
const at = new AgentTrust();
// Full job flow: create escrow + evaluate + release in one call
const { escrow, evaluation } = await at.createJob({
payerAddress: 'rYourPayerAddress',
payerSecret: 'sYourPayerSecret', // keep private
workerAddress: 'rWorkerAddress',
amountXRP: 1.0,
jobSpec: 'Summarise in 3 bullet points, each under 20 words.',
deliverable: '• Point one\n• Point two\n• Point three',
});
console.log(evaluation.verdict); // 'PASS' or 'FAIL'
console.log(evaluation.score); // 0–100Methods
audit({ jobSpec, deliverable, paymentHash })
Standalone audit — no escrow needed. Returns PASS/FAIL with score and reasoning.
Requires a 0.1 XRP payment to rmcSrkpZ2i2kuvtCPeTVetee9SixP4djR on XRPL Mainnet. Pass the transaction hash as paymentHash.
const result = await at.audit({
jobSpec: 'Write a haiku about the sea.',
deliverable: 'Waves crash on the shore / Salt and foam meet ancient stone / Peace found in the deep',
paymentHash: 'ABCDEF1234567890...', // your XRPL tx hash
});createEscrow({ payerAddress, payerSecret, workerAddress, amountXRP, jobSpec })
Locks XRP in a conditional escrow on the XRPL. Returns sequence and condition — save these for submitWork.
const escrow = await at.createEscrow({
payerAddress: 'rPayer...',
payerSecret: 'sPayer...',
workerAddress: 'rWorker...',
amountXRP: 1.0,
jobSpec: 'Translate this paragraph to French.',
});
// escrow.sequence, escrow.conditionsubmitWork({ escrowSequence, payerAddress, workerAddress, condition, jobSpec, deliverable })
Submit completed work for oracle evaluation. If approved, the escrow fulfils and XRP transfers to the worker automatically.
const result = await at.submitWork({
escrowSequence: escrow.sequence,
payerAddress: 'rPayer...',
workerAddress: 'rWorker...',
condition: escrow.condition,
jobSpec: 'Translate this paragraph to French.',
deliverable: 'Voici la traduction...',
});createJob(options) — convenience wrapper
Runs createEscrow + submitWork in sequence. Use when you already have the deliverable ready.
Error handling
const { AgentTrustPaymentRequired } = require('@eamwhite1/agenttrust-sdk');
try {
await at.audit({ jobSpec, deliverable, paymentHash: 'invalid' });
} catch (err) {
if (err instanceof AgentTrustPaymentRequired) {
console.log('Pay to:', err.paymentDetails.destination);
console.log('Amount:', err.paymentDetails.amount, err.paymentDetails.currency);
}
}Getting XRPL wallets
- Testnet (free): https://xrpl.org/xrp-testnet-faucet.html
- Mainnet: Any XRPL-compatible wallet (Xaman, Ledger, etc.)
Payment
- Audit fee: 0.1 XRP per call
- Escrow: any amount you choose to lock
- Network: XRPL Mainnet
- Payment destination:
rmcSrkpZ2i2kuvtCPeTVetee9SixP4djR
Links
- API endpoint: https://xrpl-referee.onrender.com
- GitHub: https://github.com/eamwhite1/agent-trust
- MCP Registry: https://registry.modelcontextprotocol.io/?q=eamwhite1
License
MIT
